Skip to content

Commit b3a10cf

Browse files
committed
Merge remote-tracking branch 'upstream/master' into context_static_setup
2 parents 0ae4488 + 3219a5f commit b3a10cf

File tree

230 files changed

+20576
-10448
lines changed

Some content is hidden

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

230 files changed

+20576
-10448
lines changed

.github/.wordlist.txt

+1
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,7 @@ NTP
965965
nullable
966966
nullptr
967967
NUM
968+
NuttX
968969
NVM
969970
NVS
970971
nwdiag

.github/workflows/examples-linux-standalone.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,16 @@ jobs:
198198
linux debug air-purifier-app \
199199
out/linux-x64-air-purifier/chip-air-purifier-app \
200200
/tmp/bloat_reports/
201+
- name: Build example Fabric Bridge App
202+
run: |
203+
./scripts/run_in_build_env.sh \
204+
"./scripts/build/build_examples.py \
205+
--target linux-x64-fabric-bridge \
206+
build"
207+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
208+
linux debug fabric-bridge-app \
209+
out/linux-x64-fabric-bridge/fabric-bridge-app \
210+
/tmp/bloat_reports/
201211
- name: Uploading Size Reports
202212
uses: ./.github/actions/upload-size-reports
203213
if: ${{ !env.ACT }}

.github/workflows/examples-nuttx.yaml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright (c) 2024 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Build example - NuttX
16+
17+
on:
18+
push:
19+
pull_request:
20+
merge_group:
21+
workflow_dispatch:
22+
23+
concurrency:
24+
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
25+
cancel-in-progress: true
26+
27+
env:
28+
CHIP_NO_LOG_TIMESTAMPS: true
29+
30+
jobs:
31+
nuttx:
32+
name: NuttX
33+
34+
runs-on: ubuntu-latest
35+
if: github.actor != 'restyled-io[bot]'
36+
37+
container:
38+
image: ghcr.io/project-chip/chip-build-nuttx:51
39+
volumes:
40+
- "/tmp/bloat_reports:/tmp/bloat_reports"
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
- name: Checkout submodules & Bootstrap
45+
uses: ./.github/actions/checkout-submodules-and-bootstrap
46+
with:
47+
platform: nuttx
48+
extra-submodule-parameters: " --recursive"
49+
- name: Build example simulator NuttX Lighting App
50+
run: |
51+
./scripts/run_in_build_env.sh \
52+
"./scripts/build/build_examples.py \
53+
--target nuttx-x64-light \
54+
build \
55+
"

.github/workflows/lint.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ jobs:
9090
--skip-dir platform/webos \
9191
--skip-dir platform/Zephyr \
9292
--skip-dir test_driver \
93+
--skip-dir platform/NuttX \
9394
--known-failure app/app-platform/ContentApp.cpp \
9495
--known-failure app/app-platform/ContentApp.h \
9596
--known-failure app/app-platform/ContentAppPlatform.cpp \
@@ -118,6 +119,10 @@ jobs:
118119
--known-failure app/util/DataModelHandler.h \
119120
--known-failure app/util/ember-compatibility-functions.cpp \
120121
--known-failure app/util/ember-compatibility-functions.h \
122+
--known-failure app/util/ember-global-attribute-access-interface.cpp \
123+
--known-failure app/util/ember-global-attribute-access-interface.h \
124+
--known-failure app/util/ember-io-storage.cpp \
125+
--known-failure app/util/ember-io-storage.h \
121126
--known-failure app/util/endpoint-config-api.h \
122127
--known-failure app/util/generic-callbacks.h \
123128
--known-failure app/util/generic-callback-stubs.cpp \
@@ -205,7 +210,7 @@ jobs:
205210
# TODO: TLVDebug should ideally not be excluded here.
206211
# TODO: protocol_decoder.cpp should ideally not be excluded here.
207212
# TODO: PersistentStorageMacros.h should ideally not be excluded here.
208-
git grep -I -n "PRI.64" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)examples/chip-tool' ':(exclude)examples/tv-casting-app' ':(exclude)src/app/MessageDef/MessageDefHelper.cpp' ':(exclude)src/app/tests/integration/chip_im_initiator.cpp' ':(exclude)src/lib/core/TLVDebug.cpp' ':(exclude)src/lib/dnssd/tests/TestTxtFields.cpp' ':(exclude)src/lib/format/protocol_decoder.cpp' ':(exclude)src/lib/support/PersistentStorageMacros.h' ':(exclude)src/messaging/tests/echo/echo_requester.cpp' ':(exclude)src/platform/Linux' ':(exclude)src/platform/Ameba' ':(exclude)src/platform/ESP32' ':(exclude)src/platform/Darwin' ':(exclude)src/darwin' ':(exclude)src/platform/webos' ':(exclude)zzz_generated/chip-tool' ':(exclude)src/tools/chip-cert/Cmd_PrintCert.cpp' && exit 1 || exit 0
213+
git grep -I -n "PRI.64" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)examples/chip-tool' ':(exclude)examples/tv-casting-app' ':(exclude)src/app/MessageDef/MessageDefHelper.cpp' ':(exclude)src/app/tests/integration/chip_im_initiator.cpp' ':(exclude)src/lib/core/TLVDebug.cpp' ':(exclude)src/lib/dnssd/tests/TestTxtFields.cpp' ':(exclude)src/lib/format/protocol_decoder.cpp' ':(exclude)src/lib/support/PersistentStorageMacros.h' ':(exclude)src/messaging/tests/echo/echo_requester.cpp' ':(exclude)src/platform/Linux' ':(exclude)src/platform/Ameba' ':(exclude)src/platform/ESP32' ':(exclude)src/platform/Darwin' ':(exclude)src/darwin' ':(exclude)src/platform/webos' ':(exclude)zzz_generated/chip-tool' ':(exclude)src/tools/chip-cert/Cmd_PrintCert.cpp' ':(exclude)src/platform/NuttX' && exit 1 || exit 0
209214
210215
# git grep exits with 0 if it finds a match, but we want
211216
# to fail (exit nonzero) on match. And we want to exclude this file,
@@ -242,7 +247,7 @@ jobs:
242247
output.
243248
if: always()
244249
run: |
245-
git grep -I -n '0x%[0-9l.-]*[^0-9lxX".-]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
250+
git grep -I -n '0x%[0-9l.*-]*[^xX"0-9l.*-]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
246251
247252
# git grep exits with 0 if it finds a match, but we want
248253
# to fail (exit nonzero) on match. And we want to exclude this file,

.vscode/settings.json

+13-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,18 @@
1414
"${workspaceFolder}/src/lib/**",
1515
"${workspaceFolder}/src/system/**",
1616
"${workspaceFolder}/third_party/nlassert/repo/include/**",
17-
"${workspaceFolder}/third_party/nlio/repo/include/**"
17+
"${workspaceFolder}/third_party/nlio/repo/include/**",
18+
"${workspaceFolder}/darwin/Framework/CHIP/**",
19+
"${workspaceFolder}/src/messaging/**",
20+
"${workspaceFolder}/src/protocols/**",
21+
"${workspaceFolder}/src/tracing/**",
22+
"${workspaceFolder}/src/transport/**",
23+
"${workspaceFolder}/src/inet/**",
24+
"${workspaceFolder}/src/credentials/**",
25+
"${workspaceFolder}/src/data_model/**",
26+
"${workspaceFolder}/src/app/**",
27+
"${workspaceFolder}/src/crytpo/**",
28+
"${workspaceFolder}/src/platform/**"
1829
],
1930
"[cpp]": {
2031
"editor.defaultFormatter": "xaver.clang-format"
@@ -35,6 +46,7 @@
3546
"editor.defaultFormatter": "esbenp.prettier-vscode"
3647
},
3748
"files.associations": {
49+
"*.mm": "cpp",
3850
"iostream": "cpp",
3951
"array": "cpp",
4052
"atomic": "cpp",

build/config/compiler/BUILD.gn

+5
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ config("strict_warnings") {
271271

272272
cflags_cc = [ "-Wnon-virtual-dtor" ]
273273

274+
if (current_os == "nuttx") {
275+
cflags -= [ "-Wshadow" ]
276+
cflags_cc -= [ "-Wnon-virtual-dtor" ]
277+
}
278+
274279
configs = []
275280
ldflags = []
276281

config/nuttx/chip-gn/.gn

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) 2024 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import("//build_overrides/build.gni")
16+
import("//build_overrides/chip.gni")
17+
18+
# The location of the build configuration file.
19+
buildconfig = "${build_root}/config/BUILDCONFIG.gn"
20+
21+
# CHIP uses angle bracket includes.
22+
check_system_includes = true
23+
24+
default_args = {
25+
target_cpu = ""
26+
target_os = "nuttx"
27+
28+
import("${chip_root}/config/nuttx/chip-gn/args.gni")
29+
}

config/nuttx/chip-gn/BUILD.gn

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Copyright (c) 2024 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import("//build_overrides/build.gni")
16+
import("//build_overrides/chip.gni")
17+
18+
import("${chip_root}/build/chip/tests.gni")
19+
20+
assert(current_os == "nuttx")
21+
22+
declare_args() {
23+
chip_build_example_providers = false
24+
chip_example_lighting = false
25+
}
26+
27+
static_library("nuttx") {
28+
output_name = "libchipnuttx"
29+
30+
public_deps = [
31+
"${chip_root}/examples/platform/linux:app-main",
32+
"${chip_root}/src/lib",
33+
]
34+
35+
if (chip_build_tests) {
36+
public_deps += [ "${chip_root}/src:tests" ]
37+
}
38+
39+
if (chip_build_example_providers) {
40+
public_deps += [ "${chip_root}/examples/providers:device_info_provider" ]
41+
}
42+
43+
if (chip_example_lighting) {
44+
public_deps += [
45+
"${chip_root}/examples/lighting-app/lighting-common",
46+
"${chip_root}/examples/lighting-app/lighting-common:lighting-manager",
47+
]
48+
}
49+
50+
output_dir = "${root_out_dir}/lib"
51+
52+
complete_static_lib = true
53+
}
54+
55+
group("default") {
56+
deps = [ ":nuttx" ]
57+
}

config/nuttx/chip-gn/args.gni

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright (c) 2024 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import("//build_overrides/chip.gni")
16+
17+
import("${chip_root}/src/crypto/crypto.gni")
18+
19+
chip_device_platform = "nuttx"
20+
21+
chip_build_tests = false
22+
23+
chip_project_config_include = ""
24+
chip_system_project_config_include = ""
25+
chip_ble_project_config_include = ""
26+
27+
chip_crypto = "mbedtls"
28+
chip_external_mbedtls = true
29+
30+
custom_toolchain = "${chip_root}/config/nuttx/chip-gn/toolchain:nuttx"
31+
32+
pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/setup/constraints.txt" ]
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright (c) 2024 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import("//build/toolchain/gcc_toolchain.gni")
16+
import("//build_overrides/build.gni")
17+
18+
declare_args() {
19+
nuttx_ar = ""
20+
nuttx_cc = ""
21+
nuttx_cxx = ""
22+
}
23+
24+
gcc_toolchain("nuttx") {
25+
ar = nuttx_ar
26+
cc = nuttx_cc
27+
cxx = nuttx_cxx
28+
29+
toolchain_args = {
30+
current_os = "nuttx"
31+
is_clang = false
32+
}
33+
}

docs/ERROR_CODES.md

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ This file was **AUTOMATICALLY** generated by
4747
| 29 | 0x1D | `CHIP_ERROR_INVALID_IPK` |
4848
| 30 | 0x1E | `CHIP_ERROR_INVALID_STRING_LENGTH` |
4949
| 31 | 0x1F | `CHIP_ERROR_INVALID_LIST_LENGTH` |
50+
| 32 | 0x20 | `CHIP_ERROR_FAILED_DEVICE_ATTESTATION` |
5051
| 33 | 0x21 | `CHIP_ERROR_END_OF_TLV` |
5152
| 34 | 0x22 | `CHIP_ERROR_TLV_UNDERRUN` |
5253
| 35 | 0x23 | `CHIP_ERROR_INVALID_TLV_ELEMENT` |

examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/CHIPToolActivity.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class CHIPToolActivity :
122122
startActivity(redirectIntent)
123123
}
124124

125-
override fun SetNetworkType(type: ProvisionNetworkType) {
125+
override fun setNetworkType(type: ProvisionNetworkType?) {
126126
networkType = type
127127
}
128128

examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/SelectActionFragment.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class SelectActionFragment : Fragment() {
154154
/** Notifies listener of a click to manually input the CHIP device address. */
155155
fun onShowDeviceAddressInput()
156156

157-
fun SetNetworkType(type: ProvisionNetworkType)
157+
fun setNetworkType(type: ProvisionNetworkType?)
158158
}
159159

160160
private fun showFragment(fragment: Fragment, showOnBack: Boolean = true) {
@@ -172,6 +172,7 @@ class SelectActionFragment : Fragment() {
172172

173173
/** Notifies listener of Scan QR code button click. */
174174
private fun handleScanQrCodeClicked() {
175+
getCallback()?.setNetworkType(null)
175176
showFragment(BarcodeFragment.newInstance())
176177
}
177178

@@ -226,13 +227,13 @@ class SelectActionFragment : Fragment() {
226227

227228
/** Notifies listener of provision-WiFi-credentials button click. */
228229
private fun handleProvisionWiFiCredentialsClicked() {
229-
getCallback()?.SetNetworkType(ProvisionNetworkType.WIFI)
230+
getCallback()?.setNetworkType(ProvisionNetworkType.WIFI)
230231
showFragment(BarcodeFragment.newInstance())
231232
}
232233

233234
/** Notifies listener of provision-Thread-credentials button click. */
234235
private fun handleProvisionThreadCredentialsClicked() {
235-
getCallback()?.SetNetworkType(ProvisionNetworkType.THREAD)
236+
getCallback()?.setNetworkType(ProvisionNetworkType.THREAD)
236237
showFragment(BarcodeFragment.newInstance())
237238
}
238239

0 commit comments

Comments
 (0)