Skip to content

Commit

Permalink
Removed duplicate code in controller execution that sends Commissioni…
Browse files Browse the repository at this point in the history
…ngComplete (#10000)

* Removed controller side functions that artificially sends CommissioningComplete message to device

* Restyle changes
  • Loading branch information
mkardous-silabs authored and pull[bot] committed Oct 1, 2021
1 parent e54b7d2 commit 1177063
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 40 deletions.
14 changes: 0 additions & 14 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,20 +1119,6 @@ CHIP_ERROR DeviceCommissioner::OpenCommissioningWindow(NodeId deviceId, uint16_t
return CHIP_NO_ERROR;
}

CHIP_ERROR DeviceCommissioner::CommissioningComplete(NodeId remoteDeviceId)
{
if (!mIsIPRendezvous)
{
Device * device = nullptr;
ReturnErrorOnFailure(GetDevice(remoteDeviceId, &device));
ChipLogProgress(Controller, "Calling commissioning complete for device ID %" PRIu64, remoteDeviceId);
GeneralCommissioningCluster genCom;
genCom.Associate(device, 0);
return genCom.CommissioningComplete(NULL, NULL);
}
return CHIP_NO_ERROR;
}

void DeviceCommissioner::FreeRendezvousSession()
{
PersistNextKeyId();
Expand Down
11 changes: 0 additions & 11 deletions src/controller/CHIPDeviceController.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,17 +465,6 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController,
CHIP_ERROR OpenCommissioningWindow(NodeId deviceId, uint16_t timeout, uint16_t iteration, uint16_t discriminator,
uint8_t option);

/**
* This function call causes the DeviceCommissioner to send a
* CommissioningComplete command to the given node. At least when
* mIsIPRendezvous is false, which seems to be an incredibly broken
* workaround for
* <https://github.com/project-chip/connectedhomeip/issues/8010>. Chances
* are, this function and its callsites should just be removed when that
* issue is fixed.
*/
CHIP_ERROR CommissioningComplete(NodeId remoteDeviceId);

//////////// SessionEstablishmentDelegate Implementation ///////////////
void OnSessionEstablishmentError(CHIP_ERROR error) override;
void OnSessionEstablished() override;
Expand Down
8 changes: 0 additions & 8 deletions src/controller/python/ChipDeviceController-ScriptBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ ChipError::StorageType pychip_DeviceController_GetAddressAndPort(chip::Controlle
uint16_t * outPort);
ChipError::StorageType pychip_DeviceController_GetCompressedFabricId(chip::Controller::DeviceCommissioner * devCtrl,
uint64_t * outFabricId);
ChipError::StorageType pychip_DeviceController_CommissioningComplete(chip::Controller::DeviceCommissioner * devCtrl,
chip::NodeId nodeId);
ChipError::StorageType pychip_DeviceController_GetFabricId(chip::Controller::DeviceCommissioner * devCtrl, uint64_t * outFabricId);

// Rendezvous
Expand Down Expand Up @@ -261,12 +259,6 @@ ChipError::StorageType pychip_DeviceController_GetCompressedFabricId(chip::Contr
return CHIP_NO_ERROR.AsInteger();
}

ChipError::StorageType pychip_DeviceController_CommissioningComplete(chip::Controller::DeviceCommissioner * devCtrl,
chip::NodeId nodeId)
{
return devCtrl->CommissioningComplete(nodeId).AsInteger();
}

ChipError::StorageType pychip_DeviceController_GetFabricId(chip::Controller::DeviceCommissioner * devCtrl, uint64_t * outFabricId)
{
*outFabricId = devCtrl->GetFabricId();
Expand Down
1 change: 0 additions & 1 deletion src/controller/python/chip-device-ctrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,6 @@ def do_resolve(self, line):
address = "{}:{}".format(
*address) if address else "unknown"
print("Current address: " + address)
self.devCtrl.CommissioningComplete(int(args[1]))
else:
self.do_help("resolve")
except exceptions.ChipStackException as ex:
Expand Down
6 changes: 0 additions & 6 deletions src/controller/python/chip/ChipDeviceCtrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,6 @@ def GetAddressAndPort(self, nodeid):

return (address.value.decode(), port.value) if error == 0 else None

def CommissioningComplete(self, nodeid):
return self._ChipStack.Call(
lambda: self._dmLib.pychip_DeviceController_CommissioningComplete(
self.devCtrl, nodeid)
)

def DiscoverCommissionableNodesLongDiscriminator(self, long_discriminator):
return self._ChipStack.Call(
lambda: self._dmLib.pychip_DeviceController_DiscoverCommissionableNodesLongDiscriminator(
Expand Down

0 comments on commit 1177063

Please sign in to comment.