diff --git a/src/controller/python/chip-device-ctrl.py b/src/controller/python/chip-device-ctrl.py index 40725c2b4d8575..f85732a1628a29 100755 --- a/src/controller/python/chip-device-ctrl.py +++ b/src/controller/python/chip-device-ctrl.py @@ -426,12 +426,15 @@ def ConnectFromSetupPayload(self, setupPayload, nodeid): return 0 else: print("Unable to connect") + return 1 else: print("Unable to locate device on network") if int(setupPayload.attributes["RendezvousInformation"]) & ble: print("Attempting to connect via BLE") - if self.devCtrl.ConnectBLE(setupPayload.discriminator, setupPayload.setUpPINCode, nodeid): + longDiscriminator = ctypes.c_uint16(int(setupPayload.attributes['Discriminator'])) + pincode = ctypes.c_uint32(int(setupPayload.attributes['SetUpPINCode'])) + if self.devCtrl.ConnectBLE(longDiscriminator, pincode, nodeid): print("Connected") return 0 else: