You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey!
I'm adding your library to my project but I am having some issues. I want to reliable reconnect to a device if the connection has been lost.
Right now I'm checking if !serial_.isOpen() and if so I'm calling serial_.open. This works fine. Then as testing I'm disconnecting the USB cable which means that now we have serial_.errorStatus() == true. Then I want to replug the connector and for the connection to resume however the obvious choicse of close() and then open doesn't work as expected as it seems that the errorStatus() is not being properly cleared.
If I don't try to close, and just continuously try to open the connection I see that the open() call returns without any error, the port is open and without any error, but then at the next iteration of the loop it has an error once again. I believe that the thread isn't properly handled in this scenario and a new one is created and destroyed everytime.
The only way that I have gotten this to work is by resetting the connection with:
serial_.~BufferedAsyncSerial();
new (&serial_) BufferedAsyncSerial();
But this seems a workaround that shouldn't be needed. Do you have a solution for this @fedetft ?
Thank you very much in advance.
The text was updated successfully, but these errors were encountered:
@fedetft any clues? I'm currently debugging this and I could offer a fix or explanation for future users but I could also use some help from your side.
Hey!
I'm adding your library to my project but I am having some issues. I want to reliable reconnect to a device if the connection has been lost.
Right now I'm checking if
!serial_.isOpen()
and if so I'm callingserial_.open
. This works fine. Then as testing I'm disconnecting the USB cable which means that now we haveserial_.errorStatus() == true
. Then I want to replug the connector and for the connection to resume however the obvious choicse ofclose()
and thenopen
doesn't work as expected as it seems that theerrorStatus()
is not being properly cleared.If I don't try to close, and just continuously try to open the connection I see that the
open()
call returns without any error, the port isopen
and without any error, but then at the next iteration of the loop it has an error once again. I believe that the thread isn't properly handled in this scenario and a new one is created and destroyed everytime.The only way that I have gotten this to work is by resetting the connection with:
But this seems a workaround that shouldn't be needed. Do you have a solution for this @fedetft ?
Thank you very much in advance.
The text was updated successfully, but these errors were encountered: