Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce retransmit timeout after a CAN collision #2566

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions cpp/src/Defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion cpp/src/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down