Fazecast / jSerialComm

Platform-independent serial port access for Java
GNU Lesser General Public License v3.0
1.34k stars 287 forks source link

getInputStream() not working after a connection lost #249

Closed FelipeVM00 closed 5 years ago

FelipeVM00 commented 5 years ago

I am using spring boot to expose some services that connect to a barcode scanner, I am using jserialcomm to read bytes from the scanner. When the service is called and canceled without reading anything and the getinputstream method is called again returns null. image image

hedgecrw commented 5 years ago

The only way for getInputStream() to return null is if the call to openPort() fails. Please add a check for the success of openPort() in your activation routine. Also in getPort(), you are blindly returning the first value/port enumerated by getCommPorts(). Please verify that the port being returned is actually the port you are expecting and not something else.

hedgecrw commented 5 years ago

Closing due to inactivity and not a library bug. Please reopen if you have more information regarding this as a library issue.