Skip to content

Commit

Permalink
Merge branch 'master' into chef-robotic-vacuum-cleaner-326681447
Browse files Browse the repository at this point in the history
  • Loading branch information
stingchang authored Jun 6, 2024
2 parents 056dcaf + 321f895 commit 10850f9
Show file tree
Hide file tree
Showing 60 changed files with 2,309 additions and 458 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ jobs:
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TestMatterTestingSupport.py" --script-args "--trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TestSpecParsingSupport.py" --script-args "--trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OPCREDS_3_2.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OPSTATE_2_1.py" --script-args "--endpoint 1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OPSTATE_2_2.py" --script-args "--endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OPSTATE_2_3.py" --script-args "--endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
Expand Down
2 changes: 1 addition & 1 deletion config/nrfconnect/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ matter_add_gn_arg_bool ("chip_enable_nfc" CONFIG_CHIP_NF
matter_add_gn_arg_bool ("chip_enable_ota_requestor" CONFIG_CHIP_OTA_REQUESTOR)
matter_add_gn_arg_bool ("chip_persist_subscriptions" CONFIG_CHIP_PERSISTENT_SUBSCRIPTIONS)
matter_add_gn_arg_bool ("chip_monolithic_tests" CONFIG_CHIP_BUILD_TESTS)
matter_add_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" CONFIG_CHIP_BUILD_TESTS)
matter_add_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" FALSE)
matter_add_gn_arg_bool ("chip_error_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 1)
matter_add_gn_arg_bool ("chip_progress_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 3)
matter_add_gn_arg_bool ("chip_detail_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 4)
Expand Down
14 changes: 9 additions & 5 deletions examples/chip-tool/commands/clusters/ClusterCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,23 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub

if (data != nullptr)
{
LogErrorOnFailure(RemoteDataModelLogger::LogCommandAsJSON(path, data));

error = DataModelLogger::LogCommand(path, data);
{
// log a snapshot to not advance the data reader.
chip::TLV::TLVReader logTlvReader;
logTlvReader.Init(*data);
LogErrorOnFailure(RemoteDataModelLogger::LogCommandAsJSON(path, &logTlvReader));
error = DataModelLogger::LogCommand(path, &logTlvReader);
}
if (CHIP_NO_ERROR != error)
{
ChipLogError(chipTool, "Response Failure: Can not decode Data");
mError = error;
return;
}
if ((path.mEndpointId == chip::kRootEndpointId) && (path.mClusterId == chip::app::Clusters::IcdManagement::Id) &&
(path.mCommandId == chip::app::Clusters::IcdManagement::Commands::RegisterClient::Id))
(path.mCommandId == chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::Id))
{
// log a snapshot to not advance the data reader.
chip::TLV::TLVReader counterTlvReader;
counterTlvReader.Init(*data);
chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType value;
Expand All @@ -139,7 +144,6 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub
ChipLogError(chipTool, "Failed to decode ICD counter: %" CHIP_ERROR_FORMAT, err.Format());
return;
}

chip::app::ICDClientInfo clientInfo;
clientInfo.peer_node = mScopedNodeId;
clientInfo.monitored_subject = mMonitoredSubject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ public void handleCommissioningButtonClicked(DiscoveredNodeData commissioner) {
}

@Override
public void handleConnectionButtonClicked(CastingPlayer castingPlayer) {
Log.i(TAG, "MainActivity.handleConnectionButtonClicked() called");
showFragment(ConnectionExampleFragment.newInstance(castingPlayer));
public void handleConnectionButtonClicked(
CastingPlayer castingPlayer, boolean useCommissionerGeneratedPasscode) {
Log.i(TAG, "MainActivity.handleConnectionButtonClicked()");
showFragment(
ConnectionExampleFragment.newInstance(castingPlayer, useCommissionerGeneratedPasscode));
}

@Override
Expand All @@ -77,26 +79,35 @@ public void handleCommissioningComplete() {
}

@Override
public void handleConnectionComplete(CastingPlayer castingPlayer) {
Log.i(TAG, "MainActivity.handleConnectionComplete() called ");
showFragment(ActionSelectorFragment.newInstance(castingPlayer));
public void handleConnectionComplete(
CastingPlayer castingPlayer, boolean useCommissionerGeneratedPasscode) {
Log.i(TAG, "MainActivity.handleConnectionComplete()");
showFragment(
ActionSelectorFragment.newInstance(castingPlayer, useCommissionerGeneratedPasscode));
}

@Override
public void handleContentLauncherLaunchURLSelected(CastingPlayer selectedCastingPlayer) {
showFragment(ContentLauncherLaunchURLExampleFragment.newInstance(selectedCastingPlayer));
public void handleContentLauncherLaunchURLSelected(
CastingPlayer selectedCastingPlayer, boolean useCommissionerGeneratedPasscode) {
showFragment(
ContentLauncherLaunchURLExampleFragment.newInstance(
selectedCastingPlayer, useCommissionerGeneratedPasscode));
}

@Override
public void handleApplicationBasicReadVendorIDSelected(CastingPlayer selectedCastingPlayer) {
showFragment(ApplicationBasicReadVendorIDExampleFragment.newInstance(selectedCastingPlayer));
public void handleApplicationBasicReadVendorIDSelected(
CastingPlayer selectedCastingPlayer, boolean useCommissionerGeneratedPasscode) {
showFragment(
ApplicationBasicReadVendorIDExampleFragment.newInstance(
selectedCastingPlayer, useCommissionerGeneratedPasscode));
}

@Override
public void handleMediaPlaybackSubscribeToCurrentStateSelected(
CastingPlayer selectedCastingPlayer) {
CastingPlayer selectedCastingPlayer, boolean useCommissionerGeneratedPasscode) {
showFragment(
MediaPlaybackSubscribeToCurrentStateExampleFragment.newInstance(selectedCastingPlayer));
MediaPlaybackSubscribeToCurrentStateExampleFragment.newInstance(
selectedCastingPlayer, useCommissionerGeneratedPasscode));
}

@Override
Expand Down Expand Up @@ -148,7 +159,10 @@ private boolean initJni() {
private void showFragment(Fragment fragment, boolean showOnBack) {
Log.d(
TAG,
"showFragment() called with " + fragment.getClass().getSimpleName() + " and " + showOnBack);
"showFragment() called with: "
+ fragment.getClass().getSimpleName()
+ ", and showOnBack: "
+ showOnBack);
FragmentTransaction fragmentTransaction =
getSupportFragmentManager()
.beginTransaction()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,31 @@ public class ActionSelectorFragment extends Fragment {
private static final String TAG = ActionSelectorFragment.class.getSimpleName();

private final CastingPlayer selectedCastingPlayer;
private final boolean useCommissionerGeneratedPasscode;

private View.OnClickListener selectContentLauncherButtonClickListener;
private View.OnClickListener selectApplicationBasicButtonClickListener;
private View.OnClickListener selectMediaPlaybackButtonClickListener;
private View.OnClickListener disconnectButtonClickListener;

public ActionSelectorFragment(CastingPlayer selectedCastingPlayer) {
public ActionSelectorFragment(
CastingPlayer selectedCastingPlayer, boolean useCommissionerGeneratedPasscode) {
this.selectedCastingPlayer = selectedCastingPlayer;
this.useCommissionerGeneratedPasscode = useCommissionerGeneratedPasscode;
}

/**
* Use this factory method to create a new instance of this fragment using the provided
* parameters.
*
* @param selectedCastingPlayer CastingPlayer that the casting app connected to
* @param useCommissionerGeneratedPasscode Boolean indicating whether this CastingPlayer was
* commissioned using the Commissioner-Generated passcode commissioning flow.
* @return A new instance of fragment SelectActionFragment.
*/
public static ActionSelectorFragment newInstance(CastingPlayer selectedCastingPlayer) {
return new ActionSelectorFragment(selectedCastingPlayer);
public static ActionSelectorFragment newInstance(
CastingPlayer selectedCastingPlayer, boolean useCommissionerGeneratedPasscode) {
return new ActionSelectorFragment(selectedCastingPlayer, useCommissionerGeneratedPasscode);
}

@Override
Expand All @@ -64,17 +70,20 @@ public View onCreateView(
this.selectContentLauncherButtonClickListener =
v -> {
Log.d(TAG, "handle() called on selectContentLauncherButtonClickListener");
callback.handleContentLauncherLaunchURLSelected(selectedCastingPlayer);
callback.handleContentLauncherLaunchURLSelected(
selectedCastingPlayer, useCommissionerGeneratedPasscode);
};
this.selectApplicationBasicButtonClickListener =
v -> {
Log.d(TAG, "handle() called on selectApplicationBasicButtonClickListener");
callback.handleApplicationBasicReadVendorIDSelected(selectedCastingPlayer);
callback.handleApplicationBasicReadVendorIDSelected(
selectedCastingPlayer, useCommissionerGeneratedPasscode);
};
this.selectMediaPlaybackButtonClickListener =
v -> {
Log.d(TAG, "handle() called on selectMediaPlaybackButtonClickListener");
callback.handleMediaPlaybackSubscribeToCurrentStateSelected(selectedCastingPlayer);
callback.handleMediaPlaybackSubscribeToCurrentStateSelected(
selectedCastingPlayer, useCommissionerGeneratedPasscode);
};

this.disconnectButtonClickListener =
Expand Down Expand Up @@ -107,13 +116,16 @@ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
/** Interface for notifying the host. */
public interface Callback {
/** Notifies listener to trigger transition on selection of Content Launcher cluster */
void handleContentLauncherLaunchURLSelected(CastingPlayer selectedCastingPlayer);
void handleContentLauncherLaunchURLSelected(
CastingPlayer selectedCastingPlayer, boolean useCommissionerGeneratedPasscode);

/** Notifies listener to trigger transition on selection of Application Basic cluster */
void handleApplicationBasicReadVendorIDSelected(CastingPlayer selectedCastingPlayer);
void handleApplicationBasicReadVendorIDSelected(
CastingPlayer selectedCastingPlayer, boolean useCommissionerGeneratedPasscode);

/** Notifies listener to trigger transition on selection of Media PLayback cluster */
void handleMediaPlaybackSubscribeToCurrentStateSelected(CastingPlayer selectedCastingPlayer);
void handleMediaPlaybackSubscribeToCurrentStateSelected(
CastingPlayer selectedCastingPlayer, boolean useCommissionerGeneratedPasscode);

/** Notifies listener to trigger transition on click of the Disconnect button */
void handleDisconnect();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,32 @@
public class ApplicationBasicReadVendorIDExampleFragment extends Fragment {
private static final String TAG =
ApplicationBasicReadVendorIDExampleFragment.class.getSimpleName();
private static final int DEFAULT_ENDPOINT_ID_FOR_CGP_FLOW = 1;

private final CastingPlayer selectedCastingPlayer;
private final boolean useCommissionerGeneratedPasscode;

private View.OnClickListener readButtonClickListener;

public ApplicationBasicReadVendorIDExampleFragment(CastingPlayer selectedCastingPlayer) {
public ApplicationBasicReadVendorIDExampleFragment(
CastingPlayer selectedCastingPlayer, boolean useCommissionerGeneratedPasscode) {
this.selectedCastingPlayer = selectedCastingPlayer;
this.useCommissionerGeneratedPasscode = useCommissionerGeneratedPasscode;
}

/**
* Use this factory method to create a new instance of this fragment using the provided
* parameters.
*
* @param selectedCastingPlayer CastingPlayer that the casting app connected to
* @param selectedCastingPlayer CastingPlayer that the casting app connected to.
* @param useCommissionerGeneratedPasscode Boolean indicating whether this CastingPlayer was
* commissioned using the Commissioner-Generated Passcode (CGP) commissioning flow.
* @return A new instance of fragment ApplicationBasicReadVendorIDExampleFragment.
*/
public static ApplicationBasicReadVendorIDExampleFragment newInstance(
CastingPlayer selectedCastingPlayer) {
return new ApplicationBasicReadVendorIDExampleFragment(selectedCastingPlayer);
CastingPlayer selectedCastingPlayer, boolean useCommissionerGeneratedPasscode) {
return new ApplicationBasicReadVendorIDExampleFragment(
selectedCastingPlayer, useCommissionerGeneratedPasscode);
}

@Override
Expand All @@ -68,8 +75,14 @@ public View onCreateView(
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
this.readButtonClickListener =
v -> {
Endpoint endpoint =
EndpointSelectorExample.selectFirstEndpointByVID(selectedCastingPlayer);
Endpoint endpoint;
if (useCommissionerGeneratedPasscode) {
endpoint =
EndpointSelectorExample.selectEndpointById(
selectedCastingPlayer, DEFAULT_ENDPOINT_ID_FOR_CGP_FLOW);
} else {
endpoint = EndpointSelectorExample.selectFirstEndpointByVID(selectedCastingPlayer);
}
if (endpoint == null) {
Log.e(TAG, "No Endpoint with sample vendorID found on CastingPlayer");
return;
Expand Down
Loading

0 comments on commit 10850f9

Please sign in to comment.