mirror of
https://github.com/espressif/openthread.git
synced 2026-09-18 23:20:08 +00:00
Set joiner to be on the same channel with joiner router (#566)
This commit is contained in:
@@ -87,6 +87,7 @@ void Joiner::HandleDiscoverResult(otActiveScanResult *aResult)
|
||||
{
|
||||
if (aResult != NULL)
|
||||
{
|
||||
mJoinerRouterChannel = aResult->mChannel;
|
||||
memcpy(&mJoinerRouter, &aResult->mExtAddress, sizeof(mJoinerRouter));
|
||||
}
|
||||
else
|
||||
@@ -97,6 +98,7 @@ void Joiner::HandleDiscoverResult(otActiveScanResult *aResult)
|
||||
mSocket.Open(&HandleUdpReceive, this);
|
||||
mSocket.Bind(sockaddr);
|
||||
|
||||
mNetif.GetMac().SetChannel(mJoinerRouterChannel);
|
||||
mNetif.GetIp6Filter().AddUnsecurePort(sockaddr.mPort);
|
||||
|
||||
mNetif.GetDtls().Start(true, HandleDtlsReceive, HandleDtlsSend, this);
|
||||
|
||||
@@ -102,6 +102,7 @@ private:
|
||||
void ReceiveJoinerFinalizeResponse(uint8_t *buf, uint16_t length);
|
||||
void SendJoinerFinalize(void);
|
||||
|
||||
uint8_t mJoinerRouterChannel;
|
||||
Mac::ExtAddress mJoinerRouter;
|
||||
Message *mTransmitMessage;
|
||||
Ip6::UdpSocket mSocket;
|
||||
|
||||
Reference in New Issue
Block a user