From f8d5990bf8fc420d87fbdc0e092be4a7f961867b Mon Sep 17 00:00:00 2001 From: cecille Date: Wed, 12 May 2021 21:26:33 -0400 Subject: [PATCH] Fix python controller BLE connection (#6744) Code was previously changed to use a different version of the setup payload parser, but this path was missed. --- src/controller/python/chip-device-ctrl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: