Skip to content

Commit c7d38fb

Browse files
Addressed comments by sharadb-amazon2
1 parent 556f039 commit c7d38fb

File tree

3 files changed

+13
-20
lines changed

3 files changed

+13
-20
lines changed

examples/tv-casting-app/APIs.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ client's lifecycle:
249249
return commissionableData;
250250
}
251251

252-
// If using the alternate CastingPlayer / Commissioner-Generated Passcode UDC feature commissioning flow:
252+
// If using the alternate CastingPlayer / Commissioner-Generated Passcode UDC feature:
253253
public void updateCommissionableDataSetupPasscode(long setupPasscode, int discriminator) {
254254
commissionableData.setSetupPasscode(setupPasscode);
255255
commissionableData.setDiscriminator(discriminator);
@@ -281,7 +281,7 @@ client's lifecycle:
281281
return commissionableData
282282
}
283283

284-
// If using the alternate CastingPlayer / Commissioner-Generated Passcode UDC feature commissioning flow:
284+
// If using the alternate CastingPlayer / Commissioner-Generated Passcode UDC feature:
285285
func update(_ newCommissionableData: MCCommissionableData) {
286286
self.commissionableData = newCommissionableData
287287
}
@@ -842,7 +842,7 @@ void ConnectionHandler(CHIP_ERROR err, matter::casting::core::CastingPlayer * ca
842842
}
843843
}
844844
845-
// If using the alternate CastingPlayer / Commissioner-Generated Passcode UDC feature commissioning flow:
845+
// If using the alternate CastingPlayer / Commissioner-Generated Passcode UDC feature:
846846
// Define a callback to handle CastingPlayer’s CommissionerDeclaration messages.
847847
void CommissionerDeclarationCallback(const chip::Transport::PeerAddress & source,
848848
chip::Protocols::UserDirectedCommissioning::CommissionerDeclaration cd)
@@ -889,7 +889,7 @@ CHIP_ERROR result = idOptions.addTargetAppInfo(targetAppInfo);
889889
matter::casting::core::ConnectionCallbacks connectionCallbacks;
890890
connectionCallbacks.mOnConnectionComplete = ConnectionHandler;
891891

892-
// If using the alternate CastingPlayer / Commissioner-Generated Passcode UDC feature commissioning flow:
892+
// If using the alternate CastingPlayer / Commissioner-Generated Passcode UDC feature:
893893
// Set the IdentificationDeclaration CommissionerPasscode flag to instruct the CastingPlayer /
894894
// Commissioner to use the Commissioner-generated Passcode for commissioning. Set the
895895
// CommissionerDeclarationCallback in ConnectionCallbacks.
@@ -921,7 +921,7 @@ IdentificationDeclarationOptions idOptions = new IdentificationDeclarationOption
921921
TargetAppInfo targetAppInfo = new TargetAppInfo(DESIRED_TARGET_APP_VENDOR_ID);
922922
idOptions.addTargetAppInfo(targetAppInfo);
923923

924-
// If using the alternate CastingPlayer / Commissioner-Generated Passcode UDC feature commissioning flow.
924+
// If using the alternate CastingPlayer / Commissioner-Generated Passcode UDC feature.
925925
// Set the IdentificationDeclaration CommissionerPasscode flag to instruct the CastingPlayer /
926926
// Commissioner to use the Commissioner-generated Passcode for commissioning.
927927
idOptions = new IdentificationDeclarationOptions(commissionerPasscode:true);
@@ -959,7 +959,7 @@ ConnectionCallbacks connectionCallbacks =
959959
});
960960
}
961961
},
962-
// If using the alternate CastingPlayer / Commissioner-Generated Passcode UDC feature commissioning flow.
962+
// If using the alternate CastingPlayer / Commissioner-Generated Passcode UDC feature.
963963
// Define a callback to handle CastingPlayer’s CommissionerDeclaration messages.
964964
// This can be null if using Casting Client / Commissionee generated passcode commissioning.
965965
new MatterCallback<CommissionerDeclaration>() {
@@ -1044,7 +1044,7 @@ func connect(selectedCastingPlayer: MCCastingPlayer?) {
10441044
}
10451045
}
10461046

1047-
// If using the alternate CastingPlayer / Commissioner-Generated Passcode UDC feature commissioning flow.
1047+
// If using the alternate CastingPlayer / Commissioner-Generated Passcode UDC feature.
10481048
// Define a callback to handle CastingPlayer’s CommissionerDeclaration messages.
10491049
let commissionerDeclarationCallback: (MCCommissionerDeclaration) -> Void = { commissionerDeclarationMessage in
10501050
DispatchQueue.main.async {
@@ -1119,7 +1119,7 @@ func connect(selectedCastingPlayer: MCCastingPlayer?) {
11191119
)
11201120
identificationDeclarationOptions.addTargetAppInfo(targetAppInfo)
11211121

1122-
// If using the alternate CastingPlayer / Commissioner-Generated Passcode UDC feature commissioning flow.
1122+
// If using the alternate CastingPlayer / Commissioner-Generated Passcode UDC feature.
11231123
// Set the IdentificationDeclaration CommissionerPasscode flag to instruct the CastingPlayer /
11241124
// Commissioner to use the Commissioner-generated Passcode for commissioning. Set the
11251125
// CommissionerDeclarationCallback in MCConnectionCallbacks.

examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ConnectionExampleFragment.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,13 @@ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
128128
() -> {
129129
Log.d(TAG, "onViewCreated() calling CastingPlayer.verifyOrEstablishConnection()");
130130

131-
IdentificationDeclarationOptions idOptions = new IdentificationDeclarationOptions();
131+
IdentificationDeclarationOptions idOptions;
132132
TargetAppInfo targetAppInfo = new TargetAppInfo(DESIRED_TARGET_APP_VENDOR_ID);
133133

134134
if (useCommissionerGeneratedPasscode) {
135-
// Constructor to set only the commissionerPasscode.
136-
idOptions = new IdentificationDeclarationOptions(true);
135+
// Set commissionerPasscode to true for CastingPlayer/Commissioner-Generated
136+
// passcode commissioning.
137+
idOptions = new IdentificationDeclarationOptions(false, false, true, false, false);
137138
targetAppInfo = new TargetAppInfo(DESIRED_TARGET_APP_VENDOR_ID_FOR_CGP_FLOW);
138139
Log.d(
139140
TAG,
@@ -142,6 +143,7 @@ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
142143
+ ", useCommissionerGeneratedPasscode: "
143144
+ useCommissionerGeneratedPasscode);
144145
} else {
146+
idOptions = new IdentificationDeclarationOptions();
145147
Log.d(
146148
TAG,
147149
"onViewCreated() calling CastingPlayer.verifyOrEstablishConnection() Target Content Application Vendor ID: "

examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/IdentificationDeclarationOptions.java

-9
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,6 @@ public class IdentificationDeclarationOptions {
3030
/** Default constructor. */
3131
public IdentificationDeclarationOptions() {}
3232

33-
/**
34-
* Constructor to set only the commissionerPasscode.
35-
*
36-
* @param commissionerPasscode the commissioner passcode flag.
37-
*/
38-
public IdentificationDeclarationOptions(boolean commissionerPasscode) {
39-
this.commissionerPasscode = commissionerPasscode;
40-
}
41-
4233
/**
4334
* Constructor to set all fields.
4435
*

0 commit comments

Comments
 (0)