Skip to content

Commit 0ed7d51

Browse files
committedJun 18, 2024
Fixing style issues
1 parent 9c65744 commit 0ed7d51

11 files changed

+193
-172
lines changed
 

‎examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCastingPlayer.mm

+10-10
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,16 @@ - (NSError *)verifyOrEstablishConnectionWithCallbacks:(MCConnectionCallbacks * _
8181
}
8282

8383
void (^connectCallback)(CHIP_ERROR, matter::casting::core::CastingPlayer *) = ^(CHIP_ERROR err, matter::casting::core::CastingPlayer * castingPlayer) {
84-
ChipLogProgress(AppServer, "MCCastingPlayer.verifyOrEstablishConnectionWithCallbacks() connectCallback() called");
85-
dispatch_queue_t clientQueue = [[MCCastingApp getSharedInstance] getClientQueue];
86-
dispatch_async(clientQueue, ^{
87-
if (connectionCallbacks.connectionCompleteCallback) {
88-
connectionCallbacks.connectionCompleteCallback(err == CHIP_NO_ERROR ? nil : [MCErrorUtils NSErrorFromChipError:err]);
89-
} else {
90-
ChipLogError(AppServer, "MCCastingPlayer.verifyOrEstablishConnectionWithCallbacks() connectCallback(), client failed to set the connectionCompleteCallback() callback");
91-
}
92-
});
93-
};
84+
ChipLogProgress(AppServer, "MCCastingPlayer.verifyOrEstablishConnectionWithCallbacks() connectCallback() called");
85+
dispatch_queue_t clientQueue = [[MCCastingApp getSharedInstance] getClientQueue];
86+
dispatch_async(clientQueue, ^{
87+
if (connectionCallbacks.connectionCompleteCallback) {
88+
connectionCallbacks.connectionCompleteCallback(err == CHIP_NO_ERROR ? nil : [MCErrorUtils NSErrorFromChipError:err]);
89+
} else {
90+
ChipLogError(AppServer, "MCCastingPlayer.verifyOrEstablishConnectionWithCallbacks() connectCallback(), client failed to set the connectionCompleteCallback() callback");
91+
}
92+
});
93+
};
9494
void (^commissionerDeclarationCallback)(const chip::Transport::PeerAddress & source, const chip::Protocols::UserDirectedCommissioning::CommissionerDeclaration cppCommissionerDeclaration) = ^(const chip::Transport::PeerAddress & source, const chip::Protocols::UserDirectedCommissioning::CommissionerDeclaration cppCommissionerDeclaration) {
9595
ChipLogProgress(AppServer, "MCCastingPlayer.verifyOrEstablishConnectionWithCallbacks() commissionerDeclarationCallback() called with cpp CommissionerDeclaration");
9696
dispatch_queue_t clientQueue = [[MCCastingApp getSharedInstance] getClientQueue];

‎examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommissionerDeclaration.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ typedef NS_ENUM(NSInteger, CdError) {
4949
};
5050

5151
- (instancetype)initWithOptions:(NSInteger)errorCode
52-
needsPasscode:(BOOL)needsPasscode
53-
noAppsFound:(BOOL)noAppsFound
54-
passcodeDialogDisplayed:(BOOL)passcodeDialogDisplayed
55-
commissionerPasscode:(BOOL)commissionerPasscode
56-
qRCodeDisplayed:(BOOL)qRCodeDisplayed;
52+
needsPasscode:(BOOL)needsPasscode
53+
noAppsFound:(BOOL)noAppsFound
54+
passcodeDialogDisplayed:(BOOL)passcodeDialogDisplayed
55+
commissionerPasscode:(BOOL)commissionerPasscode
56+
qRCodeDisplayed:(BOOL)qRCodeDisplayed;
5757

5858
- (CdError)getErrorCode;
5959
- (BOOL)getNeedsPasscode;

‎examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommissionerDeclaration.mm

+92-82
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,31 @@ @interface MCCommissionerDeclaration ()
2222

2323
/** Feature: All - Indicates errors incurred during commissioning. */
2424
@property (nonatomic) CdError errorCode;
25-
/**
26-
* Feature: Coordinate PIN Dialogs - When NoPasscode field set to true, and the Commissioner
27-
* determines that a Passcode code will be needed for commissioning.
28-
*/
25+
/**
26+
* Feature: Coordinate PIN Dialogs - When NoPasscode field set to true, and the Commissioner
27+
* determines that a Passcode code will be needed for commissioning.
28+
*/
2929
@property (nonatomic) BOOL needsPasscode;
30-
/**
31-
* Feature: Target Content Application - No apps with AccountLogin cluster implementation were
32-
* found for the last IdentificationDeclaration request. Only apps which provide access to the
33-
* vendor id of the Commissionee will be considered.
34-
*/
30+
/**
31+
* Feature: Target Content Application - No apps with AccountLogin cluster implementation were
32+
* found for the last IdentificationDeclaration request. Only apps which provide access to the
33+
* vendor id of the Commissionee will be considered.
34+
*/
3535
@property (nonatomic) BOOL noAppsFound;
36-
/**
37-
* Feature: Coordinate PIN Dialogs - A Passcode input dialog is now displayed for the user on the
38-
* Commissioner.
39-
*/
36+
/**
37+
* Feature: Coordinate PIN Dialogs - A Passcode input dialog is now displayed for the user on the
38+
* Commissioner.
39+
*/
4040
@property (nonatomic) BOOL passcodeDialogDisplayed;
41-
/**
42-
* Feature: Commissioner-Generated Passcode - A Passcode is now displayed for the user by the
43-
* CastingPlayer/Commissioner.
44-
*/
41+
/**
42+
* Feature: Commissioner-Generated Passcode - A Passcode is now displayed for the user by the
43+
* CastingPlayer/Commissioner.
44+
*/
4545
@property (nonatomic) BOOL commissionerPasscode;
46-
/**
47-
* Feature: Commissioner-Generated Passcode - The user experience conveying a Passcode to the user
48-
* also displays a QR code.
49-
*/
46+
/**
47+
* Feature: Commissioner-Generated Passcode - The user experience conveying a Passcode to the user
48+
* also displays a QR code.
49+
*/
5050
@property (nonatomic) BOOL qRCodeDisplayed;
5151

5252
@property (nonatomic, readwrite) matter::casting::memory::Strong<chip::Protocols::UserDirectedCommissioning::CommissionerDeclaration> cppCommissionerDeclaration;
@@ -70,14 +70,15 @@ - (instancetype _Nonnull)initWithCppCommissionerDeclaration:(std::shared_ptr<chi
7070
}
7171

7272
- (instancetype)initWithOptions:(NSInteger)errorCode
73-
needsPasscode:(BOOL)needsPasscode
74-
noAppsFound:(BOOL)noAppsFound
75-
passcodeDialogDisplayed:(BOOL)passcodeDialogDisplayed
76-
commissionerPasscode:(BOOL)commissionerPasscode
77-
qRCodeDisplayed:(BOOL)qRCodeDisplayed {
73+
needsPasscode:(BOOL)needsPasscode
74+
noAppsFound:(BOOL)noAppsFound
75+
passcodeDialogDisplayed:(BOOL)passcodeDialogDisplayed
76+
commissionerPasscode:(BOOL)commissionerPasscode
77+
qRCodeDisplayed:(BOOL)qRCodeDisplayed
78+
{
7879
self = [super init];
7980
if (self) {
80-
_errorCode = (CdError)errorCode;
81+
_errorCode = (CdError) errorCode;
8182
_needsPasscode = needsPasscode;
8283
_noAppsFound = noAppsFound;
8384
_passcodeDialogDisplayed = passcodeDialogDisplayed;
@@ -87,86 +88,95 @@ - (instancetype)initWithOptions:(NSInteger)errorCode
8788
return self;
8889
}
8990

90-
- (CdError)getErrorCode {
91+
- (CdError)getErrorCode
92+
{
9193
return _errorCode;
9294
}
9395

94-
- (BOOL)getNeedsPasscode {
96+
- (BOOL)getNeedsPasscode
97+
{
9598
return _needsPasscode;
9699
}
97100

98-
- (BOOL)getNoAppsFound {
101+
- (BOOL)getNoAppsFound
102+
{
99103
return _noAppsFound;
100104
}
101105

102-
- (BOOL)getPasscodeDialogDisplayed {
106+
- (BOOL)getPasscodeDialogDisplayed
107+
{
103108
return _passcodeDialogDisplayed;
104109
}
105110

106-
- (BOOL)getCommissionerPasscode {
111+
- (BOOL)getCommissionerPasscode
112+
{
107113
return _commissionerPasscode;
108114
}
109115

110-
- (BOOL)getQRCodeDisplayed {
116+
- (BOOL)getQRCodeDisplayed
117+
{
111118
return _qRCodeDisplayed;
112119
}
113120

114-
- (NSString *)description {
121+
- (NSString *)description
122+
{
115123
return [NSString stringWithFormat:@"MCCommissionerDeclaration::errorCode: %@\nMCCommissionerDeclaration::needsPasscode: %d\nMCCommissionerDeclaration::noAppsFound: %d\nMCCommissionerDeclaration::passcodeDialogDisplayed: %d\nMCCommissionerDeclaration::commissionerPasscode: %d\nMCCommissionerDeclaration::qRCodeDisplayed: %d",
116-
[self stringForErrorCode:self.errorCode],
117-
self.needsPasscode,
118-
self.noAppsFound,
119-
self.passcodeDialogDisplayed,
120-
self.commissionerPasscode,
121-
self.qRCodeDisplayed];
124+
[self stringForErrorCode:self.errorCode],
125+
self.needsPasscode,
126+
self.noAppsFound,
127+
self.passcodeDialogDisplayed,
128+
self.commissionerPasscode,
129+
self.qRCodeDisplayed];
122130
}
123131

124-
- (NSString *)stringForErrorCode:(CdError)errorCode {
132+
- (NSString *)stringForErrorCode:(CdError)errorCode
133+
{
125134
switch (errorCode) {
126-
case kNoError:
127-
return @"kNoError";
128-
case kCommissionableDiscoveryFailed:
129-
return @"kCommissionableDiscoveryFailed";
130-
case kPaseConnectionFailed:
131-
return @"kPaseConnectionFailed";
132-
case kPaseAuthFailed:
133-
return @"kPaseAuthFailed";
134-
case kDacValidationFailed:
135-
return @"kDacValidationFailed";
136-
case kAlreadyOnFabric:
137-
return @"kAlreadyOnFabric";
138-
case kOperationalDiscoveryFailed:
139-
return @"kOperationalDiscoveryFailed";
140-
case kCaseConnectionFailed:
141-
return @"kCaseConnectionFailed";
142-
case kCaseAuthFailed:
143-
return @"kCaseAuthFailed";
144-
case kConfigurationFailed:
145-
return @"kConfigurationFailed";
146-
case kBindingConfigurationFailed:
147-
return @"kBindingConfigurationFailed";
148-
case kCommissionerPasscodeNotSupported:
149-
return @"kCommissionerPasscodeNotSupported";
150-
case kInvalidIdentificationDeclarationParams:
151-
return @"kInvalidIdentificationDeclarationParams";
152-
case kAppInstallConsentPending:
153-
return @"kAppInstallConsentPending";
154-
case kAppInstalling:
155-
return @"kAppInstalling";
156-
case kAppInstallFailed:
157-
return @"kAppInstallFailed";
158-
case kAppInstalledRetryNeeded:
159-
return @"kAppInstalledRetryNeeded";
160-
case kCommissionerPasscodeDisabled:
161-
return @"kCommissionerPasscodeDisabled";
162-
case kUnexpectedCommissionerPasscodeReady:
163-
return @"kUnexpectedCommissionerPasscodeReady";
164-
default:
165-
return @"Unknown Error";
135+
case kNoError:
136+
return @"kNoError";
137+
case kCommissionableDiscoveryFailed:
138+
return @"kCommissionableDiscoveryFailed";
139+
case kPaseConnectionFailed:
140+
return @"kPaseConnectionFailed";
141+
case kPaseAuthFailed:
142+
return @"kPaseAuthFailed";
143+
case kDacValidationFailed:
144+
return @"kDacValidationFailed";
145+
case kAlreadyOnFabric:
146+
return @"kAlreadyOnFabric";
147+
case kOperationalDiscoveryFailed:
148+
return @"kOperationalDiscoveryFailed";
149+
case kCaseConnectionFailed:
150+
return @"kCaseConnectionFailed";
151+
case kCaseAuthFailed:
152+
return @"kCaseAuthFailed";
153+
case kConfigurationFailed:
154+
return @"kConfigurationFailed";
155+
case kBindingConfigurationFailed:
156+
return @"kBindingConfigurationFailed";
157+
case kCommissionerPasscodeNotSupported:
158+
return @"kCommissionerPasscodeNotSupported";
159+
case kInvalidIdentificationDeclarationParams:
160+
return @"kInvalidIdentificationDeclarationParams";
161+
case kAppInstallConsentPending:
162+
return @"kAppInstallConsentPending";
163+
case kAppInstalling:
164+
return @"kAppInstalling";
165+
case kAppInstallFailed:
166+
return @"kAppInstallFailed";
167+
case kAppInstalledRetryNeeded:
168+
return @"kAppInstalledRetryNeeded";
169+
case kCommissionerPasscodeDisabled:
170+
return @"kCommissionerPasscodeDisabled";
171+
case kUnexpectedCommissionerPasscodeReady:
172+
return @"kUnexpectedCommissionerPasscodeReady";
173+
default:
174+
return @"Unknown Error";
166175
}
167176
}
168177

169-
- (void)logDetail {
178+
- (void)logDetail
179+
{
170180
ChipLogDetail(AppServer, "MCCommissionerDeclaration::logDetail()\n%@", [self description]);
171181
}
172182

‎examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommissionerDeclaration_Internal.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
#import <Foundation/Foundation.h>
2222

23-
#ifndef MCCommissionerDeclaration_Internal_h
24-
#define MCCommissionerDeclaration_Internal_h
23+
#ifndef MCCommissionerDeclaration_Internal_h
24+
#define MCCommissionerDeclaration_Internal_h
2525

2626
@interface MCCommissionerDeclaration ()
2727

‎examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCConnectionCallbacks.h

+12-15
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,28 @@
2525
/** @brief A container class for User Directed Commissioning (UDC) callbacks. */
2626
@interface MCConnectionCallbacks : NSObject
2727

28-
2928
/**
30-
* @param connectionCompleteCallback is required.
31-
* @param commissionerDeclarationCallback is optional.
32-
*
33-
* @return A new instance of MCConnectionCallbacks.
29+
* @param connectionCompleteCallback is required.
30+
* @param commissionerDeclarationCallback is optional.
31+
*
32+
* @return A new instance of MCConnectionCallbacks.
3433
*/
3534
- (instancetype _Nonnull)initWithCallbacks:(void (^_Nonnull)(NSError * _Nonnull))connectionCompleteCallback
3635
commissionerDeclarationCallback:(void (^_Nullable)(MCCommissionerDeclaration * _Nonnull))commissionerDeclarationCallback;
3736

3837
/**
39-
* (Required) The callback called when the connection process has ended, regardless of whether it was successful or not.
40-
*/
38+
* (Required) The callback called when the connection process has ended, regardless of whether it was successful or not.
39+
*/
4140
@property void (^_Nullable connectionCompleteCallback)(NSError * _Nonnull);
4241

43-
44-
/**
45-
* (Optional) The callback called when the Client/Commissionee receives a CommissionerDeclaration
46-
* message from the CastingPlayer/Commissioner. This callback is needed to support UDC features
47-
* where a reply from the Commissioner is expected. It provides information indicating the
48-
* Commissioner’s pre-commissioning state.
49-
*/
42+
/**
43+
* (Optional) The callback called when the Client/Commissionee receives a CommissionerDeclaration
44+
* message from the CastingPlayer/Commissioner. This callback is needed to support UDC features
45+
* where a reply from the Commissioner is expected. It provides information indicating the
46+
* Commissioner’s pre-commissioning state.
47+
*/
5048
@property void (^_Nullable commissionerDeclarationCallback)(MCCommissionerDeclaration * _Nonnull);
5149

52-
5350
@end
5451

5552
#endif /* MCConnectionCallbacks_h */

‎examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCConnectionCallbacks.mm

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
@implementation MCConnectionCallbacks
2121

2222
- (instancetype _Nonnull)initWithCallbacks:(void (^_Nonnull)(NSError * _Nonnull))connectionCompleteCallback
23-
commissionerDeclarationCallback:(void (^_Nullable)(MCCommissionerDeclaration * _Nonnull))commissionerDeclarationCallback {
23+
commissionerDeclarationCallback:(void (^_Nullable)(MCCommissionerDeclaration * _Nonnull))commissionerDeclarationCallback
24+
{
2425
self = [super init];
2526
if (self) {
2627
self.connectionCompleteCallback = connectionCompleteCallback;

‎examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCIdentificationDeclarationOptions.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
#import <Foundation/Foundation.h>
1817
#import "MCTargetAppInfo.h"
18+
#import <Foundation/Foundation.h>
1919

2020
#ifndef MCIdentificationDeclarationOptions_h
2121
#define MCIdentificationDeclarationOptions_h
@@ -38,10 +38,10 @@
3838
- (BOOL)getCommissionerPasscodeReady;
3939
- (BOOL)getCancelPasscode;
4040

41-
/**
42-
* @brief Adds a TargetAppInfo to the IdentificationDeclarationOptions.java TargetAppInfos list,
43-
* up to a maximum of CHIP_DEVICE_CONFIG_UDC_MAX_TARGET_APPS.
44-
*/
41+
/**
42+
* @brief Adds a TargetAppInfo to the IdentificationDeclarationOptions.java TargetAppInfos list,
43+
* up to a maximum of CHIP_DEVICE_CONFIG_UDC_MAX_TARGET_APPS.
44+
*/
4545
- (BOOL)addTargetAppInfo:(MCTargetAppInfo *)targetAppInfo NS_SWIFT_NAME(addTargetAppInfo(_:));
4646
- (NSArray<MCTargetAppInfo *> *)getTargetAppInfoList;
4747

0 commit comments

Comments
 (0)