diff --git a/cpp/src/Defs.h b/cpp/src/Defs.h index 2789311d88..238a083e34 100644 --- a/cpp/src/Defs.h +++ b/cpp/src/Defs.h @@ -224,6 +224,7 @@ namespace OpenZWave #define MAX_TRIES 1 // set this to one, as I believe now that a ACK failure is indication that the device is offline, hence additional attempts will not work. #define MAX_MAX_TRIES 7 // Don't exceed this retry limit #define ACK_TIMEOUT 1000 // How long to wait for an ACK +#define CAN_NAK_TIMEOUT 50 // How long to wait before re-transmit after a CAN. #define BYTE_TIMEOUT 150 //#define RETRY_TIMEOUT 40000 // Retry send after 40 seconds #define RETRY_TIMEOUT 10000 // Retry send after 10 seconds (we might need to keep this below 10 for Security CC to function correctly) diff --git a/cpp/src/Driver.cpp b/cpp/src/Driver.cpp index 0bc39400d6..4c52ff90ac 100644 --- a/cpp/src/Driver.cpp +++ b/cpp/src/Driver.cpp @@ -375,7 +375,9 @@ void Driver::DriverThreadProc(Internal::Platform::Event* _exitEvent) else if (m_waitingForAck || m_expectedCallbackId || m_expectedReply) { count = 4; - timeout = m_waitingForAck ? ACK_TIMEOUT : retryTimeStamp.TimeRemaining(); + timeout = !m_waitingForAck ? retryTimeStamp.TimeRemaining() : + m_currentMsg != NULL && m_currentMsg->isResendDuetoCANorNAK() ? CAN_NAK_TIMEOUT : + ACK_TIMEOUT; if (timeout < 0) { timeout = 0;