diff --git a/examples/lighting-app/qpg/src/AppTask.cpp b/examples/lighting-app/qpg/src/AppTask.cpp index ab74cdd415d5b2..2addad9a41f715 100644 --- a/examples/lighting-app/qpg/src/AppTask.cpp +++ b/examples/lighting-app/qpg/src/AppTask.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -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); @@ -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(); diff --git a/examples/lock-app/qpg/src/AppTask.cpp b/examples/lock-app/qpg/src/AppTask.cpp index 9f01c2961ae7bd..f146612baf693e 100644 --- a/examples/lock-app/qpg/src/AppTask.cpp +++ b/examples/lock-app/qpg/src/AppTask.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -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); @@ -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(); diff --git a/examples/platform/qpg/app/main.cpp b/examples/platform/qpg/app/main.cpp index ce22bfc5c6e7df..98adc615a87934 100644 --- a/examples/platform/qpg/app/main.cpp +++ b/examples/platform/qpg/app/main.cpp @@ -33,6 +33,7 @@ #include "qvCHIP.h" // CHIP includes +#include #include #include #include @@ -46,6 +47,10 @@ using namespace ::chip::Inet; using namespace ::chip::DeviceLayer; using namespace ::chip::DeviceLayer::Internal; +namespace { +constexpr int extDiscTimeoutSecs = 20; +} + /***************************************************************************** * Macro Definitions *****************************************************************************/ @@ -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)