Skip to content

Commit bf57502

Browse files
authored
Merge branch 'master' into add_compare_ipaddress_discoverednode
2 parents 6f06f3b + 294dc18 commit bf57502

File tree

134 files changed

+2184
-13014
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+2184
-13014
lines changed

.github/workflows/tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -536,13 +536,11 @@ jobs:
536536
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"'
537537
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"'
538538
scripts/run_in_python_env.sh out/venv './scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py'
539-
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_1_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"'
540539
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"'
541540
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"'
542541
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"'
543542
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_4.py" --script-args "--endpoint 1 --int-arg PIXIT.OPSTATE.ErrorEventGen: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"'
544543
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_5.py" --script-args "--endpoint 1 --int-arg PIXIT.WAITTIME.REBOOT: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"'
545-
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_OVENOPSTATE_1_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"'
546544
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_OVENOPSTATE_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"'
547545
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_OVENOPSTATE_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"'
548546
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_OVENOPSTATE_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"'
@@ -563,6 +561,8 @@ jobs:
563561
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-rvc-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-rvc-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_file json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_RVCOPSTATE_2_4.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
564562
scripts/run_in_python_env.sh out/venv './src/python_testing/test_testing/test_TC_DA_1_2.py'
565563
scripts/run_in_python_env.sh out/venv './src/python_testing/test_testing/test_TC_ICDM_2_1.py'
564+
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestIdChecks.py'
565+
566566
- name: Uploading core files
567567
uses: actions/upload-artifact@v4
568568
if: ${{ failure() && !env.ACT }}

build/config/compiler/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ config("runtime_default") {
356356
}
357357
if (current_os == "linux" || current_os == "tizen" || current_os == "webos") {
358358
libs = [
359+
"atomic",
359360
"dl",
360361
"pthread",
361362
"rt",

docs/testing/python.md

+55-7
Original file line numberDiff line numberDiff line change
@@ -480,16 +480,64 @@ second_ctrl = fa.new_fabric_admin.NewController(nodeId=node_id)
480480

481481
# Running tests locally
482482

483-
You can run the python script as-is for local testing against an already-running
484-
DUT
483+
## Setup
485484

486-
`./scripts/tests/run_python_test.py` is a convenient script to fire up an
487-
example DUT on the host, with factory reset support
485+
The scripts require the python wheel to be compiled and installed before
486+
running. To compile and install the wheel, do the following:
488487

489-
`./scripts/tests/run_python_test.py --factoryreset --app <your_app> --app-args "whatever" --script <your_script> --script-args "whatever"`
488+
First activate the matter environment using either
489+
490+
```
491+
. ./scripts/bootstrap.sh
492+
```
493+
494+
or
495+
496+
```
497+
. ./scripts/activate.sh
498+
```
499+
500+
bootstrap.sh should be used for for the first setup, activate.sh may be used for
501+
subsequent setups as it is faster.
502+
503+
Next build the python wheels and create / activate a venv (called `py` here, but
504+
any name may be used)
505+
506+
```
507+
./scripts/build_python.sh -i py
508+
source py/bin/activate
509+
```
510+
511+
## Running tests
490512

491-
Note that devices must be commissioned by the python test harness to run tests.
492-
chip-tool and the python test harness DO NOT share a fabric.
513+
- Note that devices must be commissioned by the python test harness to run
514+
tests. chip-tool and the python test harness DO NOT share a fabric.
515+
516+
Once the wheel is installed, you can run the python script as a normal python
517+
file for local testing against an already-running DUT. This can be an example
518+
app on the host computer (running in a different terminal), or a separate device
519+
that will be commissioned either over BLE or WiFi.
520+
521+
For example, to run the TC-ACE-1.2 tests against an un-commissioned DUT:
522+
523+
```
524+
python3 src/python_testing/TC_ACE_1_2.py --commissioning-method on-network --qr-code MT:-24J0AFN00KA0648G00
525+
```
526+
527+
Some tests require additional arguments (ex. PIXITs or configuration variables
528+
for the CI). These arguments can be passed as sets of key-value pairs using the
529+
`--<type>-arg` command line arguments. For example
530+
531+
```
532+
--int-arg PIXIT.ACE.APPENDPOINT:1 PIXIT.ACE.APPDEVTYPEID:0x0100 --string-arg PIXIT.ACE.APPCLUSTER:OnOff PIXIT.ACE.APPATTRIBUTE:OnOff
533+
```
534+
535+
## Local host app testing
536+
537+
`./scripts/tests/run_python_test.py` is a convenient script that starts an
538+
example DUT on the host and includes factory reset support
539+
540+
`./scripts/tests/run_python_test.py --factoryreset --app <your_app> --app-args "whatever" --script <your_script> --script-args "whatever"`
493541

494542
# Running tests in CI
495543

examples/chip-tool/commands/clusters/ClusterCommand.h

+15-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub
5555
return InteractionModelCommands::SendCommand(device, endpointId, clusterId, commandId, value);
5656
}
5757

58+
CHIP_ERROR SendCommand(chip::DeviceProxy * device, chip::EndpointId endpointId, chip::ClusterId clusterId,
59+
chip::CommandId commandId,
60+
const chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Type & value)
61+
{
62+
ReturnErrorOnFailure(InteractionModelCommands::SendCommand(device, endpointId, clusterId, commandId, value));
63+
mScopedNodeId = chip::ScopedNodeId(value.checkInNodeID, device->GetSecureSession().Value()->GetFabricIndex());
64+
return CHIP_NO_ERROR;
65+
}
66+
5867
CHIP_ERROR SendCommand(chip::DeviceProxy * device, chip::EndpointId endpointId, chip::ClusterId clusterId,
5968
chip::CommandId commandId,
6069
const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsRequest::Type & value)
@@ -109,6 +118,11 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub
109118
return;
110119
}
111120
}
121+
if ((path.mEndpointId == chip::kRootEndpointId) && (path.mClusterId == chip::app::Clusters::IcdManagement::Id) &&
122+
(path.mCommandId == chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Id))
123+
{
124+
ModelCommand::ClearICDEntry(mScopedNodeId);
125+
}
112126
}
113127

114128
virtual void OnError(const chip::app::CommandSender * client, CHIP_ERROR error) override
@@ -208,7 +222,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub
208222
private:
209223
chip::ClusterId mClusterId;
210224
chip::CommandId mCommandId;
211-
225+
chip::ScopedNodeId mScopedNodeId;
212226
CHIP_ERROR mError = CHIP_NO_ERROR;
213227
CustomArgument mPayload;
214228
};

examples/chip-tool/commands/clusters/ModelCommand.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ void ModelCommand::Shutdown()
7676
CHIPCommand::Shutdown();
7777
}
7878

79+
void ModelCommand::ClearICDEntry(const chip::ScopedNodeId & nodeId)
80+
{
81+
CHIP_ERROR deleteEntryError = CHIPCommand::sICDClientStorage.DeleteEntry(nodeId);
82+
if (deleteEntryError != CHIP_NO_ERROR)
83+
{
84+
ChipLogError(chipTool, "Failed to delete ICD entry: %" CHIP_ERROR_FORMAT, deleteEntryError.Format());
85+
}
86+
}
87+
7988
void ModelCommand::CheckPeerICDType()
8089
{
8190
if (mIsPeerLIT.HasValue())

examples/chip-tool/commands/clusters/ModelCommand.h

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ class ModelCommand : public CHIPCommand
6767

6868
virtual CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) { return CHIP_ERROR_BAD_REQUEST; };
6969

70+
virtual void ClearICDEntry(const chip::ScopedNodeId & nodeId);
71+
7072
void Shutdown() override;
7173

7274
protected:

examples/fabric-bridge-app/linux/BUILD.gn

+2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ executable("fabric-bridge-app") {
2222
sources = [
2323
"${chip_root}/examples/fabric-bridge-app/fabric-bridge-common/include/CHIPProjectAppConfig.h",
2424
"Device.cpp",
25+
"DeviceManager.cpp",
2526
"include/Device.h",
27+
"include/DeviceManager.h",
2628
"main.cpp",
2729
]
2830

examples/fabric-bridge-app/linux/Device.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ void Device::SetReachable(bool aReachable)
4646

4747
if (aReachable)
4848
{
49-
ChipLogProgress(DeviceLayer, "Device[%s]: ONLINE", mName);
49+
ChipLogProgress(NotSpecified, "Device[%s]: ONLINE", mName);
5050
}
5151
else
5252
{
53-
ChipLogProgress(DeviceLayer, "Device[%s]: OFFLINE", mName);
53+
ChipLogProgress(NotSpecified, "Device[%s]: OFFLINE", mName);
5454
}
5555

5656
if (changed)
@@ -63,7 +63,7 @@ void Device::SetName(const char * szName)
6363
{
6464
bool changed = (strncmp(mName, szName, sizeof(mName)) != 0);
6565

66-
ChipLogProgress(DeviceLayer, "Device[%s]: New Name=\"%s\"", mName, szName);
66+
ChipLogProgress(NotSpecified, "Device[%s]: New Name=\"%s\"", mName, szName);
6767

6868
chip::Platform::CopyString(mName, szName);
6969

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
/*
2+
*
3+
* Copyright (c) 2024 Project CHIP Authors
4+
* All rights reserved.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
#include "DeviceManager.h"
20+
21+
#include <app-common/zap-generated/ids/Attributes.h>
22+
#include <app-common/zap-generated/ids/Clusters.h>
23+
#include <app/AttributeAccessInterfaceRegistry.h>
24+
#include <app/ConcreteAttributePath.h>
25+
#include <app/EventLogging.h>
26+
#include <app/reporting/reporting.h>
27+
#include <app/server/Server.h>
28+
#include <app/util/af-types.h>
29+
#include <app/util/attribute-storage.h>
30+
#include <app/util/endpoint-config-api.h>
31+
#include <app/util/util.h>
32+
#include <lib/support/CHIPMem.h>
33+
#include <lib/support/ZclString.h>
34+
35+
#include <cstdio>
36+
#include <string>
37+
38+
using namespace chip;
39+
using namespace chip::app;
40+
using namespace chip::Credentials;
41+
using namespace chip::Inet;
42+
using namespace chip::Transport;
43+
using namespace chip::DeviceLayer;
44+
using namespace chip::app::Clusters;
45+
46+
namespace {
47+
constexpr uint8_t kMaxRetries = 10;
48+
} // namespace
49+
50+
DeviceManager::DeviceManager()
51+
{
52+
memset(mDevices, 0, sizeof(mDevices));
53+
mFirstDynamicEndpointId = static_cast<chip::EndpointId>(
54+
static_cast<int>(emberAfEndpointFromIndex(static_cast<uint16_t>(emberAfFixedEndpointCount() - 1))) + 1);
55+
mCurrentEndpointId = mFirstDynamicEndpointId;
56+
}
57+
58+
int DeviceManager::AddDeviceEndpoint(Device * dev, EmberAfEndpointType * ep,
59+
const chip::Span<const EmberAfDeviceType> & deviceTypeList,
60+
const chip::Span<chip::DataVersion> & dataVersionStorage, chip::EndpointId parentEndpointId)
61+
{
62+
uint8_t index = 0;
63+
while (index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT)
64+
{
65+
if (nullptr == mDevices[index])
66+
{
67+
mDevices[index] = dev;
68+
CHIP_ERROR err;
69+
int retryCount = 0;
70+
while (retryCount < kMaxRetries)
71+
{
72+
DeviceLayer::StackLock lock;
73+
dev->SetEndpointId(mCurrentEndpointId);
74+
dev->SetParentEndpointId(parentEndpointId);
75+
err =
76+
emberAfSetDynamicEndpoint(index, mCurrentEndpointId, ep, dataVersionStorage, deviceTypeList, parentEndpointId);
77+
if (err == CHIP_NO_ERROR)
78+
{
79+
ChipLogProgress(NotSpecified, "Added device %s to dynamic endpoint %d (index=%d)", dev->GetName(),
80+
mCurrentEndpointId, index);
81+
return index;
82+
}
83+
if (err != CHIP_ERROR_ENDPOINT_EXISTS)
84+
{
85+
return -1; // Return error as endpoint addition failed due to an error other than endpoint already exists
86+
}
87+
// Increment the endpoint ID and handle wrap condition
88+
if (++mCurrentEndpointId < mFirstDynamicEndpointId)
89+
{
90+
mCurrentEndpointId = mFirstDynamicEndpointId;
91+
}
92+
retryCount++;
93+
}
94+
ChipLogError(NotSpecified, "Failed to add dynamic endpoint after %d retries", kMaxRetries);
95+
return -1; // Return error as all retries are exhausted
96+
}
97+
index++;
98+
}
99+
ChipLogProgress(NotSpecified, "Failed to add dynamic endpoint: No endpoints available!");
100+
return -1;
101+
}
102+
103+
int DeviceManager::RemoveDeviceEndpoint(Device * dev)
104+
{
105+
uint8_t index = 0;
106+
while (index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT)
107+
{
108+
if (mDevices[index] == dev)
109+
{
110+
DeviceLayer::StackLock lock;
111+
// Silence complaints about unused ep when progress logging
112+
// disabled.
113+
[[maybe_unused]] EndpointId ep = emberAfClearDynamicEndpoint(index);
114+
mDevices[index] = nullptr;
115+
ChipLogProgress(NotSpecified, "Removed device %s from dynamic endpoint %d (index=%d)", dev->GetName(), ep, index);
116+
return index;
117+
}
118+
index++;
119+
}
120+
return -1;
121+
}
122+
123+
Device * DeviceManager::GetDevice(uint16_t index) const
124+
{
125+
if (index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT)
126+
{
127+
return mDevices[index];
128+
}
129+
return nullptr;
130+
}

0 commit comments

Comments
 (0)