mirror of
https://github.com/espressif/openthread.git
synced 2026-08-17 16:09:51 +00:00
[meshcop] introduce NetworkIdentity class (#12343)
This commit introduces `NetworkIdentity` class to track the network identity parameters, specifically Extended PAN ID, Network Name and Domain Name. The new class replaces the `ExtendedPanIdManager` and `NetworkNameManager` which are removed by this commit. This change simplifies `extended_panid.hpp` and `network_name.hpp`. They now contain only basic type definitions (`ExtendedPanId` and `NetworkName`). This allows these headers to be included in other modules without pulling in unnecessary header dependencies.
This commit is contained in:
@@ -2738,7 +2738,7 @@ void Mle::HandleDiscoveryRequest(RxInfo &aRxInfo)
|
||||
|
||||
case MeshCoP::Tlv::kExtendedPanId:
|
||||
SuccessOrExit(error = tlvInfo.Read<MeshCoP::ExtendedPanIdTlv>(aRxInfo.mMessage, extPanId));
|
||||
VerifyOrExit(Get<MeshCoP::ExtendedPanIdManager>().GetExtPanId() != extPanId, error = kErrorDrop);
|
||||
VerifyOrExit(Get<MeshCoP::NetworkIdentity>().GetExtPanId() != extPanId, error = kErrorDrop);
|
||||
|
||||
break;
|
||||
|
||||
@@ -2825,11 +2825,11 @@ Error Mle::SendDiscoveryResponse(const Ip6::Address &aDestination, const Discove
|
||||
|
||||
SuccessOrExit(error = Tlv::Append<MeshCoP::DiscoveryResponseTlv>(*message, discoveryResponseTlvValue));
|
||||
|
||||
SuccessOrExit(
|
||||
error = Tlv::Append<MeshCoP::ExtendedPanIdTlv>(*message, Get<MeshCoP::ExtendedPanIdManager>().GetExtPanId()));
|
||||
SuccessOrExit(error =
|
||||
Tlv::Append<MeshCoP::ExtendedPanIdTlv>(*message, Get<MeshCoP::NetworkIdentity>().GetExtPanId()));
|
||||
|
||||
SuccessOrExit(error = Tlv::Append<MeshCoP::NetworkNameTlv>(
|
||||
*message, Get<MeshCoP::NetworkNameManager>().GetNetworkName().GetAsCString()));
|
||||
*message, Get<MeshCoP::NetworkIdentity>().GetNetworkName().GetAsCString()));
|
||||
|
||||
SuccessOrExit(error = message->AppendSteeringDataTlv());
|
||||
|
||||
@@ -2837,10 +2837,10 @@ Error Mle::SendDiscoveryResponse(const Ip6::Address &aDestination, const Discove
|
||||
error = Tlv::Append<MeshCoP::JoinerUdpPortTlv>(*message, Get<MeshCoP::JoinerRouter>().GetJoinerUdpPort()));
|
||||
|
||||
#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_4)
|
||||
if (!Get<MeshCoP::NetworkNameManager>().IsDefaultDomainNameSet())
|
||||
if (!Get<MeshCoP::NetworkIdentity>().IsDefaultDomainNameSet())
|
||||
{
|
||||
SuccessOrExit(error = Tlv::Append<MeshCoP::ThreadDomainNameTlv>(
|
||||
*message, Get<MeshCoP::NetworkNameManager>().GetDomainName().GetAsCString()));
|
||||
*message, Get<MeshCoP::NetworkIdentity>().GetDomainName().GetAsCString()));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user