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

make MAX_TRIES configurable #2469

Open
wants to merge 1 commit 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config/options.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
This is unlikely to fix any timeout issues you may have -->
<!-- <Option name="RetryTimeout" value="40000" /> -->

<!-- How many times do we try to send a message before giving up. -->
<!-- <Option name="MaxTries" value="1" /> -->

<!-- If you are using any Security Devices, you MUST set a network Key -->
<!-- <Option name="NetworkKey" value="0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10" /> -->

Expand Down
7 changes: 7 additions & 0 deletions cpp/src/Msg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "command_classes/MultiInstance.h"
#include "command_classes/Security.h"
#include "aes/aescpp.h"
#include "Options.h"

namespace OpenZWave
{
Expand Down Expand Up @@ -67,6 +68,12 @@ namespace OpenZWave
m_buffer[1] = 0; // Length of the following data, filled in during Finalize.
m_buffer[2] = _msgType;
m_buffer[3] = _function;

int maxTries = MAX_TRIES;
if (Options::Get()->GetOptionAsInt("MaxTries", &maxTries))
{
m_maxSendAttempts = maxTries;
}
}

//-----------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions cpp/src/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ Options* Options::Create(string const& _configPath, string const& _userPath, str
s_instance->AddOptionString("NetworkKey", string(""), false);
s_instance->AddOptionBool("RefreshAllUserCodes", false); // if true, during startup, we refresh all the UserCodes the device reports it supports. If False, we stop after we get the first "Available" slot (Some devices have 250+ usercode slots! - That makes our Session Stage Very Long )
s_instance->AddOptionInt("RetryTimeout", RETRY_TIMEOUT); // How long do we wait to timeout messages sent
s_instance->AddOptionInt("MaxTries", MAX_TRIES); // How many time do we retry a message before giving up
s_instance->AddOptionBool("EnableSIS", true); // Automatically become a SUC if there is no SUC on the network.
s_instance->AddOptionBool("AssumeAwake", true); // Assume Devices that Support the Wakeup CC are awake when we first query them....
s_instance->AddOptionBool("NotifyOnDriverUnload", false); // Should we send the Node/Value Notifications on Driver Unloading - Read comments in Driver::~Driver() method about possible race conditions
Expand Down