Skip to content

Commit

Permalink
[Server] Ensure that the interface id that is passed as a parameter i…
Browse files Browse the repository at this point in the history
…s used when auto pairing is enabled (#17243)
  • Loading branch information
vivien-apple authored Apr 12, 2022
1 parent c166859 commit c9350f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams)
SuccessOrExit(err);
#endif

app::DnssdServer::Instance().SetSecuredPort(mOperationalServicePort);
app::DnssdServer::Instance().SetUnsecuredPort(mUserDirectedCommissioningPort);
app::DnssdServer::Instance().SetInterfaceId(mInterfaceId);

if (GetFabricTable().FabricCount() != 0)
{
// The device is already commissioned, proactively disable BLE advertisement.
Expand All @@ -223,10 +227,6 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams)
#endif
}

app::DnssdServer::Instance().SetSecuredPort(mOperationalServicePort);
app::DnssdServer::Instance().SetUnsecuredPort(mUserDirectedCommissioningPort);
app::DnssdServer::Instance().SetInterfaceId(mInterfaceId);

// TODO @bzbarsky-apple @cecille Move to examples
// ESP32 and Mbed OS examples have a custom logic for enabling DNS-SD
#if !CHIP_DEVICE_LAYER_TARGET_ESP32 && !CHIP_DEVICE_LAYER_TARGET_MBED && \
Expand Down

0 comments on commit c9350f7

Please sign in to comment.