Skip to content

Commit 870ac49

Browse files
Fix max timeout for open commissioning window
Commissioning window can be opened using timeout exceeding the maximum value of 900 s defined by the spec. This can happen if selected transport is IP, but the device uses BLE extended announcement feature. Added checking if device is commissioned to be able to determine what max timeout should be used for the particular scenario. Fixes: project-chip#35505
1 parent 83d345e commit 870ac49

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/app/server/CommissioningWindowManager.h

+7-4
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,15 @@ class CommissioningWindowManager : public Messaging::UnsolicitedMessageHandler,
6161
static constexpr System::Clock::Seconds32 MaxCommissioningTimeout()
6262
{
6363
#if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING
64-
// Specification section 2.3.1 - Extended Announcement Duration up to 48h
65-
return System::Clock::Seconds32(60 * 60 * 48);
66-
#else
64+
/* Allow for extended announcement only when device is uncomissioned. */
65+
if (GetFabricTable().FabricCount() == 0)
66+
{
67+
// Specification section 2.3.1 - Extended Announcement Duration up to 48h
68+
return System::Clock::Seconds32(60 * 60 * 48);
69+
}
70+
#endif
6771
// Specification section 5.4.2.3. Announcement Duration says 15 minutes.
6872
return System::Clock::Seconds32(15 * 60);
69-
#endif
7073
}
7174

7275
System::Clock::Seconds32 MinCommissioningTimeout() const

0 commit comments

Comments
 (0)