Skip to content

Commit

Permalink
Add default timeout to fix KVS error when fetching ExtendedTimoutConf…
Browse files Browse the repository at this point in the history
…ig (#11904)

* Add default timeout to fix KVS error when fetching ExtendedTimoutConfig

* Replace Mdns with Dnssd
  • Loading branch information
michalbudzon-q authored and pull[bot] committed Mar 22, 2022
1 parent e4ff5d5 commit c620566
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/lighting-app/qpg/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/server/Dnssd.h>
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>

Expand Down Expand Up @@ -73,6 +74,10 @@ StaticTask_t appTaskStruct;

AppTask AppTask::sAppTask;

namespace {
constexpr int extDiscTimeoutSecs = 20;
}

CHIP_ERROR AppTask::StartAppTask()
{
sAppEventQueue = xQueueCreateStatic(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent), sAppEventQueueBuffer, &sAppEventQueueStruct);
Expand Down Expand Up @@ -109,6 +114,10 @@ CHIP_ERROR AppTask::Init()
// Subscribe with our button callback to the qvCHIP button handler.
qvIO_SetBtnCallback(ButtonEventHandler);

#if CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY
chip::app::DnssdServer::Instance().SetExtendedDiscoveryTimeoutSecs(extDiscTimeoutSecs);
#endif

// Init ZCL Data Model
chip::Server::GetInstance().Init();

Expand Down
9 changes: 9 additions & 0 deletions examples/lock-app/qpg/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/server/Dnssd.h>
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>

Expand Down Expand Up @@ -72,6 +73,10 @@ StaticTask_t appTaskStruct;

AppTask AppTask::sAppTask;

namespace {
constexpr int extDiscTimeoutSecs = 20;
}

CHIP_ERROR AppTask::StartAppTask()
{
sAppEventQueue = xQueueCreateStatic(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent), sAppEventQueueBuffer, &sAppEventQueueStruct);
Expand Down Expand Up @@ -110,6 +115,10 @@ CHIP_ERROR AppTask::Init()

qvIO_LedSet(LOCK_STATE_LED, !BoltLockMgr().IsUnlocked());

#if CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY
chip::app::DnssdServer::Instance().SetExtendedDiscoveryTimeoutSecs(extDiscTimeoutSecs);
#endif

// Init ZCL Data Model
chip::Server::GetInstance().Init();

Expand Down
9 changes: 9 additions & 0 deletions examples/platform/qpg/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "qvCHIP.h"

// CHIP includes
#include <app/server/Dnssd.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CHIPPlatformMemory.h>
#include <lib/support/logging/CHIPLogging.h>
Expand All @@ -46,6 +47,10 @@ using namespace ::chip::Inet;
using namespace ::chip::DeviceLayer;
using namespace ::chip::DeviceLayer::Internal;

namespace {
constexpr int extDiscTimeoutSecs = 20;
}

/*****************************************************************************
* Macro Definitions
*****************************************************************************/
Expand Down Expand Up @@ -122,6 +127,10 @@ CHIP_ERROR CHIP_Init(void)
}
#endif // CHIP_ENABLE_OPENTHREAD

#if CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY
chip::app::DnssdServer::Instance().SetExtendedDiscoveryTimeoutSecs(extDiscTimeoutSecs);
#endif

ChipLogProgress(NotSpecified, "Starting Platform Manager Event Loop");
ret = PlatformMgr().StartEventLoopTask();
if (ret != CHIP_NO_ERROR)
Expand Down

0 comments on commit c620566

Please sign in to comment.