File tree 2 files changed +9
-7
lines changed
2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -62,14 +62,14 @@ struct Nullable : protected std::optional<T>
62
62
return std::optional<T>::emplace (std::forward<Args>(args)...);
63
63
}
64
64
65
- template <typename ... Args >
66
- constexpr auto ValueOr (Args &&... args ) const
65
+ template <typename Arg >
66
+ constexpr auto ValueOr (Arg && arg ) const
67
67
{
68
- return std::optional<T>::value_or (std::forward<Args>(args)... );
68
+ return std::optional<T>::value_or (std::forward<Arg>(arg) );
69
69
}
70
70
71
- constexpr const T & Value () const { return ** this ; }
72
- T & Value () { return ** this ; }
71
+ inline constexpr const T & Value () const { return std::optional<T>:: value () ; }
72
+ inline T & Value () { return std::optional<T>:: value () ; }
73
73
74
74
// For integer types, being nullable involves a range restriction.
75
75
template <
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ using chip::app::DataModel::NullNullable;
40
40
41
41
namespace {
42
42
43
+ constexpr uint32_t kFailSafeTimeoutSeconds = 3 ;
44
+
43
45
// As per specifications (Section 13.3), Nodes SHALL exit commissioning mode after 20 failed commission attempts.
44
46
constexpr uint8_t kMaxFailedCommissioningAttempts = 20 ;
45
47
@@ -174,7 +176,7 @@ void CommissioningWindowManager::HandleFailedAttempt(CHIP_ERROR err)
174
176
void CommissioningWindowManager::OnSessionEstablishmentStarted ()
175
177
{
176
178
// As per specifications, section 5.5: Commissioning Flows
177
- constexpr System::Clock::Timeout kPASESessionEstablishmentTimeout = System::Clock::Seconds16 (60 );
179
+ constexpr System::Clock::Timeout kPASESessionEstablishmentTimeout = System::Clock::Seconds16 (kFailSafeTimeoutSeconds );
178
180
DeviceLayer::SystemLayer ().StartTimer (kPASESessionEstablishmentTimeout , HandleSessionEstablishmentTimeout, this );
179
181
180
182
ChipLogProgress (AppServer, " Commissioning session establishment step started" );
@@ -208,7 +210,7 @@ void CommissioningWindowManager::OnSessionEstablished(const SessionHandle & sess
208
210
}
209
211
else
210
212
{
211
- err = failSafeContext.ArmFailSafe (kUndefinedFabricIndex , System::Clock::Seconds16 (60 ));
213
+ err = failSafeContext.ArmFailSafe (kUndefinedFabricIndex , System::Clock::Seconds16 (kFailSafeTimeoutSeconds ));
212
214
if (err != CHIP_NO_ERROR)
213
215
{
214
216
ChipLogError (AppServer, " Error arming failsafe on PASE session establishment completion" );
You can’t perform that action at this time.
0 commit comments