Skip to content

Commit be49186

Browse files
committed
Updating ChipDeviceCtrl and TC_CADMIN_1_3_4 modules:
- Moved get_rcac() to a standalone function that can be called after commissioning is completed in ChipDeviceCtrl module - Updated TC_CADMIN_1_3_4 test module to using the new standalone function self.th.get_rcac()
1 parent b217ca3 commit be49186

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

src/controller/python/chip/ChipDeviceCtrl.py

+2-10
Original file line numberDiff line numberDiff line change
@@ -2224,7 +2224,7 @@ async def get_commissioning_rcac_data_async(self):
22242224

22252225
async def CommissionOnNetwork(self, nodeId: int, setupPinCode: int,
22262226
filterType: DiscoveryFilterType = DiscoveryFilterType.NONE, filter: typing.Any = None,
2227-
discoveryTimeoutMsec: int = 30000, get_rcac: bool = False) -> int:
2227+
discoveryTimeoutMsec: int = 30000) -> int:
22282228
'''
22292229
Does the routine for OnNetworkCommissioning, with a filter for mDNS discovery.
22302230
Supported filters are:
@@ -2259,15 +2259,7 @@ async def CommissionOnNetwork(self, nodeId: int, setupPinCode: int,
22592259
self.devCtrl, self.pairingDelegate, nodeId, setupPinCode, int(filterType), str(filter).encode("utf-8") if filter is not None else None, discoveryTimeoutMsec)
22602260
)
22612261

2262-
res = await asyncio.futures.wrap_future(ctx.future)
2263-
2264-
# If RCAC data is wanted, attempt to pull the result
2265-
if get_rcac:
2266-
rcac_bytes = self.get_rcac()
2267-
return (res, rcac_bytes)
2268-
2269-
else:
2270-
return res
2262+
return await asyncio.futures.wrap_future(ctx.future)
22712263

22722264
def get_rcac(self):
22732265
try:

src/python_testing/TC_CADMIN_1_3_4.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,10 @@ async def test_TC_CADMIN_1_3(self):
160160
th2_certificate_authority = self.certificate_authority_manager.NewCertificateAuthority()
161161
th2_fabric_admin = th2_certificate_authority.NewFabricAdmin(vendorId=0xFFF1, fabricId=self.th1.fabricId + 1)
162162
self.th2 = th2_fabric_admin.NewController(nodeId=2, useTestCommissioner=True)
163-
_, rcac = await self.th2.CommissionOnNetwork(
163+
await self.th2.CommissionOnNetwork(
164164
nodeId=self.dut_node_id, setupPinCode=params.setupPinCode,
165-
filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=1234, get_rcac=True)
165+
filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=1234)
166+
rcac = self.th2.get_rcac()
166167

167168
th2_rcac_decoded = TLVReader(rcac).get()["Any"][9]
168169

@@ -324,9 +325,10 @@ async def test_TC_CADMIN_1_4(self):
324325
th2_certificate_authority = self.certificate_authority_manager.NewCertificateAuthority()
325326
th2_fabric_admin = th2_certificate_authority.NewFabricAdmin(vendorId=0xFFF1, fabricId=self.th1.fabricId + 1)
326327
self.th2 = th2_fabric_admin.NewController(nodeId=2, useTestCommissioner=True)
327-
_, rcac = await self.th2.CommissionOnNetwork(
328+
await self.th2.CommissionOnNetwork(
328329
nodeId=self.dut_node_id, setupPinCode=setupPayloadInfo[0].passcode,
329-
filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=setupPayloadInfo[0].filter_value, get_rcac=True)
330+
filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=setupPayloadInfo[0].filter_value)
331+
rcac = self.th2.get_rcac()
330332

331333
th2_rcac_decoded = TLVReader(rcac).get()["Any"][9]
332334

0 commit comments

Comments
 (0)