mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Merge pull request #353 from NicoHood/patch-1
Fix RS232 reconnect bug Former-commit-id: 062ecb5e3db6c44d654fababdfdb3cfd2be967a0
This commit is contained in:
commit
e65ee859ec
@ -64,7 +64,16 @@ int LedRs232Device::writeBytes(const unsigned size, const uint8_t * data)
|
|||||||
|
|
||||||
if (!_rs232Port.isOpen())
|
if (!_rs232Port.isOpen())
|
||||||
{
|
{
|
||||||
return -1;
|
// try to reopen
|
||||||
|
int status = open();
|
||||||
|
if(status == -1){
|
||||||
|
// Try again in 3 seconds
|
||||||
|
int seconds = 3000;
|
||||||
|
_blockedForDelay = true;
|
||||||
|
QTimer::singleShot(seconds, this, SLOT(unblockAfterDelay()));
|
||||||
|
std::cout << "Device blocked for " << seconds << " ms" << std::endl;
|
||||||
|
}
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
// for (int i = 0; i < 20; ++i)
|
// for (int i = 0; i < 20; ++i)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user