Skip to content

Commit

Permalink
Fix Rendezvous over BLE after recent changes
Browse files Browse the repository at this point in the history
PR project-chip#3704 introduced a change that the BLE transport in
RendezvousSession is only initialized when PeerAddress
in RendezvousParams is of type BLE. However, PeerAddress
isn't initialized anywhere. As a result Rendezvous over BLE
stopped working between Android CHIPTool and accessories.

Btw, remove an assert related to the storage delegate
as it seems an optional member of the device controller.
  • Loading branch information
Damian-Nordic committed Nov 27, 2020
1 parent 7c17319 commit 0f0f390
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion examples/common/chip-app-server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ void InitServer()
SuccessOrExit(err = DeviceLayer::ConfigurationMgr().GetSetupPinCode(pinCode));
params.SetSetupPINCode(pinCode)
.SetLocalNodeId(chip::kTestDeviceNodeId)
.SetBleLayer(DeviceLayer::ConnectivityMgr().GetBleLayer());
.SetBleLayer(DeviceLayer::ConnectivityMgr().GetBleLayer())
.SetPeerAddress(Transport::PeerAddress::BLE());
SuccessOrExit(err = gRendezvousServer.Init(params, &gTransports));
}
#endif
Expand Down
1 change: 0 additions & 1 deletion src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ CHIP_ERROR DeviceCommissioner::PairDevice(NodeId remoteDeviceId, RendezvousParam

VerifyOrExit(mState == State::Initialized, err = CHIP_ERROR_INCORRECT_STATE);
VerifyOrExit(mDeviceBeingPaired == kNumMaxActiveDevices, err = CHIP_ERROR_INCORRECT_STATE);
VerifyOrExit(mStorageDelegate != nullptr, err = CHIP_ERROR_INCORRECT_STATE);

#if CONFIG_DEVICE_LAYER && CONFIG_NETWORK_LAYER_BLE
if (!params.HasBleLayer())
Expand Down
3 changes: 2 additions & 1 deletion src/controller/java/CHIPDeviceController-JNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ JNI_METHOD(void, beginConnectDevice)(JNIEnv * env, jobject self, jlong handle, j
RendezvousParameters params = RendezvousParameters()
.SetSetupPINCode(pinCode)
.SetConnectionObject(reinterpret_cast<BLE_CONNECTION_OBJECT>(connObj))
.SetBleLayer(&sBleLayer);
.SetBleLayer(&sBleLayer)
.SetPeerAddress(Transport::PeerAddress::BLE());
err = wrapper->Controller()->ConnectDevice(kRemoteDeviceId, params, (void *) "ConnectDevice", HandleKeyExchange,
HandleEchoResponse, HandleError);
}
Expand Down

0 comments on commit 0f0f390

Please sign in to comment.