Skip to content

Commit

Permalink
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -98,6 +98,7 @@ class DeviceProvisioningFragment : Fragment() {

showMessage(R.string.rendezvous_over_ble_pairing_text)
deviceController.setCompletionListener(ConnectionCallback())
deviceController.disconnectDevice();
deviceController.beginConnectDeviceBle(gatt, deviceInfo.setupPinCode);
}
}
8 changes: 2 additions & 6 deletions src/controller/CHIPDeviceController_deprecated.cpp
Original file line number Diff line number Diff line change
@@ -176,8 +176,7 @@ bool ChipDeviceController::GetIpAddress(Inet::IPAddress & addr)
if (!IsConnected())
return false;

if (mDevice == nullptr)
InitDevice();
InitDevice();

return mDevice != nullptr && mDevice->GetIpAddress(addr);
}
@@ -206,10 +205,7 @@ CHIP_ERROR ChipDeviceController::SendMessage(void * appReqState, PacketBufferHan
}
VerifyOrExit(mRemoteDeviceId != kUndefinedNodeId, err = CHIP_ERROR_INCORRECT_STATE);

if (mDevice == nullptr)
{
SuccessOrExit(InitDevice());
}
SuccessOrExit(InitDevice());

VerifyOrExit(mDevice != nullptr, err = CHIP_ERROR_INVALID_ARGUMENT);
mDevice->SetDelegate(this);

0 comments on commit 1e136a1

Please sign in to comment.