Skip to content

Commit

Permalink
Address more review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple committed Aug 2, 2023
1 parent 6a5fe7b commit 58af776
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/darwin/Framework/CHIP/MTRConversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ inline NSDate * ChipEpochSecondsAsDate(uint32_t chipEpochSeconds)
/**
* Utilities for converting between NSSet<NSNumber *> and chip::CATValues.
*/
CHIP_ERROR ToCATValues(NSSet<NSNumber *> * catSet, chip::CATValues & values);
NSSet<NSNumber *> * FromCATValues(const chip::CATValues & values);
CHIP_ERROR SetToCATValues(NSSet<NSNumber *> * catSet, chip::CATValues & values);
NSSet<NSNumber *> * CATValuesToSet(const chip::CATValues & values);

NS_ASSUME_NONNULL_END
4 changes: 2 additions & 2 deletions src/darwin/Framework/CHIP/MTRConversion.mm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <lib/support/SafeInt.h>

CHIP_ERROR ToCATValues(NSSet<NSNumber *> * catSet, chip::CATValues & values)
CHIP_ERROR SetToCATValues(NSSet<NSNumber *> * catSet, chip::CATValues & values)
{
values = chip::kUndefinedCATs;

Expand Down Expand Up @@ -49,7 +49,7 @@ CHIP_ERROR ToCATValues(NSSet<NSNumber *> * catSet, chip::CATValues & values)
return CHIP_NO_ERROR;
}

NSSet<NSNumber *> * FromCATValues(const chip::CATValues & values)
NSSet<NSNumber *> * CATValuesToSet(const chip::CATValues & values)
{
auto * catSet = [[NSMutableSet alloc] initWithCapacity:values.GetNumTagsPresent()];
for (auto & value : values.values) {
Expand Down
4 changes: 2 additions & 2 deletions src/darwin/Framework/CHIP/MTRDeviceController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 58af776

Please sign in to comment.