Skip to content

Commit 0a2b2f7

Browse files
committedMar 22, 2024·
Merge branch 'master' of https://github.com/project-chip/connectedhomeip into bugfix/rs911x_ble_tx_timer_issue
2 parents 1217603 + 0f9542b commit 0a2b2f7

33 files changed

+846
-239
lines changed
 

‎.github/workflows/bloat_check.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ jobs:
5050
--github-limit-artifacts 500 \
5151
--github-limit-comments 20 \
5252
--github-repository project-chip/connectedhomeip \
53-
--github-api-token "${{ secrets.BLOAT_REPORT }}"
53+
--github-api-token "${{ secrets.GITHUB_TOKEN }}"

‎.github/workflows/lint.yml

-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ jobs:
117117
--known-failure app/util/generic-callbacks.h \
118118
--known-failure app/util/generic-callback-stubs.cpp \
119119
--known-failure app/util/im-client-callbacks.h \
120-
--known-failure app/util/MatterCallbacks.h \
121120
--known-failure app/util/util.cpp \
122121
--known-failure app/util/util.h \
123122
--known-failure app/WriteHandler.h \

‎examples/light-switch-app/silabs/include/ShellCommands.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121

2222
#if defined(ENABLE_CHIP_SHELL)
2323

24-
namespace LightSwtichCommands {
24+
namespace LightSwitchCommands {
2525

2626
void RegisterSwitchCommands();
2727

28-
} // namespace LightSwtichCommands
28+
} // namespace LightSwitchCommands
2929

3030
#endif // defined(ENABLE_CHIP_SHELL)

‎examples/light-switch-app/silabs/src/LightSwitchMgr.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ CHIP_ERROR LightSwitchMgr::Init(EndpointId lightSwitchEndpoint, chip::EndpointId
6262
}
6363

6464
#if defined(ENABLE_CHIP_SHELL)
65-
LightSwtichCommands::RegisterSwitchCommands();
65+
LightSwitchCommands::RegisterSwitchCommands();
6666
#endif // defined(ENABLE_CHIP_SHELL)
6767

6868
return error;

‎examples/light-switch-app/silabs/src/ShellCommands.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
using namespace chip;
3030
using namespace chip::app;
3131

32-
namespace LightSwtichCommands {
32+
namespace LightSwitchCommands {
3333

3434
using Shell::Engine;
3535
using Shell::shell_command_t;
@@ -286,6 +286,6 @@ void RegisterSwitchCommands()
286286
Engine::Root().RegisterCommands(&sSwitchCommand, 1);
287287
}
288288

289-
} // namespace LightSwtichCommands
289+
} // namespace LightSwitchCommands
290290

291291
#endif // ENABLE_CHIP_SHELL

‎integrations/cloudbuild/build-all.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ steps:
66
- "--init"
77
- "--recursive"
88
id: Submodules
9-
- name: "ghcr.io/project-chip/chip-build-vscode:36"
9+
- name: "ghcr.io/project-chip/chip-build-vscode:41"
1010
env:
1111
- PW_ENVIRONMENT_ROOT=/pwenv
1212
args:
@@ -21,7 +21,7 @@ steps:
2121
path: /pwenv
2222
timeout: 900s
2323

24-
- name: "ghcr.io/project-chip/chip-build-vscode:36"
24+
- name: "ghcr.io/project-chip/chip-build-vscode:41"
2525
env:
2626
- PW_ENVIRONMENT_ROOT=/pwenv
2727
args:
@@ -85,7 +85,7 @@ steps:
8585
--target k32w-shell
8686
build
8787
--create-archives /workspace/artifacts/
88-
- name: "ghcr.io/project-chip/chip-build-vscode:36"
88+
- name: "ghcr.io/project-chip/chip-build-vscode:41"
8989
env:
9090
- PW_ENVIRONMENT_ROOT=/pwenv
9191
args:

‎integrations/cloudbuild/chef.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
steps:
2-
- name: "ghcr.io/project-chip/chip-build-vscode:35"
2+
- name: "ghcr.io/project-chip/chip-build-vscode:41"
33
env:
44
- PW_ENVIRONMENT_ROOT=/pwenv
55
args:
@@ -12,7 +12,7 @@ steps:
1212
path: /pwenv
1313
timeout: 2700s
1414

15-
- name: "ghcr.io/project-chip/chip-build-vscode:35"
15+
- name: "ghcr.io/project-chip/chip-build-vscode:41"
1616
env:
1717
- PW_ENVIRONMENT_ROOT=/pwenv
1818
args:
@@ -27,7 +27,7 @@ steps:
2727
- name: pwenv
2828
path: /pwenv
2929

30-
- name: "ghcr.io/project-chip/chip-build-vscode:35"
30+
- name: "ghcr.io/project-chip/chip-build-vscode:41"
3131
env:
3232
- PW_ENVIRONMENT_ROOT=/pwenv
3333
args:

‎integrations/cloudbuild/smoke-test.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
steps:
2-
- name: "ghcr.io/project-chip/chip-build-vscode:36"
2+
- name: "ghcr.io/project-chip/chip-build-vscode:41"
33
entrypoint: "bash"
44
args:
55
- "-c"
66
- |
77
git config --global --add safe.directory "*"
88
git submodule update --init --recursive
99
id: Submodules
10-
- name: "ghcr.io/project-chip/chip-build-vscode:36"
10+
- name: "ghcr.io/project-chip/chip-build-vscode:41"
1111
env:
1212
- PW_ENVIRONMENT_ROOT=/pwenv
1313
args:
@@ -22,7 +22,7 @@ steps:
2222
path: /pwenv
2323
timeout: 900s
2424

25-
- name: "ghcr.io/project-chip/chip-build-vscode:36"
25+
- name: "ghcr.io/project-chip/chip-build-vscode:41"
2626
id: ESP32
2727
env:
2828
- PW_ENVIRONMENT_ROOT=/pwenv
@@ -43,7 +43,7 @@ steps:
4343
volumes:
4444
- name: pwenv
4545
path: /pwenv
46-
- name: "ghcr.io/project-chip/chip-build-vscode:36"
46+
- name: "ghcr.io/project-chip/chip-build-vscode:41"
4747
id: NRFConnect
4848
env:
4949
- PW_ENVIRONMENT_ROOT=/pwenv
@@ -64,7 +64,7 @@ steps:
6464
- name: pwenv
6565
path: /pwenv
6666

67-
- name: "ghcr.io/project-chip/chip-build-vscode:36"
67+
- name: "ghcr.io/project-chip/chip-build-vscode:41"
6868
id: EFR32
6969
env:
7070
- PW_ENVIRONMENT_ROOT=/pwenv
@@ -86,7 +86,7 @@ steps:
8686
- name: pwenv
8787
path: /pwenv
8888

89-
- name: "ghcr.io/project-chip/chip-build-vscode:36"
89+
- name: "ghcr.io/project-chip/chip-build-vscode:41"
9090
id: Linux
9191
env:
9292
- PW_ENVIRONMENT_ROOT=/pwenv
@@ -139,7 +139,7 @@ steps:
139139
- name: pwenv
140140
path: /pwenv
141141

142-
- name: "ghcr.io/project-chip/chip-build-vscode:36"
142+
- name: "ghcr.io/project-chip/chip-build-vscode:41"
143143
id: Android
144144
env:
145145
- PW_ENVIRONMENT_ROOT=/pwenv
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
41 : [nrfconnect] Update nRF Connect SDK version.
1+
42 : [Ameba] Update Ameba System time

‎integrations/docker/images/stage-2/chip-build-ameba/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LABEL org.opencontainers.image.source https://github.com/project-chip/connectedh
44

55
# Setup Ameba
66
ARG AMEBA_DIR=/opt/ameba
7-
ARG TAG_NAME=ameba_update_2023_12_15
7+
ARG TAG_NAME=ameba_update_2024_03_22
88
RUN set -x \
99
&& apt-get update \
1010
&& mkdir ${AMEBA_DIR} \

‎scripts/setup/constraints.txt

+7
Original file line numberDiff line numberDiff line change
@@ -290,3 +290,10 @@ setuptools==68.0.0
290290
# via
291291
# pip-tools
292292
# west
293+
294+
# Manual edits:
295+
296+
# Higher versions depend on proto-plus, which break
297+
# nanopb code generation (due to name conflict of the 'proto' module)
298+
google-api-core==2.17.0
299+

‎scripts/tools/memory/memdf/util/github.py

+26-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import itertools
1919
import logging
2020
import os
21+
import subprocess
2122
from typing import Iterable, Mapping, Optional
2223

2324
import dateutil # type: ignore
@@ -173,7 +174,31 @@ def download_artifact(self, artifact_id: int):
173174
logging.debug('Downloading artifact %d', artifact_id)
174175
try:
175176
assert self.ghapi
176-
return self.ghapi.actions.download_artifact(artifact_id, 'zip')
177+
178+
# It seems like github artifact download is at least partially broken
179+
# (see https://github.com/project-chip/connectedhomeip/issues/32656)
180+
#
181+
# This makes `self.ghapi.actions.download_artifact` not work
182+
#
183+
# Oddly enough downloading via CURL seems ok
184+
owner = self.config['github.owner']
185+
repo = self.config['github.repo']
186+
token = self.config['github.token']
187+
188+
download_url = f"https://api.github.com/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/zip"
189+
190+
# Follow https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#download-an-artifact
191+
return subprocess.check_output(
192+
[
193+
'curl',
194+
'-L',
195+
'-H', 'Accept: application/vnd.github+json',
196+
'-H', f'Authorization: Bearer {token}',
197+
'-H', 'X-GitHub-Api-Version: 2022-11-28',
198+
'--output', '-',
199+
download_url
200+
]
201+
)
177202
except Exception as e:
178203
logging.error('Failed to download artifact %d: %s', artifact_id, e)
179204
return None

‎src/app/BUILD.gn

+2
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ static_library("interaction-model") {
210210
"${chip_root}/src/app/icd/server:icd-server-config",
211211
"${chip_root}/src/app/icd/server:observer",
212212
"${chip_root}/src/app/util:af-types",
213+
"${chip_root}/src/app/util:callbacks",
213214
"${chip_root}/src/lib/address_resolve",
214215
"${chip_root}/src/lib/support",
215216
"${chip_root}/src/lib/support:static-support",
@@ -318,6 +319,7 @@ static_library("app") {
318319
":interaction-model",
319320
"${chip_root}/src/app/data-model",
320321
"${chip_root}/src/app/icd/server:icd-server-config",
322+
"${chip_root}/src/app/util:callbacks",
321323
"${chip_root}/src/lib/address_resolve",
322324
"${chip_root}/src/lib/support",
323325
"${chip_root}/src/messaging",

‎src/app/CommandHandler.cpp

+4-13
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,9 @@ Status CommandHandler::ProcessCommandDataIB(CommandDataIB::Parser & aCommandElem
449449
{
450450
ChipLogDetail(DataManagement, "Received command for Endpoint=%u Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI,
451451
concretePath.mEndpointId, ChipLogValueMEI(concretePath.mClusterId), ChipLogValueMEI(concretePath.mCommandId));
452-
SuccessOrExit(err = MatterPreCommandReceivedCallback(concretePath, GetSubjectDescriptor()));
452+
SuccessOrExit(err = DataModelCallbacks::GetInstance()->PreCommandReceived(concretePath, GetSubjectDescriptor()));
453453
mpCallback->DispatchCommand(*this, concretePath, commandDataReader);
454-
MatterPostCommandReceivedCallback(concretePath, GetSubjectDescriptor());
454+
DataModelCallbacks::GetInstance()->PostCommandReceived(concretePath, GetSubjectDescriptor());
455455
}
456456

457457
exit:
@@ -555,11 +555,11 @@ Status CommandHandler::ProcessGroupCommandDataIB(CommandDataIB::Parser & aComman
555555
continue;
556556
}
557557
}
558-
if ((err = MatterPreCommandReceivedCallback(concretePath, GetSubjectDescriptor())) == CHIP_NO_ERROR)
558+
if ((err = DataModelCallbacks::GetInstance()->PreCommandReceived(concretePath, GetSubjectDescriptor())) == CHIP_NO_ERROR)
559559
{
560560
TLV::TLVReader dataReader(commandDataReader);
561561
mpCallback->DispatchCommand(*this, concretePath, dataReader);
562-
MatterPostCommandReceivedCallback(concretePath, GetSubjectDescriptor());
562+
DataModelCallbacks::GetInstance()->PostCommandReceived(concretePath, GetSubjectDescriptor());
563563
}
564564
else
565565
{
@@ -1053,12 +1053,3 @@ void CommandHandler::TestOnlyInvokeCommandRequestWithFaultsInjected(Messaging::E
10531053

10541054
} // namespace app
10551055
} // namespace chip
1056-
1057-
CHIP_ERROR __attribute__((weak)) MatterPreCommandReceivedCallback(const chip::app::ConcreteCommandPath & commandPath,
1058-
const chip::Access::SubjectDescriptor & subjectDescriptor)
1059-
{
1060-
return CHIP_NO_ERROR;
1061-
}
1062-
void __attribute__((weak)) MatterPostCommandReceivedCallback(const chip::app::ConcreteCommandPath & commandPath,
1063-
const chip::Access::SubjectDescriptor & subjectDescriptor)
1064-
{}

‎src/app/ConcreteAttributePath.h

+9-3
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,15 @@ struct ConcreteDataAttributePath : public ConcreteAttributePath
144144

145145
bool MatchesConcreteAttributePath(const ConcreteAttributePath & aOther) { return ConcreteAttributePath::operator==(aOther); }
146146

147-
bool operator==(const ConcreteDataAttributePath & aOther) const = delete;
148-
bool operator!=(const ConcreteDataAttributePath & aOther) const = delete;
149-
bool operator<(const ConcreteDataAttributePath & aOther) const = delete;
147+
bool operator==(const ConcreteDataAttributePath & aOther) const
148+
{
149+
return ConcreteAttributePath::operator==(aOther) && (mListIndex == aOther.mListIndex) && (mListOp == aOther.mListOp) &&
150+
(mDataVersion == aOther.mDataVersion);
151+
}
152+
153+
bool operator!=(const ConcreteDataAttributePath & aOther) const { return !(*this == aOther); }
154+
155+
bool operator<(const ConcreteDataAttributePath & aOther) const = delete;
150156

151157
//
152158
// This index is only valid if `mListOp` is set to a list item operation, i.e

‎src/app/WriteHandler.cpp

+10-7
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,9 @@ CHIP_ERROR WriteHandler::ProcessAttributeDataIBs(TLV::TLVReader & aAttributeData
328328
mProcessingAttributeIsList = dataAttributePath.IsListOperation();
329329
mProcessingAttributePath.SetValue(dataAttributePath);
330330

331-
MatterPreAttributeWriteCallback(dataAttributePath);
331+
DataModelCallbacks::GetInstance()->AttributeOperation(DataModelCallbacks::OperationType::Write,
332+
DataModelCallbacks::OperationOrder::Pre, dataAttributePath);
333+
332334
TLV::TLVWriter backup;
333335
DataVersion version = 0;
334336
mWriteResponseBuilder.GetWriteResponses().Checkpoint(backup);
@@ -348,7 +350,9 @@ CHIP_ERROR WriteHandler::ProcessAttributeDataIBs(TLV::TLVReader & aAttributeData
348350
mWriteResponseBuilder.GetWriteResponses().Rollback(backup);
349351
err = AddStatus(dataAttributePath, StatusIB(err));
350352
}
351-
MatterPostAttributeWriteCallback(dataAttributePath);
353+
354+
DataModelCallbacks::GetInstance()->AttributeOperation(DataModelCallbacks::OperationType::Write,
355+
DataModelCallbacks::OperationOrder::Post, dataAttributePath);
352356
SuccessOrExit(err);
353357
}
354358

@@ -482,7 +486,8 @@ CHIP_ERROR WriteHandler::ProcessGroupAttributeDataIBs(TLV::TLVReader & aAttribut
482486

483487
chip::TLV::TLVReader tmpDataReader(dataReader);
484488

485-
MatterPreAttributeWriteCallback(dataAttributePath);
489+
DataModelCallbacks::GetInstance()->AttributeOperation(DataModelCallbacks::OperationType::Write,
490+
DataModelCallbacks::OperationOrder::Pre, dataAttributePath);
486491
err = WriteSingleClusterData(subjectDescriptor, dataAttributePath, tmpDataReader, this);
487492

488493
if (err != CHIP_NO_ERROR)
@@ -493,7 +498,8 @@ CHIP_ERROR WriteHandler::ProcessGroupAttributeDataIBs(TLV::TLVReader & aAttribut
493498
mapping.endpoint_id, ChipLogValueMEI(dataAttributePath.mClusterId),
494499
ChipLogValueMEI(dataAttributePath.mAttributeId), err.Format());
495500
}
496-
MatterPostAttributeWriteCallback(dataAttributePath);
501+
DataModelCallbacks::GetInstance()->AttributeOperation(DataModelCallbacks::OperationType::Write,
502+
DataModelCallbacks::OperationOrder::Post, dataAttributePath);
497503
}
498504

499505
dataAttributePath.mEndpointId = kInvalidEndpointId;
@@ -677,6 +683,3 @@ void WriteHandler::MoveToState(const State aTargetState)
677683

678684
} // namespace app
679685
} // namespace chip
680-
681-
void __attribute__((weak)) MatterPreAttributeWriteCallback(const chip::app::ConcreteAttributePath & attributePath) {}
682-
void __attribute__((weak)) MatterPostAttributeWriteCallback(const chip::app::ConcreteAttributePath & attributePath) {}

‎src/app/reporting/Engine.cpp

+8-5
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,15 @@ Engine::RetrieveClusterData(const SubjectDescriptor & aSubjectDescriptor, bool a
8686
{
8787
ChipLogDetail(DataManagement, "<RE:Run> Cluster %" PRIx32 ", Attribute %" PRIx32 " is dirty", aPath.mClusterId,
8888
aPath.mAttributeId);
89-
MatterPreAttributeReadCallback(aPath);
89+
90+
DataModelCallbacks::GetInstance()->AttributeOperation(DataModelCallbacks::OperationType::Read,
91+
DataModelCallbacks::OperationOrder::Pre, aPath);
92+
9093
ReturnErrorOnFailure(ReadSingleClusterData(aSubjectDescriptor, aIsFabricFiltered, aPath, aAttributeReportIBs, aEncoderState));
91-
MatterPostAttributeReadCallback(aPath);
94+
95+
DataModelCallbacks::GetInstance()->AttributeOperation(DataModelCallbacks::OperationType::Read,
96+
DataModelCallbacks::OperationOrder::Post, aPath);
97+
9298
return CHIP_NO_ERROR;
9399
}
94100

@@ -996,9 +1002,6 @@ void Engine::ScheduleUrgentEventDeliverySync(Optional<FabricIndex> fabricIndex)
9961002
} // namespace app
9971003
} // namespace chip
9981004

999-
void __attribute__((weak)) MatterPreAttributeReadCallback(const chip::app::ConcreteAttributePath & attributePath) {}
1000-
void __attribute__((weak)) MatterPostAttributeReadCallback(const chip::app::ConcreteAttributePath & attributePath) {}
1001-
10021005
// TODO: MatterReportingAttributeChangeCallback should just live in libCHIP,
10031006
// instead of being in ember-compatibility-functions. It does not depend on any
10041007
// app-specific generated bits.

0 commit comments

Comments
 (0)
Please sign in to comment.