Fix networkname TLV and mesh local prefix TLV (#563)

This commit is contained in:
Lu Wang
2016-09-12 08:52:52 -07:00
committed by Jonathan Hui
parent 6a59efde56
commit 25755849d0
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -110,10 +110,10 @@ ThreadError Dataset::Print(otOperationalDataset &aDataset)
{
const uint8_t *prefix = aDataset.mMeshLocalPrefix.m8;
sServer->OutputFormat("Mesh Local Prefix: %x:%x:%x:%x/64\r\n",
(static_cast<uint16_t>(prefix[0]) << 16) | prefix[1],
(static_cast<uint16_t>(prefix[2]) << 16) | prefix[3],
(static_cast<uint16_t>(prefix[4]) << 16) | prefix[5],
(static_cast<uint16_t>(prefix[6]) << 16) | prefix[7]);
(static_cast<uint16_t>(prefix[0]) << 8) | prefix[1],
(static_cast<uint16_t>(prefix[2]) << 8) | prefix[3],
(static_cast<uint16_t>(prefix[4]) << 8) | prefix[5],
(static_cast<uint16_t>(prefix[6]) << 8) | prefix[7]);
}
if (aDataset.mIsMasterKeySet)
+2 -2
View File
@@ -156,8 +156,8 @@ void Dataset::Get(otOperationalDataset &aDataset)
case Tlv::kNetworkName:
{
const NetworkNameTlv *tlv = static_cast<const NetworkNameTlv *>(cur);
memcpy(aDataset.mMasterKey.m8, tlv->GetNetworkName(), tlv->GetLength());
aDataset.mIsMasterKeySet = true;
memcpy(aDataset.mNetworkName.m8, tlv->GetNetworkName(), tlv->GetLength());
aDataset.mIsNetworkNameSet = true;
break;
}