Skip to content

Commit

Permalink
[epskc] set ePSKc init status according to otversion
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhyang committed Aug 9, 2024
1 parent 92ac6cb commit ea421c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/border_agent/border_agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ static const char kBorderAgentServiceType[] = "_meshcop._udp"; ///< Bo
static const char kBorderAgentEpskcServiceType[] = "_meshcop-e._udp"; ///< Border agent ePSKc service
static constexpr int kBorderAgentServiceDummyPort = 49152;

static constexpr uint16_t kThreadVersion14 = 5; ///< Thread Version 1.4

/**
* Locators
*
Expand Down Expand Up @@ -163,6 +165,9 @@ BorderAgent::BorderAgent(otbr::Ncp::RcpHost &aHost, Mdns::Publisher &aPublisher)
, mBaseServiceInstanceName(OTBR_MESHCOP_SERVICE_INSTANCE_NAME)
{
mHost.AddThreadStateChangedCallback([this](otChangedFlags aFlags) { HandleThreadStateChanged(aFlags); });
mIsEphemeralKeyEnabled = (otThreadGetVersion() >= kThreadVersion14);
otbrLogInfo("Thread Version: %d. ", otThreadGetVersion());
otbrLogInfo("IsEphemeralKeyEnabled: %s during initialization", (mIsEphemeralKeyEnabled ? "enabled" : "disabled"));
}

otbrError BorderAgent::SetMeshCopServiceValues(const std::string &aServiceInstanceName,
Expand Down

0 comments on commit ea421c1

Please sign in to comment.