From 58af776a16a222aa615b5463b2fcc0004a54c717 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 1 Aug 2023 20:23:54 -0400 Subject: [PATCH] Address more review comments. --- src/darwin/Framework/CHIP/MTRConversion.h | 4 ++-- src/darwin/Framework/CHIP/MTRConversion.mm | 4 ++-- src/darwin/Framework/CHIP/MTRDeviceController.mm | 4 ++-- src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm | 2 +- .../Framework/CHIP/MTROperationalCredentialsDelegate.mm | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRConversion.h b/src/darwin/Framework/CHIP/MTRConversion.h index b49ab4579edbaa..5932ff88bf597b 100644 --- a/src/darwin/Framework/CHIP/MTRConversion.h +++ b/src/darwin/Framework/CHIP/MTRConversion.h @@ -43,7 +43,7 @@ inline NSDate * ChipEpochSecondsAsDate(uint32_t chipEpochSeconds) /** * Utilities for converting between NSSet and chip::CATValues. */ -CHIP_ERROR ToCATValues(NSSet * catSet, chip::CATValues & values); -NSSet * FromCATValues(const chip::CATValues & values); +CHIP_ERROR SetToCATValues(NSSet * catSet, chip::CATValues & values); +NSSet * CATValuesToSet(const chip::CATValues & values); NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRConversion.mm b/src/darwin/Framework/CHIP/MTRConversion.mm index 3e69e5bfe457af..77882742dea3e7 100644 --- a/src/darwin/Framework/CHIP/MTRConversion.mm +++ b/src/darwin/Framework/CHIP/MTRConversion.mm @@ -19,7 +19,7 @@ #include -CHIP_ERROR ToCATValues(NSSet * catSet, chip::CATValues & values) +CHIP_ERROR SetToCATValues(NSSet * catSet, chip::CATValues & values) { values = chip::kUndefinedCATs; @@ -49,7 +49,7 @@ CHIP_ERROR ToCATValues(NSSet * catSet, chip::CATValues & values) return CHIP_NO_ERROR; } -NSSet * FromCATValues(const chip::CATValues & values) +NSSet * CATValuesToSet(const chip::CATValues & values) { auto * catSet = [[NSMutableSet alloc] initWithCapacity:values.GetNumTagsPresent()]; for (auto & value : values.values) { diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index b4cce4b87567a7..cf4ab4c068d465 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -313,9 +313,9 @@ - (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams chip::CATValues cats = chip::kUndefinedCATs; if (startupParams.caseAuthenticatedTags != nil) { - errorCode = ToCATValues(startupParams.caseAuthenticatedTags, cats); + errorCode = SetToCATValues(startupParams.caseAuthenticatedTags, cats); if (errorCode != CHIP_NO_ERROR) { - // ToCATValues already handles logging. + // SetToCATValues already handles logging. return; } } diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm index 713dc72f0cd8a2..ca92c63bf2171b 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm @@ -303,7 +303,7 @@ - (instancetype)initForExistingFabric:(FabricTable *)fabricTable auto tagCount = cats.GetNumTagsPresent(); if (tagCount > 0) { - self.caseAuthenticatedTags = FromCATValues(cats); + self.caseAuthenticatedTags = CATValuesToSet(cats); } else { self.caseAuthenticatedTags = nil; } diff --git a/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.mm b/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.mm index ef7bafe6223b61..159e772838258c 100644 --- a/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.mm +++ b/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.mm @@ -470,7 +470,7 @@ uint64_t GetIssuerId(NSNumber * _Nullable providedIssuerId) CATValues cats; if (caseAuthenticatedTags != nil) { - ReturnErrorOnFailure(ToCATValues(caseAuthenticatedTags, cats)); + ReturnErrorOnFailure(SetToCATValues(caseAuthenticatedTags, cats)); } uint8_t nocBuffer[Controller::kMaxCHIPDERCertLength];