Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
erjiaqing committed Nov 9, 2020
1 parent 6ad517e commit 6c12ade
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/transport/SecurePairingSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,12 @@ CHIP_ERROR SecurePairingSession::AttachHeaderAndSend(uint8_t msgType, System::Pa
SuccessOrExit(err);
VerifyOrExit(headerSize == actualEncodedHeaderSize, err = CHIP_ERROR_INTERNAL);

err = mDelegate->SendPairingMessage(PacketHeader().SetSourceNodeId(mLocalNodeId).SetEncryptionKeyID(mLocalKeyId),
payloadHeader.GetEncodePacketFlags(), mPeerAddress, msgBuf);
msgBuf = nullptr;
SuccessOrExit(err);

exit:
if (msgBuf)
System::PacketBuffer::Free(msgBuf);
return err;
Expand Down
2 changes: 1 addition & 1 deletion src/transport/tests/TestSecurePairingSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TestSecurePairingDelegate : public SecurePairingSessionDelegate
const Transport::PeerAddress & peerAddress, System::PacketBuffer * msgBuf) override
{
mNumMessageSend++;
return (peer != nullptr) ? peer->HandlePeerMessage(header, msgBuf) : mMessageSendError;
return (peer != nullptr) ? peer->HandlePeerMessage(header, peerAddress, msgBuf) : mMessageSendError;
}

void OnPairingError(CHIP_ERROR error) override { mNumPairingErrors++; }
Expand Down

0 comments on commit 6c12ade

Please sign in to comment.