30
30
31
31
using namespace chip ::Dnssd;
32
32
using namespace chip ::Dnssd::Internal;
33
- using namespace chip ::DeviceLayer ;
33
+ using namespace chip ::Platform ;
34
34
35
35
namespace {
36
36
@@ -39,7 +39,7 @@ constexpr char kLocalDot[] = "local.";
39
39
constexpr char kSRPDot [] = " default.service.arpa." ;
40
40
41
41
// The extra time in milliseconds that we will wait for the resolution on the SRP domain to complete.
42
- constexpr uint16_t kSRPTimeoutInMsec = 3000 ;
42
+ constexpr uint16_t kSRPTimeoutInMsec = 250 ;
43
43
44
44
constexpr DNSServiceFlags kRegisterFlags = kDNSServiceFlagsNoAutoRename ;
45
45
constexpr DNSServiceFlags kBrowseFlags = kDNSServiceFlagsShareConnection ;
@@ -81,11 +81,8 @@ CHIP_ERROR StartSRPTimer(uint16_t timeoutInMSecs, ResolveContext * ctx)
81
81
// Check to see if a user default value exists for the SRP timeout. If it does, override the timeoutInMSecs with user default
82
82
// value. To override the timeout value, use ` defaults write org.csa-iot.matter.darwin SRPTimeoutInMSecsOverride
83
83
// <timeoutinMsecs>` See UserDefaults.mm for details.
84
- uint16_t userDefaultSRPTimeoutInMsecs = getUserDefaultDnssdSRPTimeoutInMSecs ();
85
- if (userDefaultSRPTimeoutInMsecs)
86
- {
87
- timeoutInMSecs = userDefaultSRPTimeoutInMsecs;
88
- }
84
+ timeoutInMSecs = GetUserDefaultDnssdSRPTimeoutInMSecs ().value_or (timeoutInMSecs);
85
+
89
86
VerifyOrReturnValue (ctx != nullptr , CHIP_ERROR_INCORRECT_STATE);
90
87
ChipLogProgress (Discovery, " Starting timer to wait for %d milliseconds for possible SRP resolve results for %s" , timeoutInMSecs,
91
88
ctx->instanceName .c_str ());
0 commit comments