Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing invalid type: MTROnboardingPayloadTypeAdmin #22028

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/darwin/Framework/CHIP/MTROnboardingPayloadParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, MTROnboardingPayloadType) {
MTROnboardingPayloadTypeQRCode = 0,
MTROnboardingPayloadTypeManualCode,
MTROnboardingPayloadTypeNFC,
MTROnboardingPayloadTypeAdmin,
MTROnboardingPayloadTypeNFC
};

@interface MTROnboardingPayloadParser : NSObject
Expand Down
1 change: 0 additions & 1 deletion src/darwin/Framework/CHIP/MTROnboardingPayloadParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ + (nullable MTRSetupPayload *)setupPayloadForOnboardingPayload:(NSString *)onboa
MTRSetupPayload * payload;
switch (type) {
case MTROnboardingPayloadTypeManualCode:
case MTROnboardingPayloadTypeAdmin:
payload = [self setupPayloadForManualCodeOnboardingPayload:onboardingPayload error:error];
break;
case MTROnboardingPayloadTypeQRCode:
Expand Down
31 changes: 0 additions & 31 deletions src/darwin/Framework/CHIPTests/MTRSetupPayloadParserTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,6 @@ - (void)testOnboardingPayloadParser_Manual_WrongType
XCTAssertEqual(error.code, MTRErrorCodeInvalidArgument);
}

- (void)testOnboardingPayloadParser_Admin_NoError
{
NSError * error;
MTRSetupPayload * payload = [MTROnboardingPayloadParser setupPayloadForOnboardingPayload:@"636108753500001000015"
ofType:MTROnboardingPayloadTypeAdmin
error:&error];

XCTAssertNotNil(payload);
XCTAssertNil(error);

XCTAssertTrue(payload.hasShortDiscriminator);
XCTAssertEqual(payload.discriminator.unsignedIntegerValue, 10);
XCTAssertEqual(payload.setUpPINCode.unsignedIntegerValue, 123456780);
XCTAssertEqual(payload.vendorID.unsignedIntegerValue, 1);
XCTAssertEqual(payload.productID.unsignedIntegerValue, 1);
XCTAssertEqual(payload.commissioningFlow, MTRCommissioningFlowCustom);
XCTAssertEqual(payload.version.unsignedIntegerValue, 0);
XCTAssertNil(payload.rendezvousInformation);
}

- (void)testOnboardingPayloadParser_Admin_WrongType
{
NSError * error;
Expand Down Expand Up @@ -118,17 +98,6 @@ - (void)testOnboardingPayloadParser_QRCode_NoError
XCTAssertEqual([payload.rendezvousInformation unsignedLongValue], MTRDiscoveryCapabilitiesSoftAP);
}

- (void)testOnboardingPayloadParser_QRCode_WrongType
{
NSError * error;
MTRSetupPayload * payload = [MTROnboardingPayloadParser setupPayloadForOnboardingPayload:@"MT:R5L90MP500K64J00000"
ofType:MTROnboardingPayloadTypeAdmin
error:&error];

XCTAssertNil(payload);
XCTAssertEqual(error.code, MTRErrorCodeIntegrityCheckFailed);
}

- (void)testOnboardingPayloadParser_NFC_NoError
{
NSError * error;
Expand Down