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 bfae1d4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/border_agent/border_agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ static const char kBorderAgentServiceType[] = "_meshcop._udp"; ///< Bo
static const char kBorderAgentEpskcServiceType[] = "_meshcop-e._udp"; ///< Border agent ePSKc service
static constexpr int kBorderAgentServiceDummyPort = 49152;

static const uint16_t kThreadVersion11 = 2; ///< Thread Version 1.1
static const uint16_t kThreadVersion12 = 3; ///< Thread Version 1.2
static const uint16_t kThreadVersion13 = 4; ///< Thread Version 1.3
static const uint16_t kThreadVersion14 = 5; ///< Thread Version 1.4

/**
* Locators
*
Expand Down Expand Up @@ -163,6 +168,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("otVersion:%d, IsEphemeralKeyEnabled:%d during initialization", otThreadGetVersion(),
mIsEphemeralKeyEnabled);
}

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

0 comments on commit bfae1d4

Please sign in to comment.