Skip to content

Commit

Permalink
* [OTA] enable ota-requestor cluster in chip data model build
Browse files Browse the repository at this point in the history
* Adjust all-clusters-app and ota-requestor-app
* Adjust tests to cope with ota-provider client

Restyled by clang-format

Restyled by prettier-yaml
  • Loading branch information
tima-q committed Dec 28, 2021
1 parent 83b2f46 commit d07bf85
Show file tree
Hide file tree
Showing 22 changed files with 554 additions and 218 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1357,31 +1357,31 @@
"mfgCode": null,
"define": "OTA_PROVIDER_CLUSTER",
"side": "client",
"enabled": 0,
"enabled": 1,
"commands": [
{
"name": "QueryImage",
"code": 0,
"mfgCode": null,
"source": "client",
"incoming": 1,
"incoming": 0,
"outgoing": 1
},
{
"name": "ApplyUpdateRequest",
"code": 2,
"mfgCode": null,
"source": "client",
"incoming": 1,
"incoming": 0,
"outgoing": 1
},
{
"name": "NotifyUpdateApplied",
"code": 4,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"incoming": 0,
"outgoing": 1
}
],
"attributes": [
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion examples/all-clusters-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ list(
${chip_dir}/zzz_generated/all-clusters-app/zap-generated/CHIPClusters.cpp

${chip_dir}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp
${chip_dir}/examples/all-clusters-app/all-clusters-common/src/ota-requestor-stub.cpp
${chip_dir}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp

${chip_dir}/examples/all-clusters-app/ameba/main/chipinterface.cpp
Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ set(SRC_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/pump-configuration-and-control-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-requestor"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/src"
#${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ias-zone-client
)
Expand Down
1 change: 0 additions & 1 deletion examples/all-clusters-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import("//build_overrides/chip.gni")
executable("chip-all-clusters-app") {
sources = [
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/ota-requestor-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
"include/tv-callbacks.cpp",
"main.cpp",
Expand Down
4 changes: 3 additions & 1 deletion examples/all-clusters-app/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ target_sources(${APP_TARGET} PRIVATE
${CHIP_ROOT}/src/app/server/CommissioningWindowManager.cpp

${CHIP_ROOT}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp
${CHIP_ROOT}/examples/all-clusters-app/all-clusters-common/src/ota-requestor-stub.cpp
${CHIP_ROOT}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp

${APP_UTIL}/DataModelHandler.cpp
Expand Down Expand Up @@ -139,6 +138,9 @@ target_sources(${APP_TARGET} PRIVATE
${APP_CLUSTERS}/general-diagnostics-server/general-diagnostics-server.cpp
${APP_CLUSTERS}/group-key-mgmt-server/group-key-mgmt-server.cpp
${APP_CLUSTERS}/power-source-configuration-server/power-source-configuration-server.cpp
${APP_CLUSTERS}/ota-requestor/ota-requestor-server.cpp
${APP_CLUSTERS}/ota-requestor/BDXDownloader.cpp
${APP_CLUSTERS}/ota-requestor/OTARequestor.cpp
)

target_link_libraries(${APP_TARGET} mbed-os-posix-socket mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-emac chip)
Expand Down
1 change: 0 additions & 1 deletion examples/all-clusters-app/p6/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ p6_executable("clusters_app") {

sources = [
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/ota-requestor-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
"${examples_plat_dir}/LEDWidget.cpp",
"${examples_plat_dir}/init_p6Platform.cpp",
Expand Down
9 changes: 0 additions & 9 deletions examples/ota-requestor-app/ota-requestor-common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@ chip_data_model("ota-requestor-common") {

deps = [ "${chip_root}/src/lib" ]

sources = [
"${chip_root}/src/app/clusters/ota-requestor/BDXDownloader.cpp",
"${chip_root}/src/app/clusters/ota-requestor/BDXDownloader.h",
"${chip_root}/src/app/clusters/ota-requestor/OTARequestor.cpp",
"${chip_root}/src/app/clusters/ota-requestor/ota-requestor-server.cpp",
]

is_server = true

public_configs = [ ":config" ]

is_server = true
Expand Down
8 changes: 8 additions & 0 deletions src/app/chip_data_model.gni
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ template("chip_data_model") {
"${_app_root}/util/ContentApp.cpp",
"${_app_root}/util/ContentAppPlatform.cpp",
]
} else if (cluster == "ota-requestor") {
sources += [
# TODO - align name of folder ?
"${_app_root}/clusters/${cluster}/${cluster}-server.cpp",
"${_app_root}/clusters/${cluster}/BDXDownloader.cpp",
"${_app_root}/clusters/${cluster}/BDXDownloader.h",
"${_app_root}/clusters/${cluster}/OTARequestor.cpp",
]
} else {
sources += [ "${_app_root}/clusters/${cluster}/${cluster}.cpp" ]
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/clusters/ota-requestor/OTARequestor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ OTARequestorInterface::OTATriggerResult OTARequestor::TriggerImmediateQuery()
// Called whenever FindOrEstablishSession fails
void OTARequestor::OnConnectionFailure(void * context, PeerId peerId, CHIP_ERROR error)
{
ChipLogError(SoftwareUpdate, "Failed to connect to node 0x%" PRIX64 ": %" CHIP_ERROR_FORMAT, peerId.GetNodeId(),
error.Format());
ChipLogError(SoftwareUpdate, "Failed to connect to node 0x" ChipLogFormatX64 ": %" CHIP_ERROR_FORMAT,
ChipLogValueX64(peerId.GetNodeId()), error.Format());
}

void OTARequestor::ApplyUpdate()
Expand Down
4 changes: 3 additions & 1 deletion src/app/tests/suites/TestDescriptorCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ tests:
command: "readAttribute"
attribute: "Client List"
response:
value: []
value: [
0x0029, # OTA Software Update Provider
]

- label: "Read attribute Parts list"
command: "readAttribute"
Expand Down
2 changes: 1 addition & 1 deletion src/app/zap_cluster_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
'OPERATIONAL_CREDENTIALS_CLUSTER': ['operational-credentials-server'],
'OTA_BOOTLOAD_CLUSTER': [],
'OTA_PROVIDER_CLUSTER': ['ota-provider'],
'OTA_REQUESTOR_CLUSTER': [],
'OTA_REQUESTOR_CLUSTER': ['ota-requestor'],
'POWER_SOURCE_CLUSTER': [],
'POWER_SOURCE_CONFIGURATION_CLUSTER': ['power-source-configuration-server'],
'POLL_CONTROL_CLUSTER': [],
Expand Down
3 changes: 2 additions & 1 deletion src/darwin/Framework/CHIPTests/CHIPClustersTests.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d07bf85

Please sign in to comment.