Add payload dump for JOIN_FIN.rsp (#1470)

This commit is contained in:
rongli
2017-03-15 10:35:16 -07:00
committed by Jonathan Hui
parent 1de5e37d1c
commit 90bab8312b
2 changed files with 15 additions and 2 deletions
+9 -1
View File
@@ -912,6 +912,14 @@ void Commissioner::SendJoinFinalizeResponse(const Coap::Header &aRequestHeader,
joinerMessageInfo.SetPeerPort(mJoinerPort);
mSendKek = true;
#if OPENTHREAD_ENABLE_CERT_LOG
uint8_t buf[OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE];
VerifyOrExit(message->GetLength() <= sizeof(buf), ;);
message->Read(responseHeader.GetLength(), message->GetLength() - responseHeader.GetLength(), buf);
otDumpCertMeshCoP("[THCI] direction=send | type=JOIN_FIN.rsp |", buf,
message->GetLength() - responseHeader.GetLength());
#endif
SuccessOrExit(error = mNetif.GetSecureCoapServer().SendMessage(*message, joinerMessageInfo));
memcpy(extAddr.m8, mJoinerIid, sizeof(extAddr.m8));
@@ -919,7 +927,7 @@ void Commissioner::SendJoinFinalizeResponse(const Coap::Header &aRequestHeader,
RemoveJoiner(&extAddr);
otLogInfoMeshCoP(GetInstance(), "sent joiner finalize response");
otLogCertMeshCoP(GetInstance(), "[THCI] direction=send | type=JOIN_FIN.rsp");
exit:
if (error != kThreadError_None && message != NULL)
+6 -1
View File
@@ -361,7 +361,12 @@ void Joiner::HandleJoinerFinalizeResponse(Coap::Header *aHeader, Message *aMessa
mTimer.Start(kTimeout);
otLogInfoMeshCoP(GetInstance(), "received joiner finalize response %d", static_cast<uint8_t>(state.GetState()));
otLogCertMeshCoP(GetInstance(), "[THCI] direction=recv | type=JOIN_FIN.rsp");
#if OPENTHREAD_ENABLE_CERT_LOG
uint8_t buf[OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE];
VerifyOrExit(aMessage->GetLength() <= sizeof(buf), ;);
aMessage->Read(aHeader->GetLength(), aMessage->GetLength() - aHeader->GetLength(), buf);
otDumpCertMeshCoP("[THCI] direction=recv | type=JOIN_FIN.rsp |", buf, aMessage->GetLength() - aHeader->GetLength());
#endif
exit:
Close();