I think RxTx throws an Exception for this scenario. I use JavaComm so don't know exact behavior. You can just replace JavaComm with RxTx and simulate the problem to find out what happens.
I used to get occasional WaitCommEvent errors earlier but they all went away after I patched up the server's firmware and updated all vendor recommended hardware updates. If you are using a USB-Serial converter, get a good quality one. Converters based on Prolific chipsets haven't work well for me. FTDI is much better. --Nizam On Thu, Dec 8, 2011 at 9:48 PM, penugonda chenna reddy <[email protected] > wrote: > Nizam Mohideen, > > Could you let me know how to detect the same using RxTx library. > > If the modem is disconnected how to detect the same. > > Regards > PCReddy > On Thu, Dec 8, 2011 at 4:16 PM, Nizam Mohideen > <[email protected]>wrote: > >> The WaitCommEvent error is an artifact of the JavaComm library. As far as >> I know there is no way to intercept it in the Java code. I believe the RxTx >> library does not have this issue. >> >> >> On Thu, Dec 8, 2011 at 4:11 PM, Alex Anderson < >> [email protected]> wrote: >> >>> I don't think there's any way of actually capturing this output, or >>> preventing it being added to stderr, but it should also be accompanied >>> by an IOException which you can catch in the Java code. >>> >>> Happy to be corrected if I'm wrong! >>> >>> On 8 December 2011 12:45, smaran <[email protected]> wrote: >>> > If the modem is taken out from the PC it generates >>> > WaitCommEvent: Error 31 >>> > WaitCommEvent: Error 31 >>> > WaitCommEvent: Error 31 >>> > WaitCommEvent: Error 31 >>> > WaitCommEvent: Error 31 >>> > WaitCommEvent: Error 31 >>> > WaitCommEvent: Error 31 >>> > WaitCommEvent: Error 31 >>> > >>> > on standard output. >>> > >>> > How to capture this in program and report the same in a Java Based GUI >>> > application as an error that the >>> > "Modem got disconnected. Pl. check" >>> > >>> > >>> > How to do the same in Windows Environment. >>> > >>> > Regards >>> > PCReddy >>> > >>> > -- >>> > You received this message because you are subscribed to the Google >>> Groups "SMSLib Discussion Group" group. >>> > To post to this group, send email to [email protected]. >>> > To unsubscribe from this group, send email to >>> [email protected]. >>> > For more options, visit this group at >>> http://groups.google.com/group/smslib?hl=en. >>> > >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "SMSLib Discussion Group" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/smslib?hl=en. >>> >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "SMSLib Discussion Group" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/smslib?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "SMSLib Discussion Group" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/smslib?hl=en. > -- You received this message because you are subscribed to the Google Groups "SMSLib Discussion Group" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/smslib?hl=en.
