Skip to content

Commit c9a6c3e

Browse files
authored
Merge branch 'master' into data-model-provider/attribute-change-report
2 parents b0dc126 + e419e33 commit c9a6c3e

File tree

9 files changed

+40
-28
lines changed

9 files changed

+40
-28
lines changed

examples/darwin-framework-tool/commands/common/ControllerStorage.mm

+2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
#import "ControllerStorage.h"
2020
#import "PreferencesStorage.h"
2121

22+
#ifdef LOG_DEBUG_CONTROLLER_STORAGE
2223
#include <lib/support/logging/CHIPLogging.h>
24+
#endif // LOG_DEBUG_CONTROLLER_STORAGE
2325

2426
NSString * const kDarwinFrameworkToolControllerDomain = @"com.apple.darwin-framework-tool.controller";
2527

Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
93 : [Telink] Update Docker image (Zephyr update)
1+
94 : [Telink] Update Docker image (Zephyr update)

integrations/docker/images/stage-2/chip-build-telink/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN set -x \
1818
&& : # last line
1919

2020
# Setup Zephyr
21-
ARG ZEPHYR_REVISION=8b29ee6b118ebe6eeec3224dbe343474e11403d8
21+
ARG ZEPHYR_REVISION=ffdbfe7560c0b628e03ab487ab110eeed9bdc8c7
2222
WORKDIR /opt/telink/zephyrproject
2323
RUN set -x \
2424
&& python3 -m pip install --break-system-packages -U --no-cache-dir west \

src/controller/python/OpCredsBinding.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,8 @@ PyChipError pychip_OpCreds_AllocateController(OpCredsContext * context, chip::Co
490490

491491
// Initialize device attestation verifier
492492
const chip::Credentials::AttestationTrustStore * testingRootStore = GetTestFileAttestationTrustStore(paaTrustStorePath);
493-
SetDeviceAttestationVerifier(GetDefaultDACVerifier(testingRootStore));
493+
chip::Credentials::DeviceAttestationVerifier * dacVerifier = chip::Credentials::GetDefaultDACVerifier(testingRootStore);
494+
SetDeviceAttestationVerifier(dacVerifier);
494495

495496
chip::Crypto::P256Keypair ephemeralKey;
496497
chip::Crypto::P256Keypair * controllerKeyPair;
@@ -544,6 +545,7 @@ PyChipError pychip_OpCreds_AllocateController(OpCredsContext * context, chip::Co
544545
initParams.controllerVendorId = adminVendorId;
545546
initParams.permitMultiControllerFabrics = true;
546547
initParams.hasExternallyOwnedOperationalKeypair = operationalKey != nullptr;
548+
initParams.deviceAttestationVerifier = dacVerifier;
547549

548550
if (useTestCommissioner)
549551
{

src/controller/python/chip/clusters/ClusterObjects.py

+1
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ class Cluster(ClusterObject):
257257
especially the TLV decoding logic. Also ThreadNetworkDiagnostics has an attribute with the same name so we
258258
picked data_version as its name.
259259
'''
260+
id: Any
260261

261262
def __init_subclass__(cls, *args, **kwargs) -> None:
262263
"""Register a subclass."""

src/controller/python/chip/internal/CommissionerImpl.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ extern "C" chip::Controller::DeviceCommissioner * pychip_internal_Commissioner_N
132132
// TODO: add option to pass in custom PAA Trust Store path to the python controller app
133133
const chip::Credentials::AttestationTrustStore * testingRootStore =
134134
GetTestFileAttestationTrustStore("./credentials/development/paa-root-certs");
135-
chip::Credentials::SetDeviceAttestationVerifier(chip::Credentials::GetDefaultDACVerifier(testingRootStore));
135+
chip::Credentials::DeviceAttestationVerifier * dacVerifier = chip::Credentials::GetDefaultDACVerifier(testingRootStore);
136+
chip::Credentials::SetDeviceAttestationVerifier(dacVerifier);
136137

137138
factoryParams.fabricIndependentStorage = &gServerStorage;
138139
factoryParams.sessionKeystore = &gSessionKeystore;
@@ -184,6 +185,7 @@ extern "C" chip::Controller::DeviceCommissioner * pychip_internal_Commissioner_N
184185
commissionerParams.controllerRCAC = rcacSpan;
185186
commissionerParams.controllerICAC = icacSpan;
186187
commissionerParams.controllerNOC = nocSpan;
188+
commissionerParams.deviceAttestationVerifier = dacVerifier;
187189

188190
SuccessOrExit(err = DeviceControllerFactory::GetInstance().Init(factoryParams));
189191
SuccessOrExit(err = DeviceControllerFactory::GetInstance().SetupCommissioner(commissionerParams, *result));

src/lib/dnssd/TxtFields.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ uint8_t GetCommissionerPasscode(const ByteSpan & value);
121121

122122
constexpr size_t MaxKeyLen(TxtKeyUse use)
123123
{
124-
size_t max = 0;
124+
size_t max = 1;
125125
for (auto & info : Internal::txtFieldInfo)
126126
{
127127
if (use == info.use)
@@ -147,7 +147,7 @@ constexpr size_t TotalKeyLen(TxtKeyUse use)
147147

148148
constexpr size_t MaxValueLen(TxtKeyUse use)
149149
{
150-
size_t max = 0;
150+
size_t max = 1;
151151
for (auto & info : Internal::txtFieldInfo)
152152
{
153153
if (use == info.use)

src/platform/ESP32/DiagnosticDataProviderImpl.cpp

+15-10
Original file line numberDiff line numberDiff line change
@@ -217,32 +217,37 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface **
217217
{
218218
NetworkInterface * ifp = new NetworkInterface();
219219
esp_netif_ip_info_t ipv4_info;
220+
uint8_t addressSize = 0;
220221
Platform::CopyString(ifp->Name, esp_netif_get_ifkey(ifa));
221222
ifp->name = CharSpan::fromCharString(ifp->Name);
222223
ifp->isOperational = true;
223224
ifp->type = GetInterfaceType(esp_netif_get_desc(ifa));
224225
ifp->offPremiseServicesReachableIPv4.SetNull();
225226
ifp->offPremiseServicesReachableIPv6.SetNull();
226-
#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD
227-
if (esp_netif_get_mac(ifa, ifp->MacAddress) != ESP_OK)
227+
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
228+
if (ifp->type == InterfaceTypeEnum::kThread)
228229
{
229-
ChipLogError(DeviceLayer, "Failed to get network hardware address");
230+
static_assert(OT_EXT_ADDRESS_SIZE <= sizeof(ifp->MacAddress), "Unexpected extended address size");
231+
if (ThreadStackMgr().GetPrimary802154MACAddress(ifp->MacAddress) == CHIP_NO_ERROR)
232+
{
233+
addressSize = OT_EXT_ADDRESS_SIZE;
234+
}
230235
}
231236
else
237+
#endif
238+
if (esp_netif_get_mac(ifa, ifp->MacAddress) == ESP_OK)
232239
{
233-
ifp->hardwareAddress = ByteSpan(ifp->MacAddress, 6);
240+
// For Wi-Fi or Ethernet interface, the MAC address size should be 6
241+
addressSize = 6;
234242
}
235-
#else
236-
if (esp_read_mac(ifp->MacAddress, ESP_MAC_IEEE802154) != ESP_OK)
243+
if (addressSize != 0)
237244
{
238-
ChipLogError(DeviceLayer, "Failed to get network hardware address");
245+
ifp->hardwareAddress = ByteSpan(ifp->MacAddress, addressSize);
239246
}
240247
else
241248
{
242-
ifp->hardwareAddress = ByteSpan(ifp->MacAddress, 8);
249+
ChipLogError(DeviceLayer, "Failed to get network hardware address");
243250
}
244-
#endif
245-
246251
#ifndef CONFIG_DISABLE_IPV4
247252
if (esp_netif_get_ip_info(ifa, &ipv4_info) == ESP_OK)
248253
{

src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def stash_globally(o: object) -> str:
106106
return id
107107

108108

109-
def unstash_globally(id: str) -> object:
109+
def unstash_globally(id: str) -> Any:
110110
return _GLOBAL_DATA.get(id)
111111

112112

@@ -205,7 +205,7 @@ def utc_datetime_from_posix_time_ms(posix_time_ms: int) -> datetime:
205205
return datetime.fromtimestamp(seconds, timezone.utc) + timedelta(milliseconds=millis)
206206

207207

208-
def compare_time(received: int, offset: timedelta = timedelta(), utc: int = None, tolerance: timedelta = timedelta(seconds=5)) -> None:
208+
def compare_time(received: int, offset: timedelta = timedelta(), utc: Optional[int] = None, tolerance: timedelta = timedelta(seconds=5)) -> None:
209209
if utc is None:
210210
utc = utc_time_in_matter_epoch()
211211

@@ -243,7 +243,7 @@ def __init__(self, expected_cluster: ClusterObjects.Cluster):
243243
"""This class creates a queue to store received event callbacks, that can be checked by the test script
244244
expected_cluster: is the cluster from which the events are expected
245245
"""
246-
self._q = queue.Queue()
246+
self._q: queue.Queue = queue.Queue()
247247
self._expected_cluster = expected_cluster
248248

249249
async def start(self, dev_ctrl, node_id: int, endpoint: int, fabric_filtered: bool = False, min_interval_sec: int = 0, max_interval_sec: int = 30) -> Any:
@@ -976,7 +976,7 @@ def get_test_steps(self, test: str) -> list[TestStep]:
976976
steps = self.get_defined_test_steps(test)
977977
return [TestStep(1, "Run entire test")] if steps is None else steps
978978

979-
def get_defined_test_steps(self, test: str) -> list[TestStep]:
979+
def get_defined_test_steps(self, test: str) -> Optional[list[TestStep]]:
980980
steps_name = f'steps_{test.removeprefix("test_")}'
981981
try:
982982
fn = getattr(self, steps_name)
@@ -996,7 +996,7 @@ def get_test_pics(self, test: str) -> list[str]:
996996
pics = self._get_defined_pics(test)
997997
return [] if pics is None else pics
998998

999-
def _get_defined_pics(self, test: str) -> list[TestStep]:
999+
def _get_defined_pics(self, test: str) -> Optional[list[str]]:
10001000
steps_name = f'pics_{test.removeprefix("test_")}'
10011001
try:
10021002
fn = getattr(self, steps_name)
@@ -1093,7 +1093,7 @@ def matter_test_config(self) -> MatterTestConfig:
10931093
return unstash_globally(self.user_params.get("matter_test_config"))
10941094

10951095
@property
1096-
def default_controller(self) -> ChipDeviceCtrl:
1096+
def default_controller(self) -> ChipDeviceCtrl.ChipDeviceController:
10971097
return unstash_globally(self.user_params.get("default_controller"))
10981098

10991099
@property
@@ -1162,7 +1162,7 @@ def check_pics(self, pics_key: str) -> bool:
11621162
def is_pics_sdk_ci_only(self) -> bool:
11631163
return self.check_pics('PICS_SDK_CI_ONLY')
11641164

1165-
async def open_commissioning_window(self, dev_ctrl: Optional[ChipDeviceCtrl] = None, node_id: Optional[int] = None, timeout: int = 900) -> CustomCommissioningParameters:
1165+
async def open_commissioning_window(self, dev_ctrl: Optional[ChipDeviceCtrl.ChipDeviceController] = None, node_id: Optional[int] = None, timeout: int = 900) -> CustomCommissioningParameters:
11661166
rnd_discriminator = random.randint(0, 4095)
11671167
if dev_ctrl is None:
11681168
dev_ctrl = self.default_controller
@@ -1178,14 +1178,14 @@ async def open_commissioning_window(self, dev_ctrl: Optional[ChipDeviceCtrl] = N
11781178
asserts.fail(e.status, 'Failed to open commissioning window')
11791179

11801180
async def read_single_attribute(
1181-
self, dev_ctrl: ChipDeviceCtrl, node_id: int, endpoint: int, attribute: object, fabricFiltered: bool = True) -> object:
1181+
self, dev_ctrl: ChipDeviceCtrl.ChipDeviceController, node_id: int, endpoint: int, attribute: object, fabricFiltered: bool = True) -> object:
11821182
result = await dev_ctrl.ReadAttribute(node_id, [(endpoint, attribute)], fabricFiltered=fabricFiltered)
11831183
data = result[endpoint]
11841184
return list(data.values())[0][attribute]
11851185

11861186
async def read_single_attribute_check_success(
11871187
self, cluster: Clusters.ClusterObjects.ClusterCommand, attribute: Clusters.ClusterObjects.ClusterAttributeDescriptor,
1188-
dev_ctrl: ChipDeviceCtrl = None, node_id: int = None, endpoint: int = None, fabric_filtered: bool = True, assert_on_error: bool = True, test_name: str = "") -> object:
1188+
dev_ctrl: Optional[ChipDeviceCtrl.ChipDeviceController] = None, node_id: Optional[int] = None, endpoint: Optional[int] = None, fabric_filtered: bool = True, assert_on_error: bool = True, test_name: str = "") -> object:
11891189
if dev_ctrl is None:
11901190
dev_ctrl = self.default_controller
11911191
if node_id is None:
@@ -1216,7 +1216,7 @@ async def read_single_attribute_check_success(
12161216

12171217
async def read_single_attribute_expect_error(
12181218
self, cluster: object, attribute: object,
1219-
error: Status, dev_ctrl: ChipDeviceCtrl = None, node_id: int = None, endpoint: int = None,
1219+
error: Status, dev_ctrl: Optional[ChipDeviceCtrl.ChipDeviceController] = None, node_id: Optional[int] = None, endpoint: Optional[int] = None,
12201220
fabric_filtered: bool = True, assert_on_error: bool = True, test_name: str = "") -> object:
12211221
if dev_ctrl is None:
12221222
dev_ctrl = self.default_controller
@@ -1241,7 +1241,7 @@ async def read_single_attribute_expect_error(
12411241

12421242
return attr_ret
12431243

1244-
async def write_single_attribute(self, attribute_value: object, endpoint_id: int = None, expect_success: bool = True) -> Status:
1244+
async def write_single_attribute(self, attribute_value: object, endpoint_id: Optional[int] = None, expect_success: bool = True) -> Status:
12451245
"""Write a single `attribute_value` on a given `endpoint_id` and assert on failure.
12461246
12471247
If `endpoint_id` is None, the default DUT endpoint for the test is selected.
@@ -1263,7 +1263,7 @@ async def write_single_attribute(self, attribute_value: object, endpoint_id: int
12631263

12641264
async def send_single_cmd(
12651265
self, cmd: Clusters.ClusterObjects.ClusterCommand,
1266-
dev_ctrl: ChipDeviceCtrl = None, node_id: int = None, endpoint: int = None,
1266+
dev_ctrl: Optional[ChipDeviceCtrl.ChipDeviceController] = None, node_id: Optional[int] = None, endpoint: Optional[int] = None,
12671267
timedRequestTimeoutMs: typing.Union[None, int] = None,
12681268
payloadCapability: int = ChipDeviceCtrl.TransportPayloadCapability.MRP_PAYLOAD) -> object:
12691269
if dev_ctrl is None:

0 commit comments

Comments
 (0)