[meshcop] add MeshLocalPrefixTlv::GetMeshLocalPrefixLength() (#3930)

This commit is contained in:
Jonathan Hui
2019-06-20 09:38:25 -07:00
committed by GitHub
parent 0a084bbb9a
commit d1ded876f9
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -150,7 +150,7 @@ otError DatasetManager::HandleSet(Coap::Message &aMessage, const Ip6::MessageInf
if (Tlv::GetTlv(aMessage, Tlv::kMeshLocalPrefix, sizeof(meshLocalPrefix), meshLocalPrefix) == OT_ERROR_NONE &&
meshLocalPrefix.IsValid() &&
memcmp(&meshLocalPrefix.GetMeshLocalPrefix(), &Get<Mle::MleRouter>().GetMeshLocalPrefix(),
meshLocalPrefix.GetLength()))
meshLocalPrefix.GetMeshLocalPrefixLength()))
{
doesAffectConnectivity = true;
}
+8
View File
@@ -606,6 +606,14 @@ public:
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(Tlv); }
/**
* This method returns the size (in bytes) of the Mesh Local Prefix field.
*
* @returns The size (in bytes) of the Mesh Local Prefix field (8 bytes).
*
*/
uint8_t GetMeshLocalPrefixLength(void) const { return sizeof(mMeshLocalPrefix); }
/**
* This method returns the Mesh Local Prefix value.
*