Closed artjomg closed 9 years ago
Please raise (just copy -paste issue) on google group and let us follow it there.
This test is passing https://github.com/RishiGupta12/serial-communication-manager/blob/master/tests/test56-dl-removePort/src/test56/Test56.java
Please take a look at when error occurs, 1st unregister listener(s) and then close port. Now if you plugin the device again, open port and register listener.
Moved to Google group Discussion https://groups.google.com/forum/#!topic/serial-communication-manager/Bvi5xfyjix0
Hi,
I am on mac OS X 10.9.5 and running into issues with listeners when the USB port is disconnected. I create and register the required listeners via, where app implements the ISerialComPortMonitor as following:
I receive the disconnect/connects events properly, but right after the disconnect ISerialComDataListener starts to flood with errors at: @Override public void onDataListenerError(int arg0) { System.out.println("onDataListenerError called"); }
I tried couple of things to unregister and reregister the listeners (event,data) which just guides to detachment of listeners and registration exceptions. Reconnection to the port fails, since the port is still open. Rerun and create new scm instance helps, but detaches the listeners on and I get "Listener not registered" errors on next USB detachment.
How can I avoid the onDataListenerError calls or am I missing something?
Expected behavior.
Another remark: I can kill the JVM by simply trying to unregister the portListeners when onPortMonitorEvent == 2 is called. Which is a stupid circular parent destroy access I know, but it should be handled properly without killing the VM. Again all OSX.
Thanks, Rtg