mirror of
https://github.com/espressif/openthread.git
synced 2026-08-03 17:37:46 +00:00
THCI: fix JOIN_ENT log (#1262)
This commit is contained in:
@@ -445,6 +445,9 @@ void Joiner::SendJoinerEntrustResponse(const Coap::Header &aRequestHeader,
|
||||
|
||||
otLogInfoArp("Sent Joiner Entrust response");
|
||||
|
||||
otLogInfoMeshCoP("Sent joiner entrust response length = %d", message->GetLength());
|
||||
otLogCertMeshCoP("[THCI] direction=send | type=JOIN_ENT.rsp");
|
||||
|
||||
exit:
|
||||
|
||||
if (error != kThreadError_None && message != NULL)
|
||||
|
||||
@@ -397,7 +397,8 @@ ThreadError JoinerRouter::SendJoinerEntrust(const Ip6::MessageInfo &aMessageInfo
|
||||
|
||||
messageInfo = aMessageInfo;
|
||||
messageInfo.SetPeerPort(kCoapUdpPort);
|
||||
SuccessOrExit(error = mNetif.GetCoapClient().SendMessage(*message, messageInfo));
|
||||
SuccessOrExit(error = mNetif.GetCoapClient().SendMessage(*message, messageInfo,
|
||||
&JoinerRouter::HandleJoinerEntrustResponse, this));
|
||||
|
||||
otLogInfoMeshCoP("Sent joiner entrust length = %d", message->GetLength());
|
||||
otLogCertMeshCoP("[THCI] direction=send | type=JOIN_ENT.ntf");
|
||||
@@ -413,5 +414,30 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
void JoinerRouter::HandleJoinerEntrustResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
|
||||
const otMessageInfo *aMessageInfo, ThreadError aResult)
|
||||
{
|
||||
static_cast<JoinerRouter *>(aContext)->HandleJoinerEntrustResponse(static_cast<Coap::Header *>(aHeader),
|
||||
static_cast<Message *>(aMessage),
|
||||
static_cast<const Ip6::MessageInfo *>(aMessageInfo),
|
||||
aResult);
|
||||
}
|
||||
|
||||
void JoinerRouter::HandleJoinerEntrustResponse(Coap::Header *aHeader, Message *aMessage,
|
||||
const Ip6::MessageInfo *aMessageInfo, ThreadError aResult)
|
||||
{
|
||||
(void)aMessageInfo;
|
||||
|
||||
VerifyOrExit(aResult == kThreadError_None && aHeader != NULL && aMessage != NULL, ;);
|
||||
|
||||
VerifyOrExit(aHeader->GetCode() == kCoapResponseChanged, ;);
|
||||
|
||||
otLogInfoMeshCoP("Receive joiner entrust response");
|
||||
otLogCertMeshCoP("[THCI] direction=recv | type=JOIN_ENT.rsp");
|
||||
|
||||
exit:
|
||||
return ;
|
||||
}
|
||||
|
||||
} // namespace Dtls
|
||||
} // namespace Thread
|
||||
|
||||
@@ -90,6 +90,10 @@ private:
|
||||
const otMessageInfo *aMessageInfo);
|
||||
void HandleRelayTransmit(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||
|
||||
static void HandleJoinerEntrustResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage,
|
||||
const otMessageInfo *aMessageInfo, ThreadError result);
|
||||
void HandleJoinerEntrustResponse(Coap::Header *aHeader, Message *aMessage,
|
||||
const Ip6::MessageInfo *aMessageInfo, ThreadError result);
|
||||
ThreadError SendJoinerEntrust(const Ip6::MessageInfo &aMessageInfo);
|
||||
|
||||
ThreadError GetBorderAgentRloc(uint16_t &aRloc);
|
||||
|
||||
@@ -2033,7 +2033,8 @@ class OpenThread(IThci):
|
||||
elif "type" in infoType:
|
||||
EncryptedPacket.Type = PlatformDiagnosticPacket_Type.JOIN_FIN_req if 'JOIN_FIN.req' in infoValue \
|
||||
else PlatformDiagnosticPacket_Type.JOIN_FIN_rsp if 'JOIN_FIN.rsp' in infoValue \
|
||||
else PlatformDiagnosticPacket_Type.JOIN_ENT_rsp if 'JOIN_ENT.ntf' in infoValue \
|
||||
else PlatformDiagnosticPacket_Type.JOIN_ENT_req if 'JOIN_ENT.ntf' in infoValue \
|
||||
else PlatformDiagnosticPacket_Type.JOIN_ENT_rsp if 'JOIN_ENT.rsp' in infoValue \
|
||||
else PlatformDiagnosticPacket_Type.UNKNOWN
|
||||
elif "len" in infoType:
|
||||
EncryptedPacket.TLVsLength = int(infoValue)
|
||||
|
||||
Reference in New Issue
Block a user