From 946a9f29cbf5146fdc6a28e5da7bda1a28c21839 Mon Sep 17 00:00:00 2001 From: Trevor Holbrook Date: Tue, 29 Jun 2021 20:13:16 -0700 Subject: [PATCH] Rename OTA Server -> OTA Provider and OTA Client -> OTA Requestor (#7920) --- .../all-clusters-common/all-clusters-app.zap | 26 ++--- .../gen/IMClusterCommandHandler.cpp | 31 +++--- .../all-clusters-common/gen/callback-stub.cpp | 6 +- .../all-clusters-common/gen/callback.h | 63 +++++++------ .../all-clusters-common/gen/endpoint_config.h | 8 +- .../all-clusters-common/gen/gen_config.h | 10 +- .../esp32/main/CMakeLists.txt | 2 +- .../chip-tool/commands/clusters/Commands.h | 94 +++++++++---------- .../tv-common/gen/IMClusterCommandHandler.cpp | 31 +++--- .../tv-app/tv-common/gen/callback-stub.cpp | 6 +- examples/tv-app/tv-common/gen/callback.h | 63 +++++++------ .../tv-app/tv-common/gen/endpoint_config.h | 8 +- examples/tv-app/tv-common/gen/gen_config.h | 10 +- examples/tv-app/tv-common/tv-app.zap | 8 +- .../ota-provider-delegate.h} | 8 +- .../ota-provider.cpp} | 88 ++++++++--------- .../ota-provider.h} | 6 +- src/app/common/gen/attribute-id.h | 6 +- src/app/common/gen/client-command-macro.h | 34 +++---- src/app/common/gen/cluster-id.h | 8 +- src/app/common/gen/command-id.h | 6 +- src/app/common/gen/print-cluster.h | 16 ++-- src/app/util/process-cluster-message.cpp | 4 +- .../zcl/data-model/chip/chip-ota.xml | 22 ++--- src/app/zap_cluster_list.py | 8 +- .../data_model/controller-clusters.zap | 8 +- .../data_model/gen/CHIPClientCallbacks.cpp | 29 +++--- .../data_model/gen/CHIPClientCallbacks.h | 12 +-- .../data_model/gen/CHIPClusters.cpp | 45 ++++----- src/controller/data_model/gen/CHIPClusters.h | 12 +-- .../gen/IMClusterCommandHandler.cpp | 26 ++--- .../data_model/gen/call-command-handler.cpp | 21 +++-- .../data_model/gen/callback-stub.cpp | 6 +- src/controller/data_model/gen/callback.h | 62 ++++++------ .../data_model/gen/chip-zcl-zpro-codec-api.h | 15 +-- src/controller/data_model/gen/encoder.cpp | 15 +-- .../data_model/gen/endpoint_config.h | 6 +- src/controller/data_model/gen/gen_config.h | 8 +- src/controller/java/gen/CHIPClusters-JNI.cpp | 84 ++++++++--------- src/controller/java/gen/ChipClusters.java | 18 ++-- .../python/chip/clusters/CHIPClusters.cpp | 42 ++++----- .../python/chip/clusters/CHIPClusters.py | 52 +++++----- .../Framework/CHIP/gen/CHIPClustersObjc.h | 22 ++--- .../Framework/CHIP/gen/CHIPClustersObjc.mm | 66 ++++++------- src/darwin/Framework/CHIP/templates/helper.js | 2 +- .../Framework/CHIPTests/CHIPClustersTests.m | 8 +- 46 files changed, 571 insertions(+), 560 deletions(-) rename src/app/clusters/{ota-server/ota-server-delegate.h => ota-provider/ota-provider-delegate.h} (91%) rename src/app/clusters/{ota-server/ota-server.cpp => ota-provider/ota-provider.cpp} (64%) rename src/app/clusters/{ota-server/ota-server.h => ota-provider/ota-provider.h} (85%) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 36a911c2ec4777..2c30d594e95359 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -1204,10 +1204,10 @@ ] }, { - "name": "OTA Software Update Server", + "name": "OTA Software Update Provider", "code": 41, "mfgCode": null, - "define": "OTA_SERVER_CLUSTER", + "define": "OTA_PROVIDER_CLUSTER", "side": "client", "enabled": 0, "commands": [ @@ -1255,10 +1255,10 @@ ] }, { - "name": "OTA Software Update Server", + "name": "OTA Software Update Provider", "code": 41, "mfgCode": null, - "define": "OTA_SERVER_CLUSTER", + "define": "OTA_PROVIDER_CLUSTER", "side": "server", "enabled": 1, "commands": [ @@ -7204,10 +7204,10 @@ ] }, { - "name": "OTA Software Update Server", + "name": "OTA Software Update Provider", "code": 41, "mfgCode": null, - "define": "OTA_SERVER_CLUSTER", + "define": "OTA_PROVIDER_CLUSTER", "side": "client", "enabled": 0, "commands": [ @@ -7255,10 +7255,10 @@ ] }, { - "name": "OTA Software Update Server", + "name": "OTA Software Update Provider", "code": 41, "mfgCode": null, - "define": "OTA_SERVER_CLUSTER", + "define": "OTA_PROVIDER_CLUSTER", "side": "server", "enabled": 0, "commands": [ @@ -7298,16 +7298,16 @@ ] }, { - "name": "OTA Software Update Client", + "name": "OTA Software Update Requestor", "code": 42, "mfgCode": null, - "define": "OTA_CLIENT_CLUSTER", + "define": "OTA_REQUESTOR_CLUSTER", "side": "client", "enabled": 0, "commands": [], "attributes": [ { - "name": "default ota server", + "name": "default ota provider", "code": 0, "mfgCode": null, "side": "client", @@ -7354,10 +7354,10 @@ ] }, { - "name": "OTA Software Update Client", + "name": "OTA Software Update Requestor", "code": 42, "mfgCode": null, - "define": "OTA_CLIENT_CLUSTER", + "define": "OTA_REQUESTOR_CLUSTER", "side": "server", "enabled": 0, "commands": [], diff --git a/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp b/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp index 1f2426ab5a6891..e8566516e3f21a 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp @@ -5072,7 +5072,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // namespace NetworkCommissioning -namespace OtaSoftwareUpdateServer { +namespace OtaSoftwareUpdateProvider { void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) { @@ -5151,7 +5151,8 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfOtaSoftwareUpdateServerClusterApplyUpdateRequestCallback(apCommandObj, updateToken, newVersion); + wasHandled = + emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(apCommandObj, updateToken, newVersion); } break; } @@ -5218,7 +5219,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. wasHandled = - emberAfOtaSoftwareUpdateServerClusterNotifyUpdateAppliedCallback(apCommandObj, updateToken, currentVersion); + emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(apCommandObj, updateToken, currentVersion); } break; } @@ -5231,8 +5232,8 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En uint32_t currentVersion; /* TYPE WARNING: array array defaults to */ uint8_t * protocolsSupported; const uint8_t * location; - uint8_t clientCanConsent; - chip::ByteSpan metadataForServer; + uint8_t requestorCanConsent; + chip::ByteSpan metadataForProvider; bool argExists[9]; memset(argExists, 0, sizeof argExists); @@ -5286,12 +5287,12 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En TLVUnpackError = aDataTlv.GetDataPtr(location); break; case 7: - TLVUnpackError = aDataTlv.Get(clientCanConsent); + TLVUnpackError = aDataTlv.Get(requestorCanConsent); break; case 8: { const uint8_t * data = nullptr; TLVUnpackError = aDataTlv.GetDataPtr(data); - metadataForServer = chip::ByteSpan(data, aDataTlv.GetLength()); + metadataForProvider = chip::ByteSpan(data, aDataTlv.GetLength()); } break; default: @@ -5314,9 +5315,9 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 9 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfOtaSoftwareUpdateServerClusterQueryImageCallback( + wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback( apCommandObj, vendorId, productId, imageType, hardwareVersion, currentVersion, protocolsSupported, - const_cast(location), clientCanConsent, metadataForServer); + const_cast(location), requestorCanConsent, metadataForProvider); } break; } @@ -5324,12 +5325,12 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En // Unrecognized command ID, error status will apply. chip::app::CommandPathParams returnStatusParam = { aEndpointId, 0, // GroupId - ZCL_OTA_SERVER_CLUSTER_ID, aCommandId, + ZCL_OTA_PROVIDER_CLUSTER_ID, aCommandId, (chip::app::CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command %" PRIx8 " for cluster %" PRIx16, aCommandId, ZCL_OTA_SERVER_CLUSTER_ID); + ChipLogError(Zcl, "Unknown command %" PRIx8 " for cluster %" PRIx16, aCommandId, ZCL_OTA_PROVIDER_CLUSTER_ID); return; } } @@ -5339,7 +5340,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En { chip::app::CommandPathParams returnStatusParam = { aEndpointId, 0, // GroupId - ZCL_OTA_SERVER_CLUSTER_ID, aCommandId, + ZCL_OTA_PROVIDER_CLUSTER_ID, aCommandId, (chip::app::CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand); @@ -5350,7 +5351,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } } -} // namespace OtaSoftwareUpdateServer +} // namespace OtaSoftwareUpdateProvider namespace OnOff { @@ -6546,8 +6547,8 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; - case ZCL_OTA_SERVER_CLUSTER_ID: - clusters::OtaSoftwareUpdateServer::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + case ZCL_OTA_PROVIDER_CLUSTER_ID: + clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; case ZCL_ON_OFF_CLUSTER_ID: clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp index c9154911858a58..535dd2782e5849 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp @@ -116,8 +116,8 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: emberAfNetworkCommissioningClusterInitCallback(endpoint); break; - case ZCL_OTA_SERVER_CLUSTER_ID: - emberAfOtaSoftwareUpdateServerClusterInitCallback(endpoint); + case ZCL_OTA_PROVIDER_CLUSTER_ID: + emberAfOtaSoftwareUpdateProviderClusterInitCallback(endpoint); break; case ZCL_OCCUPANCY_SENSING_CLUSTER_ID: emberAfOccupancySensingClusterInitCallback(endpoint); @@ -324,7 +324,7 @@ void __attribute__((weak)) emberAfNetworkCommissioningClusterInitCallback(Endpoi // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfOtaSoftwareUpdateServerClusterInitCallback(EndpointId endpoint) +void __attribute__((weak)) emberAfOtaSoftwareUpdateProviderClusterInitCallback(EndpointId endpoint) { // To prevent warning (void) endpoint; diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback.h b/examples/all-clusters-app/all-clusters-common/gen/callback.h index 4ba480654ffdaa..b2749f5a762a4f 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/callback.h +++ b/examples/all-clusters-app/all-clusters-common/gen/callback.h @@ -272,13 +272,13 @@ void emberAfMediaPlaybackClusterInitCallback(chip::EndpointId endpoint); */ void emberAfNetworkCommissioningClusterInitCallback(chip::EndpointId endpoint); -/** @brief OTA Software Update Server Cluster Init +/** @brief OTA Software Update Provider Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfOtaSoftwareUpdateServerClusterInitCallback(chip::EndpointId endpoint); +void emberAfOtaSoftwareUpdateProviderClusterInitCallback(chip::EndpointId endpoint); /** @brief Occupancy Sensing Cluster Init * @@ -2455,27 +2455,28 @@ EmberAfStatus emberAfNetworkCommissioningClusterServerPreAttributeChangedCallbac void emberAfNetworkCommissioningClusterServerTickCallback(chip::EndpointId endpoint); // -// OTA Software Update Server Cluster server +// OTA Software Update Provider Cluster server // -/** @brief OTA Software Update Server Cluster Server Init +/** @brief OTA Software Update Provider Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfOtaSoftwareUpdateServerClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfOtaSoftwareUpdateProviderClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief OTA Software Update Server Cluster Server Attribute Changed +/** @brief OTA Software Update Provider Cluster Server Attribute Changed * * Server Attribute Changed * * @param endpoint Endpoint that is being initialized * @param attributeId Attribute that changed */ -void emberAfOtaSoftwareUpdateServerClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); +void emberAfOtaSoftwareUpdateProviderClusterServerAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId); -/** @brief OTA Software Update Server Cluster Server Manufacturer Specific Attribute Changed +/** @brief OTA Software Update Provider Cluster Server Manufacturer Specific Attribute Changed * * Server Manufacturer Specific Attribute Changed * @@ -2483,11 +2484,11 @@ void emberAfOtaSoftwareUpdateServerClusterServerAttributeChangedCallback(chip::E * @param attributeId Attribute that changed * @param manufacturerCode Manufacturer Code of the attribute that changed */ -void emberAfOtaSoftwareUpdateServerClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); +void emberAfOtaSoftwareUpdateProviderClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); -/** @brief OTA Software Update Server Cluster Server Message Sent +/** @brief OTA Software Update Provider Cluster Server Message Sent * * Server Message Sent * @@ -2498,11 +2499,11 @@ void emberAfOtaSoftwareUpdateServerClusterServerManufacturerSpecificAttributeCha * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOtaSoftwareUpdateServerClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfOtaSoftwareUpdateProviderClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); -/** @brief OTA Software Update Server Cluster Server Pre Attribute Changed +/** @brief OTA Software Update Provider Cluster Server Pre Attribute Changed * * server Pre Attribute Changed * @@ -2512,18 +2513,18 @@ void emberAfOtaSoftwareUpdateServerClusterServerMessageSentCallback(const chip:: * @param size Attribute size * @param value Attribute value */ -EmberAfStatus emberAfOtaSoftwareUpdateServerClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - EmberAfAttributeType attributeType, - uint16_t size, uint8_t * value); +EmberAfStatus emberAfOtaSoftwareUpdateProviderClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + EmberAfAttributeType attributeType, + uint16_t size, uint8_t * value); -/** @brief OTA Software Update Server Cluster Server Tick +/** @brief OTA Software Update Provider Cluster Server Tick * * server Tick * * @param endpoint Endpoint that is being served */ -void emberAfOtaSoftwareUpdateServerClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfOtaSoftwareUpdateProviderClusterServerTickCallback(chip::EndpointId endpoint); // // Occupancy Sensing Cluster server @@ -4277,27 +4278,27 @@ bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(chip::app::Comm uint32_t timeoutMs); /** - * @brief OTA Software Update Server Cluster ApplyUpdateRequest Command callback + * @brief OTA Software Update Provider Cluster ApplyUpdateRequest Command callback */ -bool emberAfOtaSoftwareUpdateServerClusterApplyUpdateRequestCallback(chip::app::Command * commandObj, chip::ByteSpan updateToken, - uint32_t newVersion); +bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(chip::app::Command * commandObj, chip::ByteSpan updateToken, + uint32_t newVersion); /** - * @brief OTA Software Update Server Cluster NotifyUpdateApplied Command callback + * @brief OTA Software Update Provider Cluster NotifyUpdateApplied Command callback */ -bool emberAfOtaSoftwareUpdateServerClusterNotifyUpdateAppliedCallback(chip::app::Command * commandObj, chip::ByteSpan updateToken, - uint32_t currentVersion); +bool emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(chip::app::Command * commandObj, chip::ByteSpan updateToken, + uint32_t currentVersion); /** - * @brief OTA Software Update Server Cluster QueryImage Command callback + * @brief OTA Software Update Provider Cluster QueryImage Command callback */ -bool emberAfOtaSoftwareUpdateServerClusterQueryImageCallback( +bool emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback( chip::app::Command * commandObj, uint16_t vendorId, uint16_t productId, uint16_t imageType, uint16_t hardwareVersion, uint32_t currentVersion, /* TYPE WARNING: array array defaults to */ uint8_t * protocolsSupported, uint8_t * location, - uint8_t clientCanConsent, chip::ByteSpan metadataForServer); + uint8_t requestorCanConsent, chip::ByteSpan metadataForProvider); /** * @brief On/off Cluster Off Command callback diff --git a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h index d25829db2d2c0f..438b4de31f81ab 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h +++ b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h @@ -1833,7 +1833,7 @@ { 0x0011, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(1) }, /* Reachable */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \ \ - /* Endpoint: 0, Cluster: OTA Software Update Server (server) */ \ + /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ @@ -2322,7 +2322,7 @@ chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ { \ 0x0029, ZAP_ATTRIBUTE_INDEX(24), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: OTA Software Update Server (server) */ \ + }, /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ { \ 0x0030, ZAP_ATTRIBUTE_INDEX(25), 3, 18, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ @@ -2577,7 +2577,7 @@ { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Leave */ \ { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MfgSpecificPing */ \ \ - /* Endpoint: 0, Cluster: OTA Software Update Server (server) */ \ + /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ { 0x0029, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* QueryImage */ \ { 0x0029, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ApplyUpdateRequest */ \ { 0x0029, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* NotifyUpdateApplied */ \ @@ -2879,7 +2879,7 @@ #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS \ { \ \ - /* Endpoint: 0, Cluster: OTA Software Update Server (server) */ \ + /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ { \ ZAP_REPORT_DIRECTION(REPORTED), 0x0000, 0x0029, 0xFFFD, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ }, /* cluster revision */ \ diff --git a/examples/all-clusters-app/all-clusters-common/gen/gen_config.h b/examples/all-clusters-app/all-clusters-common/gen/gen_config.h index 08eb2c7cf805b7..4da835d338f5e4 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/gen_config.h +++ b/examples/all-clusters-app/all-clusters-common/gen/gen_config.h @@ -58,7 +58,7 @@ #define EMBER_AF_MEDIA_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_MEDIA_PLAYBACK_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_OTA_SERVER_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_OTA_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_OCCUPANCY_SENSING_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (2) #define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -235,10 +235,10 @@ #define EMBER_AF_PLUGIN_NETWORK_COMMISSIONING_SERVER #define EMBER_AF_PLUGIN_NETWORK_COMMISSIONING -// Use this macro to check if the server side of the OTA Software Update Server cluster is included -#define ZCL_USING_OTA_SERVER_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_SERVER_SERVER -#define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_SERVER +// Use this macro to check if the server side of the OTA Software Update Provider cluster is included +#define ZCL_USING_OTA_PROVIDER_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_PROVIDER_SERVER +#define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_PROVIDER // Use this macro to check if the server side of the Occupancy Sensing cluster is included #define ZCL_USING_OCCUPANCY_SENSING_CLUSTER_SERVER diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 3f9102a91a043c..c50bf6e7b06cef 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -49,7 +49,7 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/low-power-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/keypad-input-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/media-playback-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-provider" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/binary-input-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/target-navigator-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/temperature-measurement-server" diff --git a/examples/chip-tool/commands/clusters/Commands.h b/examples/chip-tool/commands/clusters/Commands.h index b54b743df493ac..cb358e34b01bbf 100644 --- a/examples/chip-tool/commands/clusters/Commands.h +++ b/examples/chip-tool/commands/clusters/Commands.h @@ -570,19 +570,19 @@ static void OnNetworkCommissioningClusterUpdateWiFiNetworkResponse(void * contex command->SetCommandExitStatus(CHIP_NO_ERROR); } -static void OnOtaSoftwareUpdateServerClusterApplyUpdateRequestResponse(void * context, uint8_t action, uint32_t delayedActionTime) +static void OnOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponse(void * context, uint8_t action, uint32_t delayedActionTime) { - ChipLogProgress(chipTool, "OtaSoftwareUpdateServerClusterApplyUpdateRequestResponse"); + ChipLogProgress(chipTool, "OtaSoftwareUpdateProviderClusterApplyUpdateRequestResponse"); ModelCommand * command = reinterpret_cast(context); command->SetCommandExitStatus(CHIP_NO_ERROR); } -static void OnOtaSoftwareUpdateServerClusterQueryImageResponse(void * context, uint32_t delayedActionTime, uint8_t * imageURI, - uint32_t softwareVersion, chip::ByteSpan updateToken, - uint8_t userConsentNeeded, chip::ByteSpan metadataForClient) +static void OnOtaSoftwareUpdateProviderClusterQueryImageResponse(void * context, uint32_t delayedActionTime, uint8_t * imageURI, + uint32_t softwareVersion, chip::ByteSpan updateToken, + uint8_t userConsentNeeded, chip::ByteSpan metadataForRequestor) { - ChipLogProgress(chipTool, "OtaSoftwareUpdateServerClusterQueryImageResponse"); + ChipLogProgress(chipTool, "OtaSoftwareUpdateProviderClusterQueryImageResponse"); ModelCommand * command = reinterpret_cast(context); command->SetCommandExitStatus(CHIP_NO_ERROR); @@ -1117,7 +1117,7 @@ static void OnThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeRespon | MediaInput | 0x0507 | | MediaPlayback | 0x0506 | | NetworkCommissioning | 0x0031 | -| OtaSoftwareUpdateServer | 0x0029 | +| OtaSoftwareUpdateProvider | 0x0029 | | OnOff | 0x0006 | | OperationalCredentials | 0x003E | | PressureMeasurement | 0x0403 | @@ -1165,7 +1165,7 @@ constexpr chip::ClusterId kLowPowerClusterId = 0x0508; constexpr chip::ClusterId kMediaInputClusterId = 0x0507; constexpr chip::ClusterId kMediaPlaybackClusterId = 0x0506; constexpr chip::ClusterId kNetworkCommissioningClusterId = 0x0031; -constexpr chip::ClusterId kOtaSoftwareUpdateServerClusterId = 0x0029; +constexpr chip::ClusterId kOtaSoftwareUpdateProviderClusterId = 0x0029; constexpr chip::ClusterId kOnOffClusterId = 0x0006; constexpr chip::ClusterId kOperationalCredentialsClusterId = 0x003E; constexpr chip::ClusterId kPressureMeasurementClusterId = 0x0403; @@ -12373,7 +12373,7 @@ class ReadNetworkCommissioningClusterRevision : public ModelCommand }; /*----------------------------------------------------------------------------*\ -| Cluster OtaSoftwareUpdateServer | 0x0029 | +| Cluster OtaSoftwareUpdateProvider | 0x0029 | |------------------------------------------------------------------------------| | Commands: | | | * ApplyUpdateRequest | 0x01 | @@ -12387,16 +12387,16 @@ class ReadNetworkCommissioningClusterRevision : public ModelCommand /* * Command ApplyUpdateRequest */ -class OtaSoftwareUpdateServerApplyUpdateRequest : public ModelCommand +class OtaSoftwareUpdateProviderApplyUpdateRequest : public ModelCommand { public: - OtaSoftwareUpdateServerApplyUpdateRequest() : ModelCommand("apply-update-request") + OtaSoftwareUpdateProviderApplyUpdateRequest() : ModelCommand("apply-update-request") { AddArgument("UpdateToken", &mUpdateToken); AddArgument("NewVersion", 0, UINT32_MAX, &mNewVersion); ModelCommand::AddArguments(); } - ~OtaSoftwareUpdateServerApplyUpdateRequest() + ~OtaSoftwareUpdateProviderApplyUpdateRequest() { delete onSuccessCallback; delete onFailureCallback; @@ -12406,15 +12406,15 @@ class OtaSoftwareUpdateServerApplyUpdateRequest : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0029) command (0x01) on endpoint %" PRIu8, endpointId); - chip::Controller::OtaSoftwareUpdateServerCluster cluster; + chip::Controller::OtaSoftwareUpdateProviderCluster cluster; cluster.Associate(device, endpointId); return cluster.ApplyUpdateRequest(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUpdateToken, mNewVersion); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback( - OnOtaSoftwareUpdateServerClusterApplyUpdateRequestResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback( + OnOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); chip::ByteSpan mUpdateToken; @@ -12424,16 +12424,16 @@ class OtaSoftwareUpdateServerApplyUpdateRequest : public ModelCommand /* * Command NotifyUpdateApplied */ -class OtaSoftwareUpdateServerNotifyUpdateApplied : public ModelCommand +class OtaSoftwareUpdateProviderNotifyUpdateApplied : public ModelCommand { public: - OtaSoftwareUpdateServerNotifyUpdateApplied() : ModelCommand("notify-update-applied") + OtaSoftwareUpdateProviderNotifyUpdateApplied() : ModelCommand("notify-update-applied") { AddArgument("UpdateToken", &mUpdateToken); AddArgument("CurrentVersion", 0, UINT32_MAX, &mCurrentVersion); ModelCommand::AddArguments(); } - ~OtaSoftwareUpdateServerNotifyUpdateApplied() + ~OtaSoftwareUpdateProviderNotifyUpdateApplied() { delete onSuccessCallback; delete onFailureCallback; @@ -12443,7 +12443,7 @@ class OtaSoftwareUpdateServerNotifyUpdateApplied : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0029) command (0x02) on endpoint %" PRIu8, endpointId); - chip::Controller::OtaSoftwareUpdateServerCluster cluster; + chip::Controller::OtaSoftwareUpdateProviderCluster cluster; cluster.Associate(device, endpointId); return cluster.NotifyUpdateApplied(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUpdateToken, mCurrentVersion); } @@ -12460,10 +12460,10 @@ class OtaSoftwareUpdateServerNotifyUpdateApplied : public ModelCommand /* * Command QueryImage */ -class OtaSoftwareUpdateServerQueryImage : public ModelCommand +class OtaSoftwareUpdateProviderQueryImage : public ModelCommand { public: - OtaSoftwareUpdateServerQueryImage() : ModelCommand("query-image") + OtaSoftwareUpdateProviderQueryImage() : ModelCommand("query-image") { AddArgument("VendorId", 0, UINT16_MAX, &mVendorId); AddArgument("ProductId", 0, UINT16_MAX, &mProductId); @@ -12472,11 +12472,11 @@ class OtaSoftwareUpdateServerQueryImage : public ModelCommand AddArgument("CurrentVersion", 0, UINT32_MAX, &mCurrentVersion); AddArgument("ProtocolsSupported", 0, UINT8_MAX, &mProtocolsSupported); AddArgument("Location", &mLocation); - AddArgument("ClientCanConsent", 0, UINT8_MAX, &mClientCanConsent); - AddArgument("MetadataForServer", &mMetadataForServer); + AddArgument("RequestorCanConsent", 0, UINT8_MAX, &mRequestorCanConsent); + AddArgument("MetadataForProvider", &mMetadataForProvider); ModelCommand::AddArguments(); } - ~OtaSoftwareUpdateServerQueryImage() + ~OtaSoftwareUpdateProviderQueryImage() { delete onSuccessCallback; delete onFailureCallback; @@ -12486,18 +12486,18 @@ class OtaSoftwareUpdateServerQueryImage : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0029) command (0x00) on endpoint %" PRIu8, endpointId); - chip::Controller::OtaSoftwareUpdateServerCluster cluster; + chip::Controller::OtaSoftwareUpdateProviderCluster cluster; cluster.Associate(device, endpointId); return cluster.QueryImage(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mVendorId, mProductId, mImageType, mHardwareVersion, mCurrentVersion, mProtocolsSupported, - chip::ByteSpan(chip::Uint8::from_char(mLocation), strlen(mLocation)), mClientCanConsent, - mMetadataForServer); + chip::ByteSpan(chip::Uint8::from_char(mLocation), strlen(mLocation)), mRequestorCanConsent, + mMetadataForProvider); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback( - OnOtaSoftwareUpdateServerClusterQueryImageResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback( + OnOtaSoftwareUpdateProviderClusterQueryImageResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); uint16_t mVendorId; @@ -12507,19 +12507,19 @@ class OtaSoftwareUpdateServerQueryImage : public ModelCommand uint32_t mCurrentVersion; uint8_t mProtocolsSupported; char * mLocation; - uint8_t mClientCanConsent; - chip::ByteSpan mMetadataForServer; + uint8_t mRequestorCanConsent; + chip::ByteSpan mMetadataForProvider; }; /* * Discover Attributes */ -class DiscoverOtaSoftwareUpdateServerAttributes : public ModelCommand +class DiscoverOtaSoftwareUpdateProviderAttributes : public ModelCommand { public: - DiscoverOtaSoftwareUpdateServerAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); } + DiscoverOtaSoftwareUpdateProviderAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); } - ~DiscoverOtaSoftwareUpdateServerAttributes() + ~DiscoverOtaSoftwareUpdateProviderAttributes() { delete onSuccessCallback; delete onFailureCallback; @@ -12529,7 +12529,7 @@ class DiscoverOtaSoftwareUpdateServerAttributes : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId); - chip::Controller::OtaSoftwareUpdateServerCluster cluster; + chip::Controller::OtaSoftwareUpdateProviderCluster cluster; cluster.Associate(device, endpointId); return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } @@ -12544,16 +12544,16 @@ class DiscoverOtaSoftwareUpdateServerAttributes : public ModelCommand /* * Attribute ClusterRevision */ -class ReadOtaSoftwareUpdateServerClusterRevision : public ModelCommand +class ReadOtaSoftwareUpdateProviderClusterRevision : public ModelCommand { public: - ReadOtaSoftwareUpdateServerClusterRevision() : ModelCommand("read") + ReadOtaSoftwareUpdateProviderClusterRevision() : ModelCommand("read") { AddArgument("attr-name", "cluster-revision"); ModelCommand::AddArguments(); } - ~ReadOtaSoftwareUpdateServerClusterRevision() + ~ReadOtaSoftwareUpdateProviderClusterRevision() { delete onSuccessCallback; delete onFailureCallback; @@ -12563,7 +12563,7 @@ class ReadOtaSoftwareUpdateServerClusterRevision : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0029) command (0x00) on endpoint %" PRIu8, endpointId); - chip::Controller::OtaSoftwareUpdateServerCluster cluster; + chip::Controller::OtaSoftwareUpdateProviderCluster cluster; cluster.Associate(device, endpointId); return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } @@ -22414,14 +22414,14 @@ void registerClusterNetworkCommissioning(Commands & commands) commands.Register(clusterName, clusterCommands); } -void registerClusterOtaSoftwareUpdateServer(Commands & commands) +void registerClusterOtaSoftwareUpdateProvider(Commands & commands) { - const char * clusterName = "OtaSoftwareUpdateServer"; + const char * clusterName = "OtaSoftwareUpdateProvider"; commands_list clusterCommands = { - make_unique(), make_unique(), - make_unique(), make_unique(), - make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), + make_unique(), }; commands.Register(clusterName, clusterCommands); @@ -22842,7 +22842,7 @@ void registerClusters(Commands & commands) registerClusterMediaInput(commands); registerClusterMediaPlayback(commands); registerClusterNetworkCommissioning(commands); - registerClusterOtaSoftwareUpdateServer(commands); + registerClusterOtaSoftwareUpdateProvider(commands); registerClusterOnOff(commands); registerClusterOperationalCredentials(commands); registerClusterPressureMeasurement(commands); diff --git a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp index 2cb290c5140902..1ef26a9f88d268 100644 --- a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp +++ b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp @@ -2547,7 +2547,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // namespace NetworkCommissioning -namespace OtaSoftwareUpdateServer { +namespace OtaSoftwareUpdateProvider { void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) { @@ -2626,7 +2626,8 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfOtaSoftwareUpdateServerClusterApplyUpdateRequestCallback(apCommandObj, updateToken, newVersion); + wasHandled = + emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(apCommandObj, updateToken, newVersion); } break; } @@ -2693,7 +2694,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. wasHandled = - emberAfOtaSoftwareUpdateServerClusterNotifyUpdateAppliedCallback(apCommandObj, updateToken, currentVersion); + emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(apCommandObj, updateToken, currentVersion); } break; } @@ -2706,8 +2707,8 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En uint32_t currentVersion; /* TYPE WARNING: array array defaults to */ uint8_t * protocolsSupported; const uint8_t * location; - uint8_t clientCanConsent; - chip::ByteSpan metadataForServer; + uint8_t requestorCanConsent; + chip::ByteSpan metadataForProvider; bool argExists[9]; memset(argExists, 0, sizeof argExists); @@ -2761,12 +2762,12 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En TLVUnpackError = aDataTlv.GetDataPtr(location); break; case 7: - TLVUnpackError = aDataTlv.Get(clientCanConsent); + TLVUnpackError = aDataTlv.Get(requestorCanConsent); break; case 8: { const uint8_t * data = nullptr; TLVUnpackError = aDataTlv.GetDataPtr(data); - metadataForServer = chip::ByteSpan(data, aDataTlv.GetLength()); + metadataForProvider = chip::ByteSpan(data, aDataTlv.GetLength()); } break; default: @@ -2789,9 +2790,9 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 9 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfOtaSoftwareUpdateServerClusterQueryImageCallback( + wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback( apCommandObj, vendorId, productId, imageType, hardwareVersion, currentVersion, protocolsSupported, - const_cast(location), clientCanConsent, metadataForServer); + const_cast(location), requestorCanConsent, metadataForProvider); } break; } @@ -2799,12 +2800,12 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En // Unrecognized command ID, error status will apply. chip::app::CommandPathParams returnStatusParam = { aEndpointId, 0, // GroupId - ZCL_OTA_SERVER_CLUSTER_ID, aCommandId, + ZCL_OTA_PROVIDER_CLUSTER_ID, aCommandId, (chip::app::CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command %" PRIx8 " for cluster %" PRIx16, aCommandId, ZCL_OTA_SERVER_CLUSTER_ID); + ChipLogError(Zcl, "Unknown command %" PRIx8 " for cluster %" PRIx16, aCommandId, ZCL_OTA_PROVIDER_CLUSTER_ID); return; } } @@ -2814,7 +2815,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En { chip::app::CommandPathParams returnStatusParam = { aEndpointId, 0, // GroupId - ZCL_OTA_SERVER_CLUSTER_ID, aCommandId, + ZCL_OTA_PROVIDER_CLUSTER_ID, aCommandId, (chip::app::CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand); @@ -2825,7 +2826,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } } -} // namespace OtaSoftwareUpdateServer +} // namespace OtaSoftwareUpdateProvider namespace OnOff { @@ -3444,8 +3445,8 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; - case ZCL_OTA_SERVER_CLUSTER_ID: - clusters::OtaSoftwareUpdateServer::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + case ZCL_OTA_PROVIDER_CLUSTER_ID: + clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; case ZCL_ON_OFF_CLUSTER_ID: clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); diff --git a/examples/tv-app/tv-common/gen/callback-stub.cpp b/examples/tv-app/tv-common/gen/callback-stub.cpp index b24fffba103cc9..a71c7d97aa0302 100644 --- a/examples/tv-app/tv-common/gen/callback-stub.cpp +++ b/examples/tv-app/tv-common/gen/callback-stub.cpp @@ -86,8 +86,8 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: emberAfNetworkCommissioningClusterInitCallback(endpoint); break; - case ZCL_OTA_SERVER_CLUSTER_ID: - emberAfOtaSoftwareUpdateServerClusterInitCallback(endpoint); + case ZCL_OTA_PROVIDER_CLUSTER_ID: + emberAfOtaSoftwareUpdateProviderClusterInitCallback(endpoint); break; case ZCL_ON_OFF_CLUSTER_ID: emberAfOnOffClusterInitCallback(endpoint); @@ -217,7 +217,7 @@ void __attribute__((weak)) emberAfNetworkCommissioningClusterInitCallback(Endpoi // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfOtaSoftwareUpdateServerClusterInitCallback(EndpointId endpoint) +void __attribute__((weak)) emberAfOtaSoftwareUpdateProviderClusterInitCallback(EndpointId endpoint) { // To prevent warning (void) endpoint; diff --git a/examples/tv-app/tv-common/gen/callback.h b/examples/tv-app/tv-common/gen/callback.h index c5b8134cdf3482..782de2beb4b590 100644 --- a/examples/tv-app/tv-common/gen/callback.h +++ b/examples/tv-app/tv-common/gen/callback.h @@ -192,13 +192,13 @@ void emberAfMediaPlaybackClusterInitCallback(chip::EndpointId endpoint); */ void emberAfNetworkCommissioningClusterInitCallback(chip::EndpointId endpoint); -/** @brief OTA Software Update Server Cluster Init +/** @brief OTA Software Update Provider Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfOtaSoftwareUpdateServerClusterInitCallback(chip::EndpointId endpoint); +void emberAfOtaSoftwareUpdateProviderClusterInitCallback(chip::EndpointId endpoint); /** @brief On/off Cluster Init * @@ -1605,27 +1605,28 @@ EmberAfStatus emberAfNetworkCommissioningClusterServerPreAttributeChangedCallbac void emberAfNetworkCommissioningClusterServerTickCallback(chip::EndpointId endpoint); // -// OTA Software Update Server Cluster server +// OTA Software Update Provider Cluster server // -/** @brief OTA Software Update Server Cluster Server Init +/** @brief OTA Software Update Provider Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfOtaSoftwareUpdateServerClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfOtaSoftwareUpdateProviderClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief OTA Software Update Server Cluster Server Attribute Changed +/** @brief OTA Software Update Provider Cluster Server Attribute Changed * * Server Attribute Changed * * @param endpoint Endpoint that is being initialized * @param attributeId Attribute that changed */ -void emberAfOtaSoftwareUpdateServerClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); +void emberAfOtaSoftwareUpdateProviderClusterServerAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId); -/** @brief OTA Software Update Server Cluster Server Manufacturer Specific Attribute Changed +/** @brief OTA Software Update Provider Cluster Server Manufacturer Specific Attribute Changed * * Server Manufacturer Specific Attribute Changed * @@ -1633,11 +1634,11 @@ void emberAfOtaSoftwareUpdateServerClusterServerAttributeChangedCallback(chip::E * @param attributeId Attribute that changed * @param manufacturerCode Manufacturer Code of the attribute that changed */ -void emberAfOtaSoftwareUpdateServerClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); +void emberAfOtaSoftwareUpdateProviderClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); -/** @brief OTA Software Update Server Cluster Server Message Sent +/** @brief OTA Software Update Provider Cluster Server Message Sent * * Server Message Sent * @@ -1648,11 +1649,11 @@ void emberAfOtaSoftwareUpdateServerClusterServerManufacturerSpecificAttributeCha * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOtaSoftwareUpdateServerClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfOtaSoftwareUpdateProviderClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); -/** @brief OTA Software Update Server Cluster Server Pre Attribute Changed +/** @brief OTA Software Update Provider Cluster Server Pre Attribute Changed * * server Pre Attribute Changed * @@ -1662,18 +1663,18 @@ void emberAfOtaSoftwareUpdateServerClusterServerMessageSentCallback(const chip:: * @param size Attribute size * @param value Attribute value */ -EmberAfStatus emberAfOtaSoftwareUpdateServerClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - EmberAfAttributeType attributeType, - uint16_t size, uint8_t * value); +EmberAfStatus emberAfOtaSoftwareUpdateProviderClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + EmberAfAttributeType attributeType, + uint16_t size, uint8_t * value); -/** @brief OTA Software Update Server Cluster Server Tick +/** @brief OTA Software Update Provider Cluster Server Tick * * server Tick * * @param endpoint Endpoint that is being served */ -void emberAfOtaSoftwareUpdateServerClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfOtaSoftwareUpdateProviderClusterServerTickCallback(chip::EndpointId endpoint); // // On/off Cluster server @@ -2572,27 +2573,27 @@ bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(chip::app::Comm uint32_t timeoutMs); /** - * @brief OTA Software Update Server Cluster ApplyUpdateRequest Command callback + * @brief OTA Software Update Provider Cluster ApplyUpdateRequest Command callback */ -bool emberAfOtaSoftwareUpdateServerClusterApplyUpdateRequestCallback(chip::app::Command * commandObj, chip::ByteSpan updateToken, - uint32_t newVersion); +bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(chip::app::Command * commandObj, chip::ByteSpan updateToken, + uint32_t newVersion); /** - * @brief OTA Software Update Server Cluster NotifyUpdateApplied Command callback + * @brief OTA Software Update Provider Cluster NotifyUpdateApplied Command callback */ -bool emberAfOtaSoftwareUpdateServerClusterNotifyUpdateAppliedCallback(chip::app::Command * commandObj, chip::ByteSpan updateToken, - uint32_t currentVersion); +bool emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(chip::app::Command * commandObj, chip::ByteSpan updateToken, + uint32_t currentVersion); /** - * @brief OTA Software Update Server Cluster QueryImage Command callback + * @brief OTA Software Update Provider Cluster QueryImage Command callback */ -bool emberAfOtaSoftwareUpdateServerClusterQueryImageCallback( +bool emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback( chip::app::Command * commandObj, uint16_t vendorId, uint16_t productId, uint16_t imageType, uint16_t hardwareVersion, uint32_t currentVersion, /* TYPE WARNING: array array defaults to */ uint8_t * protocolsSupported, uint8_t * location, - uint8_t clientCanConsent, chip::ByteSpan metadataForServer); + uint8_t requestorCanConsent, chip::ByteSpan metadataForProvider); /** * @brief On/off Cluster Off Command callback diff --git a/examples/tv-app/tv-common/gen/endpoint_config.h b/examples/tv-app/tv-common/gen/endpoint_config.h index e3173c619d60d5..b485e3e990ce76 100644 --- a/examples/tv-app/tv-common/gen/endpoint_config.h +++ b/examples/tv-app/tv-common/gen/endpoint_config.h @@ -1430,7 +1430,7 @@ ZAP_SIMPLE_DEFAULT(0x00) }, /* LocalConfigDisabled */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \ \ - /* Endpoint: 0, Cluster: OTA Software Update Server (server) */ \ + /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ @@ -1682,7 +1682,7 @@ chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ { \ 0x0029, ZAP_ATTRIBUTE_INDEX(23), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: OTA Software Update Server (server) */ \ + }, /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ { \ 0x0030, ZAP_ATTRIBUTE_INDEX(24), 3, 18, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ @@ -1857,7 +1857,7 @@ { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Leave */ \ { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MfgSpecificPing */ \ \ - /* Endpoint: 0, Cluster: OTA Software Update Server (server) */ \ + /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ { 0x0029, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* QueryImage */ \ { 0x0029, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ApplyUpdateRequest */ \ { 0x0029, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* NotifyUpdateApplied */ \ @@ -2057,7 +2057,7 @@ #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS \ { \ \ - /* Endpoint: 0, Cluster: OTA Software Update Server (server) */ \ + /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ { \ ZAP_REPORT_DIRECTION(REPORTED), 0x0000, 0x0029, 0xFFFD, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ }, /* cluster revision */ \ diff --git a/examples/tv-app/tv-common/gen/gen_config.h b/examples/tv-app/tv-common/gen/gen_config.h index ae162b8a0e2e87..14990ffa3e5b86 100644 --- a/examples/tv-app/tv-common/gen/gen_config.h +++ b/examples/tv-app/tv-common/gen/gen_config.h @@ -48,7 +48,7 @@ #define EMBER_AF_MEDIA_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_MEDIA_PLAYBACK_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_OTA_SERVER_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_OTA_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (2) #define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -160,10 +160,10 @@ #define EMBER_AF_PLUGIN_NETWORK_COMMISSIONING_SERVER #define EMBER_AF_PLUGIN_NETWORK_COMMISSIONING -// Use this macro to check if the server side of the OTA Software Update Server cluster is included -#define ZCL_USING_OTA_SERVER_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_SERVER_SERVER -#define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_SERVER +// Use this macro to check if the server side of the OTA Software Update Provider cluster is included +#define ZCL_USING_OTA_PROVIDER_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_PROVIDER_SERVER +#define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_PROVIDER // Use this macro to check if the server side of the On/off cluster is included #define ZCL_USING_ON_OFF_CLUSTER_SERVER diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index af6bf598009ad7..e522289402a90c 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -1189,10 +1189,10 @@ ] }, { - "name": "OTA Software Update Server", + "name": "OTA Software Update Provider", "code": 41, "mfgCode": null, - "define": "OTA_SERVER_CLUSTER", + "define": "OTA_PROVIDER_CLUSTER", "side": "client", "enabled": 0, "commands": [ @@ -1240,10 +1240,10 @@ ] }, { - "name": "OTA Software Update Server", + "name": "OTA Software Update Provider", "code": 41, "mfgCode": null, - "define": "OTA_SERVER_CLUSTER", + "define": "OTA_PROVIDER_CLUSTER", "side": "server", "enabled": 1, "commands": [ diff --git a/src/app/clusters/ota-server/ota-server-delegate.h b/src/app/clusters/ota-provider/ota-provider-delegate.h similarity index 91% rename from src/app/clusters/ota-server/ota-server-delegate.h rename to src/app/clusters/ota-provider/ota-provider-delegate.h index 6da0dc2447ffff..0479018bd5e607 100644 --- a/src/app/clusters/ota-server/ota-server-delegate.h +++ b/src/app/clusters/ota-provider/ota-provider-delegate.h @@ -26,21 +26,21 @@ namespace app { namespace clusters { /** @brief - * Defines methods for implementing application-specific logic for the OTA Server Cluster. + * Defines methods for implementing application-specific logic for the OTA Provider Cluster. */ -class OTAServerDelegate +class OTAProviderDelegate { public: // TODO: protocolsSupported should be list of OTADownloadProtocol enums, not uint8_t* virtual EmberAfStatus HandleQueryImage(uint16_t vendorId, uint16_t productId, uint16_t imageType, uint16_t hardwareVersion, uint32_t currentVersion, uint8_t * protocolsSupported, const chip::ByteSpan & location, - bool clientCanConsent, const chip::ByteSpan & metadataForServer) = 0; + bool clientCanConsent, const chip::ByteSpan & metadataForProvider) = 0; virtual EmberAfStatus HandleApplyUpdateRequest(const chip::ByteSpan & updateToken, uint32_t newVersion) = 0; virtual EmberAfStatus HandleNotifyUpdateApplied(const chip::ByteSpan & updateToken, uint32_t currentVersion) = 0; - virtual ~OTAServerDelegate() = default; + virtual ~OTAProviderDelegate() = default; }; } // namespace clusters diff --git a/src/app/clusters/ota-server/ota-server.cpp b/src/app/clusters/ota-provider/ota-provider.cpp similarity index 64% rename from src/app/clusters/ota-server/ota-server.cpp rename to src/app/clusters/ota-provider/ota-provider.cpp index d6469c5adc91a5..b1eef460458137 100644 --- a/src/app/clusters/ota-server/ota-server.cpp +++ b/src/app/clusters/ota-provider/ota-provider.cpp @@ -28,21 +28,21 @@ #include -#include "ota-server-delegate.h" -#include "ota-server.h" +#include "ota-provider-delegate.h" +#include "ota-provider.h" -using chip::app::clusters::OTAServerDelegate; +using chip::app::clusters::OTAProviderDelegate; namespace { constexpr uint8_t kLocationParamLength = 2; // The expected length of the Location parameter in QueryImage -constexpr size_t kMaxMetadataLen = 512; // The maximum length of Metadata in any OTA Server command +constexpr size_t kMaxMetadataLen = 512; // The maximum length of Metadata in any OTA Provider command constexpr size_t kUpdateTokenParamLength = 32; // The expected length of the Update Token parameter used in multiple commands -OTAServerDelegate * gDelegateTable[EMBER_AF_OTA_SERVER_CLUSTER_SERVER_ENDPOINT_COUNT] = { nullptr }; +OTAProviderDelegate * gDelegateTable[EMBER_AF_OTA_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT] = { nullptr }; -OTAServerDelegate * GetDelegate(chip::EndpointId endpoint) +OTAProviderDelegate * GetDelegate(chip::EndpointId endpoint) { - uint8_t ep = emberAfFindClusterServerEndpointIndex(endpoint, ZCL_OTA_SERVER_CLUSTER_ID); + uint8_t ep = emberAfFindClusterServerEndpointIndex(endpoint, ZCL_OTA_PROVIDER_CLUSTER_ID); return (ep == 0xFF ? NULL : gDelegateTable[ep]); } @@ -50,7 +50,7 @@ bool SendStatusIfDelegateNull(chip::EndpointId endpointId) { if (GetDelegate(endpointId) == nullptr) { - ChipLogError(Zcl, "No OTAServerDelegate set for ep:%" PRIu8, endpointId); + ChipLogError(Zcl, "No OTAProviderDelegate set for ep:%" PRIu8, endpointId); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_UNSUP_COMMAND); return true; } @@ -59,7 +59,7 @@ bool SendStatusIfDelegateNull(chip::EndpointId endpointId) } // namespace /** - * @brief OTA Software Update Server Cluster ApplyUpdateRequest Command callback + * @brief OTA Software Update Provider Cluster ApplyUpdateRequest Command callback * * @note It is the application's reponsibility to send the ApplyUpdateRequestResponse command after this is handled. * @@ -67,14 +67,14 @@ bool SendStatusIfDelegateNull(chip::EndpointId endpointId) * @param newVersion The SoftwareVersion value of the new Software Image that the client is ready to apply. */ -bool emberAfOtaSoftwareUpdateServerClusterApplyUpdateRequestCallback(chip::app::Command * commandObj, chip::ByteSpan updateToken, - uint32_t newVersion) +bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(chip::app::Command * commandObj, chip::ByteSpan updateToken, + uint32_t newVersion) { - EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; - chip::EndpointId endpointId = emberAfCurrentEndpoint(); - OTAServerDelegate * delegate = GetDelegate(endpointId); + EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; + chip::EndpointId endpointId = emberAfCurrentEndpoint(); + OTAProviderDelegate * delegate = GetDelegate(endpointId); - ChipLogDetail(Zcl, "OTA Server received ApplyUpdateRequest"); + ChipLogDetail(Zcl, "OTA Provider received ApplyUpdateRequest"); if (SendStatusIfDelegateNull(endpointId)) { @@ -97,22 +97,22 @@ bool emberAfOtaSoftwareUpdateServerClusterApplyUpdateRequestCallback(chip::app:: } /** - * @brief OTA Software Update Server Cluster NotifyUpdateApplied Command callback + * @brief OTA Software Update Provider Cluster NotifyUpdateApplied Command callback * * * @param updateToken Identifier for the Software Image that was applied. Should be 32 octets long. * @param currentVersion The current SoftwareVersion value. Should match the SoftwarVersion attribute in the - * OTA Client's Basic Information Cluster. + * OTA Requestor's Basic Information Cluster. */ -bool emberAfOtaSoftwareUpdateServerClusterNotifyUpdateAppliedCallback(chip::app::Command * commandObj, chip::ByteSpan updateToken, - uint32_t currentVersion) +bool emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(chip::app::Command * commandObj, chip::ByteSpan updateToken, + uint32_t currentVersion) { - EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; - chip::EndpointId endpointId = emberAfCurrentEndpoint(); - OTAServerDelegate * delegate = GetDelegate(endpointId); + EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; + chip::EndpointId endpointId = emberAfCurrentEndpoint(); + OTAProviderDelegate * delegate = GetDelegate(endpointId); - ChipLogDetail(Zcl, "OTA Server received NotifyUpdateUpplied"); + ChipLogDetail(Zcl, "OTA Provider received NotifyUpdateUpplied"); if (SendStatusIfDelegateNull(endpointId)) { @@ -135,38 +135,38 @@ bool emberAfOtaSoftwareUpdateServerClusterNotifyUpdateAppliedCallback(chip::app: } /** - * @brief OTA Software Update Server Cluster QueryImage Command callback + * @brief OTA Software Update Provider Cluster QueryImage Command callback * - * @param vendorId The Vendor ID applying to the OTA Client’s Node. Should match the value in the Basic Information Cluster. - * @param productId The Product ID applying to the OTA Client’s Node. Should match the value in the Basic Information Cluster. - * @param imageType A Vendor-specific numerical value that may help an OTA Server select the correct payload. - * @param hardwareVersion The OTA Client’s hardware version. Should match the HardwareVersion attribute of the Client's Basic + * @param vendorId The Vendor ID applying to the OTA Requestor’s Node. Should match the value in the Basic Information Cluster. + * @param productId The Product ID applying to the OTA Requestor’s Node. Should match the value in the Basic Information Cluster. + * @param imageType A Vendor-specific numerical value that may help an OTA Provider select the correct payload. + * @param hardwareVersion The OTA Requestor’s hardware version. Should match the HardwareVersion attribute of the Client's Basic * Information Cluster. - * @param currentVersion The current version running on the OTA Client. Should match the SoftwareVersion attribute of the Client's - * Basic Information Cluster. - * @param protocolsSupported A list of OTADownloadProtocol enum values indicating download protocols supported by the OTA Client + * @param currentVersion The current version running on the OTA Requestor. Should match the SoftwareVersion attribute of the + * Client's Basic Information Cluster. + * @param protocolsSupported A list of OTADownloadProtocol enum values indicating download protocols supported by the OTA Requestor * (max length 8 entries). * @param location Optional, 2 chars. If present, it should match the Location value in the Client's Basic Information Cluster. - * @param clientCanConsent Optional. May be set by an OTA Client which is capable of obtaining user consent for OTA application. - * @param metadataForServer Optional, max 512 octets. A TLV-encoded Vendor-specific payload. + * @param clientCanConsent Optional. May be set by an OTA Requestor which is capable of obtaining user consent for OTA application. + * @param metadataForProvider Optional, max 512 octets. A TLV-encoded Vendor-specific payload. */ -bool emberAfOtaSoftwareUpdateServerClusterQueryImageCallback( +bool emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback( chip::app::Command * commandObj, uint16_t vendorId, uint16_t productId, uint16_t imageType, uint16_t hardwareVersion, uint32_t currentVersion, /* TYPE WARNING: array array defaults to */ uint8_t * protocolsSupported, uint8_t * location, uint8_t clientCanConsent, - chip::ByteSpan metadataForServer) + chip::ByteSpan metadataForProvider) { - EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; - chip::EndpointId endpointId = emberAfCurrentEndpoint(); - OTAServerDelegate * delegate = GetDelegate(endpointId); + EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; + chip::EndpointId endpointId = emberAfCurrentEndpoint(); + OTAProviderDelegate * delegate = GetDelegate(endpointId); if (SendStatusIfDelegateNull(endpointId)) { return true; }; - ChipLogDetail(Zcl, "OTA Server received QueryImage"); + ChipLogDetail(Zcl, "OTA Provider received QueryImage"); // TODO: (#7112) change location size checking once CHAR_STRING is supported const uint8_t locationLen = emberAfStringLength(location); @@ -175,16 +175,16 @@ bool emberAfOtaSoftwareUpdateServerClusterQueryImageCallback( ChipLogError(Zcl, "expected location length %" PRIu8 ", got %" PRIu8, locationLen, kLocationParamLength); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_INVALID_ARGUMENT); } - else if (metadataForServer.size() > kMaxMetadataLen) + else if (metadataForProvider.size() > kMaxMetadataLen) { - ChipLogError(Zcl, "metadata size %zu exceeds max %zu", metadataForServer.size(), kMaxMetadataLen); + ChipLogError(Zcl, "metadata size %zu exceeds max %zu", metadataForProvider.size(), kMaxMetadataLen); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_INVALID_ARGUMENT); } chip::ByteSpan locationSpan(location, locationLen); status = delegate->HandleQueryImage(vendorId, productId, imageType, hardwareVersion, currentVersion, protocolsSupported, - locationSpan, clientCanConsent, metadataForServer); + locationSpan, clientCanConsent, metadataForProvider); if (status != EMBER_ZCL_STATUS_SUCCESS) { emberAfSendImmediateDefaultResponse(status); @@ -197,9 +197,9 @@ namespace chip { namespace app { namespace clusters { -void OTAServer::SetDelegate(chip::EndpointId endpointId, OTAServerDelegate * delegate) +void OTAProvider::SetDelegate(chip::EndpointId endpointId, OTAProviderDelegate * delegate) { - uint8_t ep = emberAfFindClusterServerEndpointIndex(endpointId, ZCL_OTA_SERVER_CLUSTER_ID); + uint8_t ep = emberAfFindClusterServerEndpointIndex(endpointId, ZCL_OTA_PROVIDER_CLUSTER_ID); if (ep != 0xFF) { gDelegateTable[ep] = delegate; diff --git a/src/app/clusters/ota-server/ota-server.h b/src/app/clusters/ota-provider/ota-provider.h similarity index 85% rename from src/app/clusters/ota-server/ota-server.h rename to src/app/clusters/ota-provider/ota-provider.h index d2cd1ecab39b81..1e307401105a94 100644 --- a/src/app/clusters/ota-server/ota-server.h +++ b/src/app/clusters/ota-provider/ota-provider.h @@ -18,14 +18,14 @@ #pragma once -#include "ota-server-delegate.h" +#include "ota-provider-delegate.h" namespace chip { namespace app { namespace clusters { -namespace OTAServer { +namespace OTAProvider { -void SetDelegate(chip::EndpointId endpointId, OTAServerDelegate * delegate); +void SetDelegate(chip::EndpointId endpointId, OTAProviderDelegate * delegate); } } // namespace clusters diff --git a/src/app/common/gen/attribute-id.h b/src/app/common/gen/attribute-id.h index 7b5cea88d7710c..48518d10b69f41 100644 --- a/src/app/common/gen/attribute-id.h +++ b/src/app/common/gen/attribute-id.h @@ -274,16 +274,16 @@ #define ZCL_LOCAL_CONFIG_DISABLED_ATTRIBUTE_ID (0x0010) #define ZCL_REACHABLE_ATTRIBUTE_ID (0x0011) -// Attribute ids for cluster: OTA Software Update Server +// Attribute ids for cluster: OTA Software Update Provider // Client attributes // Server attributes -// Attribute ids for cluster: OTA Software Update Client +// Attribute ids for cluster: OTA Software Update Requestor // Client attributes -#define ZCL_DEFAULT_OTA_SERVER_ATTRIBUTE_ID (0x0000) +#define ZCL_DEFAULT_OTA_PROVIDER_ATTRIBUTE_ID (0x0000) #define ZCL_UPDATE_POSSIBLE_ATTRIBUTE_ID (0x0001) // Server attributes diff --git a/src/app/common/gen/client-command-macro.h b/src/app/common/gen/client-command-macro.h index 55a50651d81ab1..ff46732d39bde1 100644 --- a/src/app/common/gen/client-command-macro.h +++ b/src/app/common/gen/client-command-macro.h @@ -1739,17 +1739,17 @@ * @param protocolsSupported OTADownloadProtocol [] * @param protocolsSupportedLen int * @param location CHAR_STRING - * @param clientCanConsent BOOLEAN - * @param metadataForServer OCTET_STRING + * @param requestorCanConsent BOOLEAN + * @param metadataForProvider OCTET_STRING */ #define emberAfFillCommandOTA \ - Software Update ServerClusterQueryImage(vendorId, productId, imageType, hardwareVersion, currentVersion, protocolsSupported, \ - protocolsSupportedLen, location, clientCanConsent, metadataForServer) \ + Software Update ProviderClusterQueryImage(vendorId, productId, imageType, hardwareVersion, currentVersion, protocolsSupported, \ + protocolsSupportedLen, location, requestorCanConsent, metadataForProvider) \ emberAfFillExternalBuffer(mask, \ \ ZCL_QUERY_IMAGE_COMMAND_ID, "uuuuubuuu", vendorId, productId, imageType, hardwareVersion, \ - currentVersion, protocolsSupported, protocolsSupportedLen, location, clientCanConsent, \ - metadataForServer); + currentVersion, protocolsSupported, protocolsSupportedLen, location, requestorCanConsent, \ + metadataForProvider); /** @brief Command description for ApplyUpdateRequest * @@ -1758,7 +1758,7 @@ * @param newVersion INT32U */ #define emberAfFillCommandOTA \ - Software Update ServerClusterApplyUpdateRequest(updateToken, newVersion) \ + Software Update ProviderClusterApplyUpdateRequest(updateToken, newVersion) \ emberAfFillExternalBuffer(mask, \ \ ZCL_APPLY_UPDATE_REQUEST_COMMAND_ID, "uu", updateToken, newVersion); @@ -1770,7 +1770,7 @@ * @param currentVersion INT32U */ #define emberAfFillCommandOTA \ - Software Update ServerClusterNotifyUpdateApplied(updateToken, currentVersion) \ + Software Update ProviderClusterNotifyUpdateApplied(updateToken, currentVersion) \ emberAfFillExternalBuffer(mask, \ \ ZCL_NOTIFY_UPDATE_APPLIED_COMMAND_ID, "uu", updateToken, currentVersion); @@ -1784,15 +1784,15 @@ * @param softwareVersion INT32U * @param updateToken OCTET_STRING * @param userConsentNeeded BOOLEAN - * @param metadataForClient OCTET_STRING + * @param metadataForRequestor OCTET_STRING */ #define emberAfFillCommandOTA \ - Software Update ServerClusterQueryImageResponse(status, delayedActionTime, imageURI, softwareVersion, updateToken, \ - userConsentNeeded, metadataForClient) \ + Software Update ProviderClusterQueryImageResponse(status, delayedActionTime, imageURI, softwareVersion, updateToken, \ + userConsentNeeded, metadataForRequestor) \ emberAfFillExternalBuffer(mask, \ \ ZCL_QUERY_IMAGE_RESPONSE_COMMAND_ID, "uuuuuuu", status, delayedActionTime, imageURI, \ - softwareVersion, updateToken, userConsentNeeded, metadataForClient); + softwareVersion, updateToken, userConsentNeeded, metadataForRequestor); /** @brief Command description for ApplyUpdateRequestResponse * @@ -1801,24 +1801,24 @@ * @param delayedActionTime INT32U */ #define emberAfFillCommandOTA \ - Software Update ServerClusterApplyUpdateRequestResponse(action, delayedActionTime) \ + Software Update ProviderClusterApplyUpdateRequestResponse(action, delayedActionTime) \ emberAfFillExternalBuffer(mask, \ \ ZCL_APPLY_UPDATE_REQUEST_RESPONSE_COMMAND_ID, "uu", action, delayedActionTime); -/** @brief Command description for AnnounceOtaServer +/** @brief Command description for AnnounceOtaProvider * - * Command: AnnounceOtaServer + * Command: AnnounceOtaProvider * @param serverLocation OCTET_STRING * @param vendorId INT16U * @param announcementReason OTAAnnouncementReason * @param metadataForNode OCTET_STRING */ #define emberAfFillCommandOTA \ - Software Update ClientClusterAnnounceOtaServer(serverLocation, vendorId, announcementReason, metadataForNode) \ + Software Update RequestorClusterAnnounceOtaProvider(serverLocation, vendorId, announcementReason, metadataForNode) \ emberAfFillExternalBuffer(mask, \ \ - ZCL_ANNOUNCE_OTA_SERVER_COMMAND_ID, "uuuu", serverLocation, vendorId, announcementReason, \ + ZCL_ANNOUNCE_OTA_PROVIDER_COMMAND_ID, "uuuu", serverLocation, vendorId, announcementReason, \ metadataForNode); /** @brief Command description for ArmFailSafe diff --git a/src/app/common/gen/cluster-id.h b/src/app/common/gen/cluster-id.h index 99dace48d6b125..6a34d97e0627b4 100644 --- a/src/app/common/gen/cluster-id.h +++ b/src/app/common/gen/cluster-id.h @@ -70,11 +70,11 @@ static constexpr chip::ClusterId ZCL_POLL_CONTROL_CLUSTER_ID = 0x0020; // Definitions for cluster: Basic static constexpr chip::ClusterId ZCL_BASIC_CLUSTER_ID = 0x0028; -// Definitions for cluster: OTA Software Update Server -static constexpr chip::ClusterId ZCL_OTA_SERVER_CLUSTER_ID = 0x0029; +// Definitions for cluster: OTA Software Update Provider +static constexpr chip::ClusterId ZCL_OTA_PROVIDER_CLUSTER_ID = 0x0029; -// Definitions for cluster: OTA Software Update Client -static constexpr chip::ClusterId ZCL_OTA_CLIENT_CLUSTER_ID = 0x002A; +// Definitions for cluster: OTA Software Update Requestor +static constexpr chip::ClusterId ZCL_OTA_REQUESTOR_CLUSTER_ID = 0x002A; // Definitions for cluster: General Commissioning static constexpr chip::ClusterId ZCL_GENERAL_COMMISSIONING_CLUSTER_ID = 0x0030; diff --git a/src/app/common/gen/command-id.h b/src/app/common/gen/command-id.h index 6255f361d9a034..5de8fa92c056c3 100644 --- a/src/app/common/gen/command-id.h +++ b/src/app/common/gen/command-id.h @@ -163,15 +163,15 @@ #define ZCL_SHUT_DOWN_COMMAND_ID (0x01) #define ZCL_LEAVE_COMMAND_ID (0x02) -// Commands for cluster: OTA Software Update Server +// Commands for cluster: OTA Software Update Provider #define ZCL_QUERY_IMAGE_COMMAND_ID (0x00) #define ZCL_APPLY_UPDATE_REQUEST_COMMAND_ID (0x01) #define ZCL_NOTIFY_UPDATE_APPLIED_COMMAND_ID (0x02) #define ZCL_QUERY_IMAGE_RESPONSE_COMMAND_ID (0x03) #define ZCL_APPLY_UPDATE_REQUEST_RESPONSE_COMMAND_ID (0x04) -// Commands for cluster: OTA Software Update Client -#define ZCL_ANNOUNCE_OTA_SERVER_COMMAND_ID (0x00) +// Commands for cluster: OTA Software Update Requestor +#define ZCL_ANNOUNCE_OTA_PROVIDER_COMMAND_ID (0x00) // Commands for cluster: General Commissioning #define ZCL_ARM_FAIL_SAFE_COMMAND_ID (0x00) diff --git a/src/app/common/gen/print-cluster.h b/src/app/common/gen/print-cluster.h index c19691418d8adb..3b0287b3a97d4d 100644 --- a/src/app/common/gen/print-cluster.h +++ b/src/app/common/gen/print-cluster.h @@ -120,16 +120,16 @@ #define CHIP_PRINTCLUSTER_BASIC_CLUSTER #endif -#if defined(ZCL_USING_OTA_SERVER_CLUSTER_SERVER) || defined(ZCL_USING_OTA_SERVER_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_OTA_SERVER_CLUSTER { ZCL_OTA_SERVER_CLUSTER_ID, 41, "OTA Software Update Server" }, +#if defined(ZCL_USING_OTA_PROVIDER_CLUSTER_SERVER) || defined(ZCL_USING_OTA_PROVIDER_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_OTA_PROVIDER_CLUSTER { ZCL_OTA_PROVIDER_CLUSTER_ID, 41, "OTA Software Update Provider" }, #else -#define CHIP_PRINTCLUSTER_OTA_SERVER_CLUSTER +#define CHIP_PRINTCLUSTER_OTA_PROVIDER_CLUSTER #endif -#if defined(ZCL_USING_OTA_CLIENT_CLUSTER_SERVER) || defined(ZCL_USING_OTA_CLIENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_OTA_CLIENT_CLUSTER { ZCL_OTA_CLIENT_CLUSTER_ID, 42, "OTA Software Update Client" }, +#if defined(ZCL_USING_OTA_REQUESTOR_CLUSTER_SERVER) || defined(ZCL_USING_OTA_REQUESTOR_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_OTA_REQUESTOR_CLUSTER { ZCL_OTA_REQUESTOR_CLUSTER_ID, 42, "OTA Software Update Requestor" }, #else -#define CHIP_PRINTCLUSTER_OTA_CLIENT_CLUSTER +#define CHIP_PRINTCLUSTER_OTA_REQUESTOR_CLUSTER #endif #if defined(ZCL_USING_GENERAL_COMMISSIONING_CLUSTER_SERVER) || defined(ZCL_USING_GENERAL_COMMISSIONING_CLUSTER_CLIENT) @@ -735,8 +735,8 @@ CHIP_PRINTCLUSTER_DESCRIPTOR_CLUSTER \ CHIP_PRINTCLUSTER_POLL_CONTROL_CLUSTER \ CHIP_PRINTCLUSTER_BASIC_CLUSTER \ - CHIP_PRINTCLUSTER_OTA_SERVER_CLUSTER \ - CHIP_PRINTCLUSTER_OTA_CLIENT_CLUSTER \ + CHIP_PRINTCLUSTER_OTA_PROVIDER_CLUSTER \ + CHIP_PRINTCLUSTER_OTA_REQUESTOR_CLUSTER \ CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER \ CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \ CHIP_PRINTCLUSTER_DIAGNOSTIC_LOGS_CLUSTER \ diff --git a/src/app/util/process-cluster-message.cpp b/src/app/util/process-cluster-message.cpp index a66c4b2403b516..9d4c172d192b5d 100644 --- a/src/app/util/process-cluster-message.cpp +++ b/src/app/util/process-cluster-message.cpp @@ -83,14 +83,14 @@ bool emAfProcessClusterSpecificCommand(EmberAfClusterCommand * cmd) #ifdef ZCL_USING_OTA_BOOTLOAD_CLUSTER_CLIENT if (cmd->apsFrame->clusterId == ZCL_OTA_BOOTLOAD_CLUSTER_ID && cmd->direction == ZCL_DIRECTION_SERVER_TO_CLIENT && - emberAfOtaClientIncomingMessageRawCallback(cmd)) + emberAfOtaRequestorIncomingMessageRawCallback(cmd)) { return true; } #endif #ifdef ZCL_USING_OTA_BOOTLOAD_CLUSTER_SERVER if (cmd->apsFrame->clusterId == ZCL_OTA_BOOTLOAD_CLUSTER_ID && cmd->direction == ZCL_DIRECTION_CLIENT_TO_SERVER && - emberAfOtaServerIncomingMessageRawCallback(cmd)) + emberAfOtaProviderIncomingMessageRawCallback(cmd)) { return true; } diff --git a/src/app/zap-templates/zcl/data-model/chip/chip-ota.xml b/src/app/zap-templates/zcl/data-model/chip/chip-ota.xml index 5f68be3c00617c..2ea38db34f20e1 100644 --- a/src/app/zap-templates/zcl/data-model/chip/chip-ota.xml +++ b/src/app/zap-templates/zcl/data-model/chip/chip-ota.xml @@ -33,11 +33,11 @@ limitations under the License. - OTA Software Update Server + OTA Software Update Provider CHIP 0x0029 - OTA_SERVER_CLUSTER + OTA_PROVIDER_CLUSTER true true @@ -49,8 +49,8 @@ limitations under the License. - - + + Determine next action to take for a new Software Image @@ -58,7 +58,7 @@ limitations under the License. - Notify OTA Server that an update was applied + Notify OTA Provider that an update was applied @@ -70,7 +70,7 @@ limitations under the License. - + Reponse to ApplyUpdateRequest command @@ -84,17 +84,17 @@ limitations under the License. - OTA Software Update Client + OTA Software Update Requestor CHIP TODO 0x002a - OTA_CLIENT_CLUSTER + OTA_REQUESTOR_CLUSTER true true - default ota server + default ota provider update possible - - Notify OTA Server that an update was applied + + Notify OTA Provider that an update was applied diff --git a/src/app/zap_cluster_list.py b/src/app/zap_cluster_list.py index be6bdb079c04ab..cd58d0e72d0a79 100755 --- a/src/app/zap_cluster_list.py +++ b/src/app/zap_cluster_list.py @@ -45,8 +45,8 @@ 'ON_OFF_CLUSTER': ['on-off-server'], 'OPERATIONAL_CREDENTIALS_CLUSTER': ['operational-credentials-server'], 'OTA_BOOTLOAD_CLUSTER': [], - 'OTA_SERVER_CLUSTER': ['ota-server'], - 'OTA_CLIENT_CLUSTER': [], + 'OTA_PROVIDER_CLUSTER': ['ota-provider'], + 'OTA_REQUESTOR_CLUSTER': [], 'POWER_CONFIG_CLUSTER': [], 'PRESSURE_MEASUREMENT_CLUSTER': [], 'PUMP_CONFIG_CONTROL_CLUSTER': ['pump-configuration-and-control-server'], @@ -104,8 +104,8 @@ 'ON_OFF_CLUSTER': [], 'OPERATIONAL_CREDENTIALS_CLUSTER': [], 'OTA_BOOTLOAD_CLUSTER': [], - 'OTA_SERVER_CLUSTER': [], - 'OTA_CLIENT_CLUSTER': ['ota-server'], + 'OTA_PROVIDER_CLUSTER': [], + 'OTA_REQUESTOR_CLUSTER': ['ota-provider'], 'POWER_CONFIG_CLUSTER': [], 'PRESSURE_MEASUREMENT_CLUSTER': [], 'PUMP_CONFIG_CONTROL_CLUSTER': ['pump-configuration-and-control-client'], diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index b70e41edd68fdb..732bf948626c54 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -1376,10 +1376,10 @@ ] }, { - "name": "OTA Software Update Server", + "name": "OTA Software Update Provider", "code": 41, "mfgCode": null, - "define": "OTA_SERVER_CLUSTER", + "define": "OTA_PROVIDER_CLUSTER", "side": "client", "enabled": 1, "commands": [ @@ -1427,10 +1427,10 @@ ] }, { - "name": "OTA Software Update Server", + "name": "OTA Software Update Provider", "code": 41, "mfgCode": null, - "define": "OTA_SERVER_CLUSTER", + "define": "OTA_PROVIDER_CLUSTER", "side": "server", "enabled": 0, "commands": [ diff --git a/src/controller/data_model/gen/CHIPClientCallbacks.cpp b/src/controller/data_model/gen/CHIPClientCallbacks.cpp index 6d9aa6d1f45b54..4f480dc64b1f9e 100644 --- a/src/controller/data_model/gen/CHIPClientCallbacks.cpp +++ b/src/controller/data_model/gen/CHIPClientCallbacks.cpp @@ -2667,25 +2667,26 @@ bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback(chip::a return true; } -bool emberAfOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallback(chip::app::Command * commandObj, uint8_t action, - uint32_t delayedActionTime) +bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback(chip::app::Command * commandObj, uint8_t action, + uint32_t delayedActionTime) { ChipLogProgress(Zcl, "ApplyUpdateRequestResponse:"); ChipLogProgress(Zcl, " action: %" PRIu8 "", action); ChipLogProgress(Zcl, " delayedActionTime: %" PRIu32 "", delayedActionTime); - GET_CLUSTER_RESPONSE_CALLBACKS("OtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallback"); + GET_CLUSTER_RESPONSE_CALLBACKS("OtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback"); - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); cb->mCall(cb->mContext, action, delayedActionTime); return true; } -bool emberAfOtaSoftwareUpdateServerClusterQueryImageResponseCallback(chip::app::Command * commandObj, uint8_t status, - uint32_t delayedActionTime, uint8_t * imageURI, - uint32_t softwareVersion, chip::ByteSpan updateToken, - uint8_t userConsentNeeded, chip::ByteSpan metadataForClient) +bool emberAfOtaSoftwareUpdateProviderClusterQueryImageResponseCallback(chip::app::Command * commandObj, uint8_t status, + uint32_t delayedActionTime, uint8_t * imageURI, + uint32_t softwareVersion, chip::ByteSpan updateToken, + uint8_t userConsentNeeded, + chip::ByteSpan metadataForRequestor) { ChipLogProgress(Zcl, "QueryImageResponse:"); LogStatus(status); @@ -2695,9 +2696,9 @@ bool emberAfOtaSoftwareUpdateServerClusterQueryImageResponseCallback(chip::app:: ChipLogProgress(Zcl, " softwareVersion: %" PRIu32 "", softwareVersion); ChipLogProgress(Zcl, " updateToken: %zu", updateToken.size()); ChipLogProgress(Zcl, " userConsentNeeded: %" PRIu8 "", userConsentNeeded); - ChipLogProgress(Zcl, " metadataForClient: %zu", metadataForClient.size()); + ChipLogProgress(Zcl, " metadataForRequestor: %zu", metadataForRequestor.size()); - GET_CLUSTER_RESPONSE_CALLBACKS("OtaSoftwareUpdateServerClusterQueryImageResponseCallback"); + GET_CLUSTER_RESPONSE_CALLBACKS("OtaSoftwareUpdateProviderClusterQueryImageResponseCallback"); if (status != EMBER_ZCL_STATUS_SUCCESS) { @@ -2707,9 +2708,9 @@ bool emberAfOtaSoftwareUpdateServerClusterQueryImageResponseCallback(chip::app:: return true; } - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, delayedActionTime, imageURI, softwareVersion, updateToken, userConsentNeeded, metadataForClient); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, delayedActionTime, imageURI, softwareVersion, updateToken, userConsentNeeded, metadataForRequestor); return true; } diff --git a/src/controller/data_model/gen/CHIPClientCallbacks.h b/src/controller/data_model/gen/CHIPClientCallbacks.h index b810a0564e531c..f6736eba27e35c 100644 --- a/src/controller/data_model/gen/CHIPClientCallbacks.h +++ b/src/controller/data_model/gen/CHIPClientCallbacks.h @@ -154,12 +154,12 @@ typedef void (*NetworkCommissioningClusterUpdateThreadNetworkResponseCallback)(v uint8_t * debugText); typedef void (*NetworkCommissioningClusterUpdateWiFiNetworkResponseCallback)(void * context, uint8_t errorCode, uint8_t * debugText); -typedef void (*OtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallback)(void * context, uint8_t action, - uint32_t delayedActionTime); -typedef void (*OtaSoftwareUpdateServerClusterQueryImageResponseCallback)(void * context, uint32_t delayedActionTime, - uint8_t * imageURI, uint32_t softwareVersion, - chip::ByteSpan updateToken, uint8_t userConsentNeeded, - chip::ByteSpan metadataForClient); +typedef void (*OtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback)(void * context, uint8_t action, + uint32_t delayedActionTime); +typedef void (*OtaSoftwareUpdateProviderClusterQueryImageResponseCallback)(void * context, uint32_t delayedActionTime, + uint8_t * imageURI, uint32_t softwareVersion, + chip::ByteSpan updateToken, uint8_t userConsentNeeded, + chip::ByteSpan metadataForRequestor); typedef void (*OperationalCredentialsClusterOpCSRResponseCallback)(void * context, chip::ByteSpan CSR, chip::ByteSpan CSRNonce, chip::ByteSpan VendorReserved1, chip::ByteSpan VendorReserved2, chip::ByteSpan VendorReserved3, chip::ByteSpan Signature); diff --git a/src/controller/data_model/gen/CHIPClusters.cpp b/src/controller/data_model/gen/CHIPClusters.cpp index a6cc8e52bcc541..95df537bddf817 100644 --- a/src/controller/data_model/gen/CHIPClusters.cpp +++ b/src/controller/data_model/gen/CHIPClusters.cpp @@ -6625,10 +6625,10 @@ CHIP_ERROR NetworkCommissioningCluster::ReadAttributeClusterRevision(Callback::C BasicAttributeFilter); } -// OtaSoftwareUpdateServer Cluster Commands -CHIP_ERROR OtaSoftwareUpdateServerCluster::ApplyUpdateRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::ByteSpan updateToken, - uint32_t newVersion) +// OtaSoftwareUpdateProvider Cluster Commands +CHIP_ERROR OtaSoftwareUpdateProviderCluster::ApplyUpdateRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + chip::ByteSpan updateToken, uint32_t newVersion) { CHIP_ERROR err = CHIP_NO_ERROR; app::CommandSender * sender = nullptr; @@ -6670,9 +6670,9 @@ CHIP_ERROR OtaSoftwareUpdateServerCluster::ApplyUpdateRequest(Callback::Cancelab return err; } -CHIP_ERROR OtaSoftwareUpdateServerCluster::NotifyUpdateApplied(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::ByteSpan updateToken, - uint32_t currentVersion) +CHIP_ERROR OtaSoftwareUpdateProviderCluster::NotifyUpdateApplied(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + chip::ByteSpan updateToken, uint32_t currentVersion) { CHIP_ERROR err = CHIP_NO_ERROR; app::CommandSender * sender = nullptr; @@ -6714,11 +6714,12 @@ CHIP_ERROR OtaSoftwareUpdateServerCluster::NotifyUpdateApplied(Callback::Cancela return err; } -CHIP_ERROR OtaSoftwareUpdateServerCluster::QueryImage(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t vendorId, - uint16_t productId, uint16_t imageType, uint16_t hardwareVersion, - uint32_t currentVersion, uint8_t protocolsSupported, chip::ByteSpan location, - uint8_t clientCanConsent, chip::ByteSpan metadataForServer) +CHIP_ERROR OtaSoftwareUpdateProviderCluster::QueryImage(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t vendorId, + uint16_t productId, uint16_t imageType, uint16_t hardwareVersion, + uint32_t currentVersion, uint8_t protocolsSupported, + chip::ByteSpan location, uint8_t requestorCanConsent, + chip::ByteSpan metadataForProvider) { CHIP_ERROR err = CHIP_NO_ERROR; app::CommandSender * sender = nullptr; @@ -6753,10 +6754,10 @@ CHIP_ERROR OtaSoftwareUpdateServerCluster::QueryImage(Callback::Cancelable * onS SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), protocolsSupported)); // location: charString SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), location)); - // clientCanConsent: boolean - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), clientCanConsent)); - // metadataForServer: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), metadataForServer)); + // requestorCanConsent: boolean + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), requestorCanConsent)); + // metadataForProvider: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), metadataForProvider)); SuccessOrExit(err = sender->FinishCommand()); @@ -6774,16 +6775,16 @@ CHIP_ERROR OtaSoftwareUpdateServerCluster::QueryImage(Callback::Cancelable * onS return err; } -// OtaSoftwareUpdateServer Cluster Attributes -CHIP_ERROR OtaSoftwareUpdateServerCluster::DiscoverAttributes(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +// OtaSoftwareUpdateProvider Cluster Attributes +CHIP_ERROR OtaSoftwareUpdateProviderCluster::DiscoverAttributes(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { uint8_t seqNum = mDevice->GetNextSequenceNumber(); - System::PacketBufferHandle encodedCommand = encodeOtaSoftwareUpdateServerClusterDiscoverAttributes(seqNum, mEndpoint); + System::PacketBufferHandle encodedCommand = encodeOtaSoftwareUpdateProviderClusterDiscoverAttributes(seqNum, mEndpoint); return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); } -CHIP_ERROR OtaSoftwareUpdateServerCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +CHIP_ERROR OtaSoftwareUpdateProviderCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { chip::app::AttributePathParams attributePath; attributePath.mEndpointId = mEndpoint; diff --git a/src/controller/data_model/gen/CHIPClusters.h b/src/controller/data_model/gen/CHIPClusters.h index ad76e1017c88b2..64ede9e12396b8 100644 --- a/src/controller/data_model/gen/CHIPClusters.h +++ b/src/controller/data_model/gen/CHIPClusters.h @@ -55,7 +55,7 @@ constexpr ClusterId kLowPowerClusterId = 0x0508; constexpr ClusterId kMediaInputClusterId = 0x0507; constexpr ClusterId kMediaPlaybackClusterId = 0x0506; constexpr ClusterId kNetworkCommissioningClusterId = 0x0031; -constexpr ClusterId kOtaSoftwareUpdateServerClusterId = 0x0029; +constexpr ClusterId kOtaSoftwareUpdateProviderClusterId = 0x0029; constexpr ClusterId kOnOffClusterId = 0x0006; constexpr ClusterId kOperationalCredentialsClusterId = 0x003E; constexpr ClusterId kPressureMeasurementClusterId = 0x0403; @@ -937,11 +937,11 @@ class DLL_EXPORT NetworkCommissioningCluster : public ClusterBase static constexpr CommandId kUpdateWiFiNetworkCommandId = 0x04; }; -class DLL_EXPORT OtaSoftwareUpdateServerCluster : public ClusterBase +class DLL_EXPORT OtaSoftwareUpdateProviderCluster : public ClusterBase { public: - OtaSoftwareUpdateServerCluster() : ClusterBase(kOtaSoftwareUpdateServerClusterId) {} - ~OtaSoftwareUpdateServerCluster() {} + OtaSoftwareUpdateProviderCluster() : ClusterBase(kOtaSoftwareUpdateProviderClusterId) {} + ~OtaSoftwareUpdateProviderCluster() {} // Cluster Commands CHIP_ERROR ApplyUpdateRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, @@ -950,8 +950,8 @@ class DLL_EXPORT OtaSoftwareUpdateServerCluster : public ClusterBase chip::ByteSpan updateToken, uint32_t currentVersion); CHIP_ERROR QueryImage(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t vendorId, uint16_t productId, uint16_t imageType, uint16_t hardwareVersion, uint32_t currentVersion, - uint8_t protocolsSupported, chip::ByteSpan location, uint8_t clientCanConsent, - chip::ByteSpan metadataForServer); + uint8_t protocolsSupported, chip::ByteSpan location, uint8_t requestorCanConsent, + chip::ByteSpan metadataForProvider); // Cluster Attributes CHIP_ERROR DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); diff --git a/src/controller/data_model/gen/IMClusterCommandHandler.cpp b/src/controller/data_model/gen/IMClusterCommandHandler.cpp index 58f12884b8a04c..2d24b4ca67f1b3 100644 --- a/src/controller/data_model/gen/IMClusterCommandHandler.cpp +++ b/src/controller/data_model/gen/IMClusterCommandHandler.cpp @@ -4016,7 +4016,7 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En } // namespace NetworkCommissioning -namespace OtaSoftwareUpdateServer { +namespace OtaSoftwareUpdateProvider { void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) { @@ -4092,8 +4092,8 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallback(apCommandObj, action, - delayedActionTime); + wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback(apCommandObj, action, + delayedActionTime); } break; } @@ -4105,7 +4105,7 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En uint32_t softwareVersion; chip::ByteSpan updateToken; uint8_t userConsentNeeded; - chip::ByteSpan metadataForClient; + chip::ByteSpan metadataForRequestor; bool argExists[7]; memset(argExists, 0, sizeof argExists); @@ -4160,7 +4160,7 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En case 6: { const uint8_t * data = nullptr; TLVUnpackError = aDataTlv.GetDataPtr(data); - metadataForClient = chip::ByteSpan(data, aDataTlv.GetLength()); + metadataForRequestor = chip::ByteSpan(data, aDataTlv.GetLength()); } break; default: @@ -4183,9 +4183,9 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 7 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - wasHandled = emberAfOtaSoftwareUpdateServerClusterQueryImageResponseCallback( + wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageResponseCallback( apCommandObj, status, delayedActionTime, const_cast(imageURI), softwareVersion, updateToken, - userConsentNeeded, metadataForClient); + userConsentNeeded, metadataForRequestor); } break; } @@ -4193,12 +4193,12 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En // Unrecognized command ID, error status will apply. chip::app::CommandPathParams returnStatusParam = { aEndpointId, 0, // GroupId - ZCL_OTA_SERVER_CLUSTER_ID, aCommandId, + ZCL_OTA_PROVIDER_CLUSTER_ID, aCommandId, (chip::app::CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command %" PRIx8 " for cluster %" PRIx16, aCommandId, ZCL_OTA_SERVER_CLUSTER_ID); + ChipLogError(Zcl, "Unknown command %" PRIx8 " for cluster %" PRIx16, aCommandId, ZCL_OTA_PROVIDER_CLUSTER_ID); return; } } @@ -4208,7 +4208,7 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En { chip::app::CommandPathParams returnStatusParam = { aEndpointId, 0, // GroupId - ZCL_OTA_SERVER_CLUSTER_ID, aCommandId, + ZCL_OTA_PROVIDER_CLUSTER_ID, aCommandId, (chip::app::CommandPathFlags::kEndpointIdValid) }; apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand); @@ -4219,7 +4219,7 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En } } -} // namespace OtaSoftwareUpdateServer +} // namespace OtaSoftwareUpdateProvider namespace OperationalCredentials { @@ -5346,8 +5346,8 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: clusters::NetworkCommissioning::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; - case ZCL_OTA_SERVER_CLUSTER_ID: - clusters::OtaSoftwareUpdateServer::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); + case ZCL_OTA_PROVIDER_CLUSTER_ID: + clusters::OtaSoftwareUpdateProvider::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID: clusters::OperationalCredentials::DispatchClientCommand(apCommandObj, aCommandId, aEndPointId, aReader); diff --git a/src/controller/data_model/gen/call-command-handler.cpp b/src/controller/data_model/gen/call-command-handler.cpp index 60e3b26efcabf5..7df926241e470e 100644 --- a/src/controller/data_model/gen/call-command-handler.cpp +++ b/src/controller/data_model/gen/call-command-handler.cpp @@ -53,7 +53,7 @@ EmberAfStatus emberAfLowPowerClusterClientCommandParse(EmberAfClusterCommand * c EmberAfStatus emberAfMediaInputClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfMediaPlaybackClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfNetworkCommissioningClusterClientCommandParse(EmberAfClusterCommand * cmd); -EmberAfStatus emberAfOtaSoftwareUpdateServerClusterClientCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfOtaSoftwareUpdateProviderClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfOnOffClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfOperationalCredentialsClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfPumpConfigurationAndControlClusterClientCommandParse(EmberAfClusterCommand * cmd); @@ -192,8 +192,8 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: result = emberAfNetworkCommissioningClusterClientCommandParse(cmd); break; - case ZCL_OTA_SERVER_CLUSTER_ID: - result = emberAfOtaSoftwareUpdateServerClusterClientCommandParse(cmd); + case ZCL_OTA_PROVIDER_CLUSTER_ID: + result = emberAfOtaSoftwareUpdateProviderClusterClientCommandParse(cmd); break; case ZCL_ON_OFF_CLUSTER_ID: // No commands are enabled for cluster On/off @@ -1483,7 +1483,7 @@ EmberAfStatus emberAfNetworkCommissioningClusterClientCommandParse(EmberAfCluste } return status(wasHandled, true, cmd->mfgSpecific); } -EmberAfStatus emberAfOtaSoftwareUpdateServerClusterClientCommandParse(EmberAfClusterCommand * cmd) +EmberAfStatus emberAfOtaSoftwareUpdateProviderClusterClientCommandParse(EmberAfClusterCommand * cmd) { bool wasHandled = false; @@ -1509,7 +1509,7 @@ EmberAfStatus emberAfOtaSoftwareUpdateServerClusterClientCommandParse(EmberAfClu delayedActionTime = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen); wasHandled = - emberAfOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallback(nullptr, action, delayedActionTime); + emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback(nullptr, action, delayedActionTime); break; } case ZCL_QUERY_IMAGE_RESPONSE_COMMAND_ID: { @@ -1520,7 +1520,7 @@ EmberAfStatus emberAfOtaSoftwareUpdateServerClusterClientCommandParse(EmberAfClu uint32_t softwareVersion; chip::ByteSpan updateToken; uint8_t userConsentNeeded; - chip::ByteSpan metadataForClient; + chip::ByteSpan metadataForRequestor; if (cmd->bufLen < payloadOffset + 1) { @@ -1566,12 +1566,13 @@ EmberAfStatus emberAfOtaSoftwareUpdateServerClusterClientCommandParse(EmberAfClu return EMBER_ZCL_STATUS_MALFORMED_COMMAND; } { - uint8_t * rawData = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - metadataForClient = chip::ByteSpan(rawData + 1u, emberAfStringLength(rawData)); + uint8_t * rawData = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); + metadataForRequestor = chip::ByteSpan(rawData + 1u, emberAfStringLength(rawData)); } - wasHandled = emberAfOtaSoftwareUpdateServerClusterQueryImageResponseCallback( - nullptr, status, delayedActionTime, imageURI, softwareVersion, updateToken, userConsentNeeded, metadataForClient); + wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageResponseCallback(nullptr, status, delayedActionTime, + imageURI, softwareVersion, updateToken, + userConsentNeeded, metadataForRequestor); break; } default: { diff --git a/src/controller/data_model/gen/callback-stub.cpp b/src/controller/data_model/gen/callback-stub.cpp index 5d5df6d7aca18e..b73219c6e231b7 100644 --- a/src/controller/data_model/gen/callback-stub.cpp +++ b/src/controller/data_model/gen/callback-stub.cpp @@ -113,8 +113,8 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: emberAfNetworkCommissioningClusterInitCallback(endpoint); break; - case ZCL_OTA_SERVER_CLUSTER_ID: - emberAfOtaSoftwareUpdateServerClusterInitCallback(endpoint); + case ZCL_OTA_PROVIDER_CLUSTER_ID: + emberAfOtaSoftwareUpdateProviderClusterInitCallback(endpoint); break; case ZCL_ON_OFF_CLUSTER_ID: emberAfOnOffClusterInitCallback(endpoint); @@ -313,7 +313,7 @@ void __attribute__((weak)) emberAfNetworkCommissioningClusterInitCallback(Endpoi // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfOtaSoftwareUpdateServerClusterInitCallback(EndpointId endpoint) +void __attribute__((weak)) emberAfOtaSoftwareUpdateProviderClusterInitCallback(EndpointId endpoint) { // To prevent warning (void) endpoint; diff --git a/src/controller/data_model/gen/callback.h b/src/controller/data_model/gen/callback.h index 85d37380057028..63a34a4fd7b393 100644 --- a/src/controller/data_model/gen/callback.h +++ b/src/controller/data_model/gen/callback.h @@ -264,13 +264,13 @@ void emberAfMediaPlaybackClusterInitCallback(chip::EndpointId endpoint); */ void emberAfNetworkCommissioningClusterInitCallback(chip::EndpointId endpoint); -/** @brief OTA Software Update Server Cluster Init +/** @brief OTA Software Update Provider Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfOtaSoftwareUpdateServerClusterInitCallback(chip::EndpointId endpoint); +void emberAfOtaSoftwareUpdateProviderClusterInitCallback(chip::EndpointId endpoint); /** @brief On/off Cluster Init * @@ -2370,27 +2370,28 @@ EmberAfStatus emberAfNetworkCommissioningClusterClientPreAttributeChangedCallbac void emberAfNetworkCommissioningClusterClientTickCallback(chip::EndpointId endpoint); // -// OTA Software Update Server Cluster client +// OTA Software Update Provider Cluster client // -/** @brief OTA Software Update Server Cluster Client Init +/** @brief OTA Software Update Provider Cluster Client Init * * Client Init * * @param endpoint Endpoint that is being initialized */ -void emberAfOtaSoftwareUpdateServerClusterClientInitCallback(chip::EndpointId endpoint); +void emberAfOtaSoftwareUpdateProviderClusterClientInitCallback(chip::EndpointId endpoint); -/** @brief OTA Software Update Server Cluster Client Attribute Changed +/** @brief OTA Software Update Provider Cluster Client Attribute Changed * * Client Attribute Changed * * @param endpoint Endpoint that is being initialized * @param attributeId Attribute that changed */ -void emberAfOtaSoftwareUpdateServerClusterClientAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); +void emberAfOtaSoftwareUpdateProviderClusterClientAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId); -/** @brief OTA Software Update Server Cluster Client Manufacturer Specific Attribute Changed +/** @brief OTA Software Update Provider Cluster Client Manufacturer Specific Attribute Changed * * Client Manufacturer Specific Attribute Changed * @@ -2398,11 +2399,11 @@ void emberAfOtaSoftwareUpdateServerClusterClientAttributeChangedCallback(chip::E * @param attributeId Attribute that changed * @param manufacturerCode Manufacturer Code of the attribute that changed */ -void emberAfOtaSoftwareUpdateServerClusterClientManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); +void emberAfOtaSoftwareUpdateProviderClusterClientManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); -/** @brief OTA Software Update Server Cluster Client Message Sent +/** @brief OTA Software Update Provider Cluster Client Message Sent * * Client Message Sent * @@ -2413,11 +2414,11 @@ void emberAfOtaSoftwareUpdateServerClusterClientManufacturerSpecificAttributeCha * @param message The message that was sent * @param status The status of the sent message */ -void emberAfOtaSoftwareUpdateServerClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfOtaSoftwareUpdateProviderClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); -/** @brief OTA Software Update Server Cluster Client Pre Attribute Changed +/** @brief OTA Software Update Provider Cluster Client Pre Attribute Changed * * client Pre Attribute Changed * @@ -2427,18 +2428,18 @@ void emberAfOtaSoftwareUpdateServerClusterClientMessageSentCallback(const chip:: * @param size Attribute size * @param value Attribute value */ -EmberAfStatus emberAfOtaSoftwareUpdateServerClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - EmberAfAttributeType attributeType, - uint16_t size, uint8_t * value); +EmberAfStatus emberAfOtaSoftwareUpdateProviderClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + EmberAfAttributeType attributeType, + uint16_t size, uint8_t * value); -/** @brief OTA Software Update Server Cluster Client Tick +/** @brief OTA Software Update Provider Cluster Client Tick * * client Tick * * @param endpoint Endpoint that is being served */ -void emberAfOtaSoftwareUpdateServerClusterClientTickCallback(chip::EndpointId endpoint); +void emberAfOtaSoftwareUpdateProviderClusterClientTickCallback(chip::EndpointId endpoint); // // On/off Cluster client @@ -3993,20 +3994,21 @@ bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback(chip::a uint8_t * debugText); /** - * @brief OTA Software Update Server Cluster ApplyUpdateRequestResponse Command callback + * @brief OTA Software Update Provider Cluster ApplyUpdateRequestResponse Command callback */ -bool emberAfOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallback(chip::app::Command * commandObj, uint8_t action, - uint32_t delayedActionTime); +bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback(chip::app::Command * commandObj, uint8_t action, + uint32_t delayedActionTime); /** - * @brief OTA Software Update Server Cluster QueryImageResponse Command callback + * @brief OTA Software Update Provider Cluster QueryImageResponse Command callback */ -bool emberAfOtaSoftwareUpdateServerClusterQueryImageResponseCallback(chip::app::Command * commandObj, uint8_t status, - uint32_t delayedActionTime, uint8_t * imageURI, - uint32_t softwareVersion, chip::ByteSpan updateToken, - uint8_t userConsentNeeded, chip::ByteSpan metadataForClient); +bool emberAfOtaSoftwareUpdateProviderClusterQueryImageResponseCallback(chip::app::Command * commandObj, uint8_t status, + uint32_t delayedActionTime, uint8_t * imageURI, + uint32_t softwareVersion, chip::ByteSpan updateToken, + uint8_t userConsentNeeded, + chip::ByteSpan metadataForRequestor); /** * @brief Operational Credentials Cluster OpCSRResponse Command callback diff --git a/src/controller/data_model/gen/chip-zcl-zpro-codec-api.h b/src/controller/data_model/gen/chip-zcl-zpro-codec-api.h index bacf50a5f31f02..c7e8d2ac5c5665 100644 --- a/src/controller/data_model/gen/chip-zcl-zpro-codec-api.h +++ b/src/controller/data_model/gen/chip-zcl-zpro-codec-api.h @@ -56,7 +56,7 @@ | MediaInput | 0x0507 | | MediaPlayback | 0x0506 | | NetworkCommissioning | 0x0031 | -| OtaSoftwareUpdateServer | 0x0029 | +| OtaSoftwareUpdateProvider | 0x0029 | | OnOff | 0x0006 | | OperationalCredentials | 0x003E | | PressureMeasurement | 0x0403 | @@ -2032,7 +2032,7 @@ chip::System::PacketBufferHandle encodeNetworkCommissioningClusterReadClusterRevisionAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); /*----------------------------------------------------------------------------*\ -| Cluster OtaSoftwareUpdateServer | 0x0029 | +| Cluster OtaSoftwareUpdateProvider | 0x0029 | |------------------------------------------------------------------------------| | Commands: | | | * ApplyUpdateRequest | 0x01 | @@ -2045,17 +2045,18 @@ encodeNetworkCommissioningClusterReadClusterRevisionAttribute(uint8_t seqNum, ch /** * @brief - * Encode a OTA Software Update Server server discover command into buffer including the APS frame + * Encode a OTA Software Update Provider server discover command into buffer including the APS frame */ -chip::System::PacketBufferHandle encodeOtaSoftwareUpdateServerClusterDiscoverAttributes(uint8_t seqNum, - chip::EndpointId destinationEndpoint); +chip::System::PacketBufferHandle encodeOtaSoftwareUpdateProviderClusterDiscoverAttributes(uint8_t seqNum, + chip::EndpointId destinationEndpoint); /** * @brief - * Encode a OTA Software Update Server server read command for the cluster revision attribute into buffer including the APS frame + * Encode a OTA Software Update Provider server read command for the cluster revision attribute into buffer including the APS + * frame */ chip::System::PacketBufferHandle -encodeOtaSoftwareUpdateServerClusterReadClusterRevisionAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); +encodeOtaSoftwareUpdateProviderClusterReadClusterRevisionAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); /*----------------------------------------------------------------------------*\ | Cluster OnOff | 0x0006 | diff --git a/src/controller/data_model/gen/encoder.cpp b/src/controller/data_model/gen/encoder.cpp index 540f45d2c21b46..d7af6e385672df 100644 --- a/src/controller/data_model/gen/encoder.cpp +++ b/src/controller/data_model/gen/encoder.cpp @@ -82,7 +82,7 @@ using namespace chip::Encoding::LittleEndian; | MediaInput | 0x0507 | | MediaPlayback | 0x0506 | | NetworkCommissioning | 0x0031 | -| OtaSoftwareUpdateServer | 0x0029 | +| OtaSoftwareUpdateProvider | 0x0029 | | OnOff | 0x0006 | | OperationalCredentials | 0x003E | | PressureMeasurement | 0x0403 | @@ -281,7 +281,7 @@ using namespace chip::Encoding::LittleEndian; #define ZCL_UPDATE_THREAD_NETWORK_COMMAND_ID (0x08) #define ZCL_UPDATE_WI_FI_NETWORK_COMMAND_ID (0x04) -#define OTA_SERVER_CLUSTER_ID 0x0029 +#define OTA_PROVIDER_CLUSTER_ID 0x0029 #define ZCL_APPLY_UPDATE_REQUEST_COMMAND_ID (0x01) #define ZCL_NOTIFY_UPDATE_APPLIED_COMMAND_ID (0x02) #define ZCL_QUERY_IMAGE_COMMAND_ID (0x00) @@ -3019,7 +3019,7 @@ PacketBufferHandle encodeNetworkCommissioningClusterReadClusterRevisionAttribute } /*----------------------------------------------------------------------------*\ -| Cluster OtaSoftwareUpdateServer | 0x0029 | +| Cluster OtaSoftwareUpdateProvider | 0x0029 | |------------------------------------------------------------------------------| | Commands: | | | * ApplyUpdateRequest | 0x01 | @@ -3030,9 +3030,9 @@ PacketBufferHandle encodeNetworkCommissioningClusterReadClusterRevisionAttribute | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ -PacketBufferHandle encodeOtaSoftwareUpdateServerClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint) +PacketBufferHandle encodeOtaSoftwareUpdateProviderClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint) { - COMMAND_HEADER("DiscoverOtaSoftwareUpdateServerAttributes", OTA_SERVER_CLUSTER_ID); + COMMAND_HEADER("DiscoverOtaSoftwareUpdateProviderAttributes", OTA_PROVIDER_CLUSTER_ID); buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_DISCOVER_ATTRIBUTES_COMMAND_ID).Put16(0x0000).Put8(0xFF); COMMAND_FOOTER(); } @@ -3040,9 +3040,10 @@ PacketBufferHandle encodeOtaSoftwareUpdateServerClusterDiscoverAttributes(uint8_ /* * Attribute ClusterRevision */ -PacketBufferHandle encodeOtaSoftwareUpdateServerClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +PacketBufferHandle encodeOtaSoftwareUpdateProviderClusterReadClusterRevisionAttribute(uint8_t seqNum, + EndpointId destinationEndpoint) { - COMMAND_HEADER("ReadOtaSoftwareUpdateServerClusterRevision", OTA_SERVER_CLUSTER_ID); + COMMAND_HEADER("ReadOtaSoftwareUpdateProviderClusterRevision", OTA_PROVIDER_CLUSTER_ID); buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0xFFFD); COMMAND_FOOTER(); } diff --git a/src/controller/data_model/gen/endpoint_config.h b/src/controller/data_model/gen/endpoint_config.h index f01ce1cb69307a..93ecdf2ac369ee 100644 --- a/src/controller/data_model/gen/endpoint_config.h +++ b/src/controller/data_model/gen/endpoint_config.h @@ -92,7 +92,7 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT) | ZAP_ATTRIBUTE_MASK(SINGLETON), \ ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \ \ - /* Endpoint: 1, Cluster: OTA Software Update Server (client) */ \ + /* Endpoint: 1, Cluster: OTA Software Update Provider (client) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: General Commissioning (client) */ \ @@ -231,7 +231,7 @@ { 0x0028, ZAP_ATTRIBUTE_INDEX(7), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Basic (client) */ \ { \ 0x0029, ZAP_ATTRIBUTE_INDEX(8), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: OTA Software Update Server (client) */ \ + }, /* Endpoint: 1, Cluster: OTA Software Update Provider (client) */ \ { \ 0x0030, ZAP_ATTRIBUTE_INDEX(9), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: General Commissioning (client) */ \ @@ -459,7 +459,7 @@ { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Leave */ \ { 0x0028, 0x00, ZAP_COMMAND_MASK(OUTGOING_CLIENT) }, /* MfgSpecificPing */ \ \ - /* Endpoint: 1, Cluster: OTA Software Update Server (client) */ \ + /* Endpoint: 1, Cluster: OTA Software Update Provider (client) */ \ { 0x0029, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* QueryImage */ \ { 0x0029, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ApplyUpdateRequest */ \ { 0x0029, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* NotifyUpdateApplied */ \ diff --git a/src/controller/data_model/gen/gen_config.h b/src/controller/data_model/gen/gen_config.h index 4e8536dc4e8c90..30ccfde324ce26 100644 --- a/src/controller/data_model/gen/gen_config.h +++ b/src/controller/data_model/gen/gen_config.h @@ -57,7 +57,7 @@ #define EMBER_AF_MEDIA_INPUT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_MEDIA_PLAYBACK_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_CLIENT_ENDPOINT_COUNT (1) -#define EMBER_AF_OTA_SERVER_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_OTA_PROVIDER_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_ON_OFF_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_PRESSURE_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) @@ -190,9 +190,9 @@ #define ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_NETWORK_COMMISSIONING_CLIENT -// Use this macro to check if the client side of the OTA Software Update Server cluster is included -#define ZCL_USING_OTA_SERVER_CLUSTER_CLIENT -#define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_SERVER_CLIENT +// Use this macro to check if the client side of the OTA Software Update Provider cluster is included +#define ZCL_USING_OTA_PROVIDER_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_OTA_SOFTWARE_UPDATE_PROVIDER_CLIENT // Use this macro to check if the client side of the On/off cluster is included #define ZCL_USING_ON_OFF_CLUSTER_CLIENT diff --git a/src/controller/java/gen/CHIPClusters-JNI.cpp b/src/controller/java/gen/CHIPClusters-JNI.cpp index 7e5539dc9c3a2e..2a726ceca91f83 100644 --- a/src/controller/java/gen/CHIPClusters-JNI.cpp +++ b/src/controller/java/gen/CHIPClusters-JNI.cpp @@ -4056,12 +4056,12 @@ class CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback jobject javaCallbackRef; }; -class CHIPOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallback - : public Callback::Callback +class CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback + : public Callback::Callback { public: - CHIPOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) + CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -4076,7 +4076,7 @@ class CHIPOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallback ChipLogError(Zcl, "Could not create global reference for Java callback"); } } - ~CHIPOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallback() + ~CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -4094,11 +4094,11 @@ class CHIPOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallback JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); jobject javaCallbackRef; jmethodID javaMethod; - CHIPOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallback * cppCallback = nullptr; + CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback * cppCallback = nullptr; VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - cppCallback = reinterpret_cast(context); + cppCallback = reinterpret_cast(context); VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); javaCallbackRef = cppCallback->javaCallbackRef; @@ -4125,12 +4125,12 @@ class CHIPOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallback jobject javaCallbackRef; }; -class CHIPOtaSoftwareUpdateServerClusterQueryImageResponseCallback - : public Callback::Callback +class CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback + : public Callback::Callback { public: - CHIPOtaSoftwareUpdateServerClusterQueryImageResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) + CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -4145,7 +4145,7 @@ class CHIPOtaSoftwareUpdateServerClusterQueryImageResponseCallback ChipLogError(Zcl, "Could not create global reference for Java callback"); } } - ~CHIPOtaSoftwareUpdateServerClusterQueryImageResponseCallback() + ~CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -4157,22 +4157,22 @@ class CHIPOtaSoftwareUpdateServerClusterQueryImageResponseCallback }; static void CallbackFn(void * context, uint32_t delayedActionTime, uint8_t * imageURI, uint32_t softwareVersion, - chip::ByteSpan updateToken, uint8_t userConsentNeeded, chip::ByteSpan metadataForClient) + chip::ByteSpan updateToken, uint8_t userConsentNeeded, chip::ByteSpan metadataForRequestor) { StackUnlockGuard unlockGuard(JniReferences::GetInstance().GetStackLock()); CHIP_ERROR err = CHIP_NO_ERROR; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); jobject javaCallbackRef; jmethodID javaMethod; - CHIPOtaSoftwareUpdateServerClusterQueryImageResponseCallback * cppCallback = nullptr; + CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback * cppCallback = nullptr; // ByteSpan is not properly returned yet, temporarily use empty string UtfString imageURIStr(env, ""); jbyteArray updateTokenArr; - jbyteArray metadataForClientArr; + jbyteArray metadataForRequestorArr; VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); - cppCallback = reinterpret_cast(context); + cppCallback = reinterpret_cast(context); VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); javaCallbackRef = cppCallback->javaCallbackRef; @@ -4187,19 +4187,19 @@ class CHIPOtaSoftwareUpdateServerClusterQueryImageResponseCallback env->ExceptionClear(); env->SetByteArrayRegion(updateTokenArr, 0, updateToken.size(), reinterpret_cast(updateToken.data())); VerifyOrExit(!env->ExceptionCheck(), err = CHIP_JNI_ERROR_EXCEPTION_THROWN); - metadataForClientArr = env->NewByteArray(metadataForClient.size()); - VerifyOrExit(metadataForClientArr != nullptr, err = CHIP_ERROR_NO_MEMORY); + metadataForRequestorArr = env->NewByteArray(metadataForRequestor.size()); + VerifyOrExit(metadataForRequestorArr != nullptr, err = CHIP_ERROR_NO_MEMORY); env->ExceptionClear(); - env->SetByteArrayRegion(metadataForClientArr, 0, metadataForClient.size(), - reinterpret_cast(metadataForClient.data())); + env->SetByteArrayRegion(metadataForRequestorArr, 0, metadataForRequestor.size(), + reinterpret_cast(metadataForRequestor.data())); VerifyOrExit(!env->ExceptionCheck(), err = CHIP_JNI_ERROR_EXCEPTION_THROWN); env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(delayedActionTime), imageURIStr.jniValue(), static_cast(softwareVersion), updateTokenArr, static_cast(userConsentNeeded), - metadataForClientArr); + metadataForRequestorArr); env->DeleteLocalRef(updateTokenArr); - env->DeleteLocalRef(metadataForClientArr); + env->DeleteLocalRef(metadataForRequestorArr); exit: if (err != CHIP_NO_ERROR) @@ -9897,30 +9897,30 @@ JNI_METHOD(void, NetworkCommissioningCluster, updateWiFiNetwork) env->CallVoidMethod(callback, method, exception); } } -JNI_METHOD(jlong, OtaSoftwareUpdateServerCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, OtaSoftwareUpdateProviderCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { StackLockGuard lock(JniReferences::GetInstance().GetStackLock()); - OtaSoftwareUpdateServerCluster * cppCluster = new OtaSoftwareUpdateServerCluster(); + OtaSoftwareUpdateProviderCluster * cppCluster = new OtaSoftwareUpdateProviderCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, OtaSoftwareUpdateServerCluster, applyUpdateRequest) +JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, applyUpdateRequest) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray updateToken, jlong newVersion) { StackLockGuard lock(JniReferences::GetInstance().GetStackLock()); CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateServerCluster * cppCluster; + OtaSoftwareUpdateProviderCluster * cppCluster; JniByteArray updateTokenArr(env, updateToken); - CHIPOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallback * onSuccess; + CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback * onSuccess; CHIPDefaultFailureCallback * onFailure; - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - onSuccess = new CHIPOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallback(callback); + onSuccess = new CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback(callback); VerifyOrExit(onSuccess != nullptr, err = CHIP_ERROR_INCORRECT_STATE); onFailure = new CHIPDefaultFailureCallback(callback); VerifyOrExit(onFailure != nullptr, err = CHIP_ERROR_INCORRECT_STATE); @@ -9955,18 +9955,18 @@ JNI_METHOD(void, OtaSoftwareUpdateServerCluster, applyUpdateRequest) env->CallVoidMethod(callback, method, exception); } } -JNI_METHOD(void, OtaSoftwareUpdateServerCluster, notifyUpdateApplied) +JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, notifyUpdateApplied) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray updateToken, jlong currentVersion) { StackLockGuard lock(JniReferences::GetInstance().GetStackLock()); CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateServerCluster * cppCluster; + OtaSoftwareUpdateProviderCluster * cppCluster; JniByteArray updateTokenArr(env, updateToken); CHIPDefaultSuccessCallback * onSuccess; CHIPDefaultFailureCallback * onFailure; - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); onSuccess = new CHIPDefaultSuccessCallback(callback); @@ -10004,32 +10004,32 @@ JNI_METHOD(void, OtaSoftwareUpdateServerCluster, notifyUpdateApplied) env->CallVoidMethod(callback, method, exception); } } -JNI_METHOD(void, OtaSoftwareUpdateServerCluster, queryImage) +JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, queryImage) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint vendorId, jint productId, jint imageType, - jint hardwareVersion, jlong currentVersion, jint protocolsSupported, jstring location, jint clientCanConsent, - jbyteArray metadataForServer) + jint hardwareVersion, jlong currentVersion, jint protocolsSupported, jstring location, jint requestorCanConsent, + jbyteArray metadataForProvider) { StackLockGuard lock(JniReferences::GetInstance().GetStackLock()); CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateServerCluster * cppCluster; + OtaSoftwareUpdateProviderCluster * cppCluster; JniUtfString locationStr(env, location); - JniByteArray metadataForServerArr(env, metadataForServer); - CHIPOtaSoftwareUpdateServerClusterQueryImageResponseCallback * onSuccess; + JniByteArray metadataForProviderArr(env, metadataForProvider); + CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback * onSuccess; CHIPDefaultFailureCallback * onFailure; - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - onSuccess = new CHIPOtaSoftwareUpdateServerClusterQueryImageResponseCallback(callback); + onSuccess = new CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback(callback); VerifyOrExit(onSuccess != nullptr, err = CHIP_ERROR_INCORRECT_STATE); onFailure = new CHIPDefaultFailureCallback(callback); VerifyOrExit(onFailure != nullptr, err = CHIP_ERROR_INCORRECT_STATE); err = cppCluster->QueryImage(onSuccess->Cancel(), onFailure->Cancel(), vendorId, productId, imageType, hardwareVersion, currentVersion, protocolsSupported, - chip::ByteSpan((const uint8_t *) location, strlen(locationStr.c_str())), clientCanConsent, - chip::ByteSpan((const uint8_t *) metadataForServerArr.data(), metadataForServerArr.size())); + chip::ByteSpan((const uint8_t *) location, strlen(locationStr.c_str())), requestorCanConsent, + chip::ByteSpan((const uint8_t *) metadataForProviderArr.data(), metadataForProviderArr.size())); SuccessOrExit(err); exit: diff --git a/src/controller/java/gen/ChipClusters.java b/src/controller/java/gen/ChipClusters.java index bfa89b9ed540d5..8e1452fb6dc8cd 100644 --- a/src/controller/java/gen/ChipClusters.java +++ b/src/controller/java/gen/ChipClusters.java @@ -1754,8 +1754,8 @@ public interface UpdateWiFiNetworkResponseCallback { } } - public static class OtaSoftwareUpdateServerCluster extends BaseChipCluster { - public OtaSoftwareUpdateServerCluster(long devicePtr, int endpointId) { + public static class OtaSoftwareUpdateProviderCluster extends BaseChipCluster { + public OtaSoftwareUpdateProviderCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @@ -1781,8 +1781,8 @@ public void queryImage( long currentVersion, int protocolsSupported, String location, - int clientCanConsent, - byte[] metadataForServer) { + int requestorCanConsent, + byte[] metadataForProvider) { queryImage( chipClusterPtr, callback, @@ -1793,8 +1793,8 @@ public void queryImage( currentVersion, protocolsSupported, location, - clientCanConsent, - metadataForServer); + requestorCanConsent, + metadataForProvider); } private native void applyUpdateRequest( @@ -1819,8 +1819,8 @@ private native void queryImage( long currentVersion, int protocolsSupported, String location, - int clientCanConsent, - byte[] metadataForServer); + int requestorCanConsent, + byte[] metadataForProvider); public interface ApplyUpdateRequestResponseCallback { void onSuccess(int action, long delayedActionTime); @@ -1835,7 +1835,7 @@ void onSuccess( long softwareVersion, byte[] updateToken, int userConsentNeeded, - byte[] metadataForClient); + byte[] metadataForRequestor); void onError(Exception error); } diff --git a/src/controller/python/chip/clusters/CHIPClusters.cpp b/src/controller/python/chip/clusters/CHIPClusters.cpp index a4b72441f76205..9f82670db71fcf 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.cpp +++ b/src/controller/python/chip/clusters/CHIPClusters.cpp @@ -2966,52 +2966,52 @@ CHIP_ERROR chip_ime_ReadAttribute_NetworkCommissioning_ClusterRevision(chip::Con } // End of Cluster NetworkCommissioning -// Cluster OtaSoftwareUpdateServer +// Cluster OtaSoftwareUpdateProvider -CHIP_ERROR chip_ime_AppendCommand_OtaSoftwareUpdateServer_ApplyUpdateRequest(chip::Controller::Device * device, - chip::EndpointId ZCLendpointId, chip::GroupId, - const uint8_t * updateToken, uint32_t updateToken_Len, - uint32_t newVersion) +CHIP_ERROR chip_ime_AppendCommand_OtaSoftwareUpdateProvider_ApplyUpdateRequest(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + const uint8_t * updateToken, + uint32_t updateToken_Len, uint32_t newVersion) { VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - chip::Controller::OtaSoftwareUpdateServerCluster cluster; + chip::Controller::OtaSoftwareUpdateProviderCluster cluster; cluster.Associate(device, ZCLendpointId); return cluster.ApplyUpdateRequest(nullptr, nullptr, chip::ByteSpan(updateToken, updateToken_Len), newVersion); } -CHIP_ERROR chip_ime_AppendCommand_OtaSoftwareUpdateServer_NotifyUpdateApplied(chip::Controller::Device * device, - chip::EndpointId ZCLendpointId, chip::GroupId, - const uint8_t * updateToken, uint32_t updateToken_Len, - uint32_t currentVersion) +CHIP_ERROR chip_ime_AppendCommand_OtaSoftwareUpdateProvider_NotifyUpdateApplied(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + const uint8_t * updateToken, + uint32_t updateToken_Len, uint32_t currentVersion) { VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - chip::Controller::OtaSoftwareUpdateServerCluster cluster; + chip::Controller::OtaSoftwareUpdateProviderCluster cluster; cluster.Associate(device, ZCLendpointId); return cluster.NotifyUpdateApplied(nullptr, nullptr, chip::ByteSpan(updateToken, updateToken_Len), currentVersion); } -CHIP_ERROR chip_ime_AppendCommand_OtaSoftwareUpdateServer_QueryImage( +CHIP_ERROR chip_ime_AppendCommand_OtaSoftwareUpdateProvider_QueryImage( chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId, uint16_t vendorId, uint16_t productId, uint16_t imageType, uint16_t hardwareVersion, uint32_t currentVersion, uint8_t protocolsSupported, const uint8_t * location, - uint32_t location_Len, uint8_t clientCanConsent, const uint8_t * metadataForServer, uint32_t metadataForServer_Len) + uint32_t location_Len, uint8_t requestorCanConsent, const uint8_t * metadataForProvider, uint32_t metadataForProvider_Len) { VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - chip::Controller::OtaSoftwareUpdateServerCluster cluster; + chip::Controller::OtaSoftwareUpdateProviderCluster cluster; cluster.Associate(device, ZCLendpointId); return cluster.QueryImage(nullptr, nullptr, vendorId, productId, imageType, hardwareVersion, currentVersion, protocolsSupported, - chip::ByteSpan(location, location_Len), clientCanConsent, - chip::ByteSpan(metadataForServer, metadataForServer_Len)); + chip::ByteSpan(location, location_Len), requestorCanConsent, + chip::ByteSpan(metadataForProvider, metadataForProvider_Len)); } -CHIP_ERROR chip_ime_ReadAttribute_OtaSoftwareUpdateServer_ClusterRevision(chip::Controller::Device * device, - chip::EndpointId ZCLendpointId, - chip::GroupId /* ZCLgroupId */) +CHIP_ERROR chip_ime_ReadAttribute_OtaSoftwareUpdateProvider_ClusterRevision(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) { VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - chip::Controller::OtaSoftwareUpdateServerCluster cluster; + chip::Controller::OtaSoftwareUpdateProviderCluster cluster; cluster.Associate(device, ZCLendpointId); return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); } -// End of Cluster OtaSoftwareUpdateServer +// End of Cluster OtaSoftwareUpdateProvider // Cluster OnOff CHIP_ERROR chip_ime_AppendCommand_OnOff_Off(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index cb1d3ca286a35a..ca221829f40a51 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -496,7 +496,7 @@ def ListClusterCommands(self): "timeoutMs": "int", }, }, - "OtaSoftwareUpdateServer": { + "OtaSoftwareUpdateProvider": { "ApplyUpdateRequest": { "updateToken": "bytes", "newVersion": "int", @@ -513,8 +513,8 @@ def ListClusterCommands(self): "currentVersion": "int", "protocolsSupported": "int", "location": "str", - "clientCanConsent": "int", - "metadataForServer": "bytes", + "requestorCanConsent": "int", + "metadataForProvider": "bytes", }, }, "OnOff": { @@ -1383,7 +1383,7 @@ def ListClusterAttributes(self): "type": "int", }, }, - "OtaSoftwareUpdateServer": { + "OtaSoftwareUpdateProvider": { "ClusterRevision": { "attributeId": 0xFFFD, "type": "int", @@ -2553,18 +2553,18 @@ def ClusterNetworkCommissioning_CommandUpdateWiFiNetwork(self, device: ctypes.c_ return self._chipLib.chip_ime_AppendCommand_NetworkCommissioning_UpdateWiFiNetwork( device, ZCLendpoint, ZCLgroupid, ssid, len(ssid), credentials, len(credentials), breadcrumb, timeoutMs ) - def ClusterOtaSoftwareUpdateServer_CommandApplyUpdateRequest(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, updateToken: bytes, newVersion: int): - return self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateServer_ApplyUpdateRequest( + def ClusterOtaSoftwareUpdateProvider_CommandApplyUpdateRequest(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, updateToken: bytes, newVersion: int): + return self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateProvider_ApplyUpdateRequest( device, ZCLendpoint, ZCLgroupid, updateToken, len(updateToken), newVersion ) - def ClusterOtaSoftwareUpdateServer_CommandNotifyUpdateApplied(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, updateToken: bytes, currentVersion: int): - return self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateServer_NotifyUpdateApplied( + def ClusterOtaSoftwareUpdateProvider_CommandNotifyUpdateApplied(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, updateToken: bytes, currentVersion: int): + return self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateProvider_NotifyUpdateApplied( device, ZCLendpoint, ZCLgroupid, updateToken, len(updateToken), currentVersion ) - def ClusterOtaSoftwareUpdateServer_CommandQueryImage(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, vendorId: int, productId: int, imageType: int, hardwareVersion: int, currentVersion: int, protocolsSupported: int, location: bytes, clientCanConsent: int, metadataForServer: bytes): + def ClusterOtaSoftwareUpdateProvider_CommandQueryImage(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, vendorId: int, productId: int, imageType: int, hardwareVersion: int, currentVersion: int, protocolsSupported: int, location: bytes, requestorCanConsent: int, metadataForProvider: bytes): location = location.encode("utf-8") + b'\x00' - return self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateServer_QueryImage( - device, ZCLendpoint, ZCLgroupid, vendorId, productId, imageType, hardwareVersion, currentVersion, protocolsSupported, location, len(location), clientCanConsent, metadataForServer, len(metadataForServer) + return self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateProvider_QueryImage( + device, ZCLendpoint, ZCLgroupid, vendorId, productId, imageType, hardwareVersion, currentVersion, protocolsSupported, location, len(location), requestorCanConsent, metadataForProvider, len(metadataForProvider) ) def ClusterOnOff_CommandOff(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_AppendCommand_OnOff_Off( @@ -3102,8 +3102,8 @@ def ClusterMediaPlayback_ReadAttributeClusterRevision(self, device: ctypes.c_voi return self._chipLib.chip_ime_ReadAttribute_MediaPlayback_ClusterRevision(device, ZCLendpoint, ZCLgroupid) def ClusterNetworkCommissioning_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_NetworkCommissioning_ClusterRevision(device, ZCLendpoint, ZCLgroupid) - def ClusterOtaSoftwareUpdateServer_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): - return self._chipLib.chip_ime_ReadAttribute_OtaSoftwareUpdateServer_ClusterRevision(device, ZCLendpoint, ZCLgroupid) + def ClusterOtaSoftwareUpdateProvider_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_OtaSoftwareUpdateProvider_ClusterRevision(device, ZCLendpoint, ZCLgroupid) def ClusterOnOff_ReadAttributeOnOff(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_OnOff_OnOff(device, ZCLendpoint, ZCLgroupid) def ClusterOnOff_ConfigureAttributeOnOff(self, device: ctypes.c_void_p, ZCLendpoint: int, minInterval: int, maxInterval: int, change: int): @@ -4390,19 +4390,19 @@ def InitLib(self, chipLib): # Cluster NetworkCommissioning ReadAttribute ClusterRevision self._chipLib.chip_ime_ReadAttribute_NetworkCommissioning_ClusterRevision.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_NetworkCommissioning_ClusterRevision.restype = ctypes.c_uint32 - # Cluster OtaSoftwareUpdateServer - # Cluster OtaSoftwareUpdateServer Command ApplyUpdateRequest - self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateServer_ApplyUpdateRequest.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_char_p, ctypes.c_uint32, ctypes.c_uint32] - self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateServer_ApplyUpdateRequest.restype = ctypes.c_uint32 - # Cluster OtaSoftwareUpdateServer Command NotifyUpdateApplied - self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateServer_NotifyUpdateApplied.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_char_p, ctypes.c_uint32, ctypes.c_uint32] - self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateServer_NotifyUpdateApplied.restype = ctypes.c_uint32 - # Cluster OtaSoftwareUpdateServer Command QueryImage - self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateServer_QueryImage.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint16, ctypes.c_uint16, ctypes.c_uint16, ctypes.c_uint16, ctypes.c_uint32, ctypes.c_uint8, ctypes.c_char_p, ctypes.c_uint32, ctypes.c_uint8, ctypes.c_char_p, ctypes.c_uint32] - self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateServer_QueryImage.restype = ctypes.c_uint32 - # Cluster OtaSoftwareUpdateServer ReadAttribute ClusterRevision - self._chipLib.chip_ime_ReadAttribute_OtaSoftwareUpdateServer_ClusterRevision.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] - self._chipLib.chip_ime_ReadAttribute_OtaSoftwareUpdateServer_ClusterRevision.restype = ctypes.c_uint32 + # Cluster OtaSoftwareUpdateProvider + # Cluster OtaSoftwareUpdateProvider Command ApplyUpdateRequest + self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateProvider_ApplyUpdateRequest.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_char_p, ctypes.c_uint32, ctypes.c_uint32] + self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateProvider_ApplyUpdateRequest.restype = ctypes.c_uint32 + # Cluster OtaSoftwareUpdateProvider Command NotifyUpdateApplied + self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateProvider_NotifyUpdateApplied.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_char_p, ctypes.c_uint32, ctypes.c_uint32] + self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateProvider_NotifyUpdateApplied.restype = ctypes.c_uint32 + # Cluster OtaSoftwareUpdateProvider Command QueryImage + self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateProvider_QueryImage.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint16, ctypes.c_uint16, ctypes.c_uint16, ctypes.c_uint16, ctypes.c_uint32, ctypes.c_uint8, ctypes.c_char_p, ctypes.c_uint32, ctypes.c_uint8, ctypes.c_char_p, ctypes.c_uint32] + self._chipLib.chip_ime_AppendCommand_OtaSoftwareUpdateProvider_QueryImage.restype = ctypes.c_uint32 + # Cluster OtaSoftwareUpdateProvider ReadAttribute ClusterRevision + self._chipLib.chip_ime_ReadAttribute_OtaSoftwareUpdateProvider_ClusterRevision.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_OtaSoftwareUpdateProvider_ClusterRevision.restype = ctypes.c_uint32 # Cluster OnOff # Cluster OnOff Command Off self._chipLib.chip_ime_AppendCommand_OnOff_Off.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] diff --git a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h index f8e2af30ee6c8a..58d22671ebfe42 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h @@ -779,25 +779,25 @@ NS_ASSUME_NONNULL_BEGIN @end /** - * Cluster OTA Software Update Server + * Cluster OTA Software Update Provider * */ -@interface CHIPOtaSoftwareUpdateServer : CHIPCluster +@interface CHIPOtaSoftwareUpdateProvider : CHIPCluster - (void)applyUpdateRequest:(NSData *)updateToken newVersion:(uint32_t)newVersion responseHandler:(ResponseHandler)responseHandler; - (void)notifyUpdateApplied:(NSData *)updateToken currentVersion:(uint32_t)currentVersion responseHandler:(ResponseHandler)responseHandler; - (void)queryImage:(uint16_t)vendorId - productId:(uint16_t)productId - imageType:(uint16_t)imageType - hardwareVersion:(uint16_t)hardwareVersion - currentVersion:(uint32_t)currentVersion - protocolsSupported:(uint8_t)protocolsSupported - location:(NSString *)location - clientCanConsent:(uint8_t)clientCanConsent - metadataForServer:(NSData *)metadataForServer - responseHandler:(ResponseHandler)responseHandler; + productId:(uint16_t)productId + imageType:(uint16_t)imageType + hardwareVersion:(uint16_t)hardwareVersion + currentVersion:(uint32_t)currentVersion + protocolsSupported:(uint8_t)protocolsSupported + location:(NSString *)location + requestorCanConsent:(uint8_t)requestorCanConsent + metadataForProvider:(NSData *)metadataForProvider + responseHandler:(ResponseHandler)responseHandler; - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; diff --git a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm index 88a0b6cc5e6f74..9e9470a362cb52 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm @@ -2183,22 +2183,22 @@ static void CallbackFn(void * context, uint8_t errorCode, uint8_t * debugText) dispatch_queue_t mQueue; }; -class CHIPOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallbackBridge - : public Callback::Callback { +class CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallbackBridge + : public Callback::Callback { public: - CHIPOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) - : Callback::Callback(CallbackFn, this) + CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) , mHandler(handler) , mQueue(queue) { } - ~CHIPOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallbackBridge() {}; + ~CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallbackBridge() {}; static void CallbackFn(void * context, uint8_t action, uint32_t delayedActionTime) { - CHIPOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallbackBridge * callback - = reinterpret_cast(context); + CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallbackBridge * callback + = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ callback->mHandler(nil, @ { @@ -2216,23 +2216,23 @@ static void CallbackFn(void * context, uint8_t action, uint32_t delayedActionTim dispatch_queue_t mQueue; }; -class CHIPOtaSoftwareUpdateServerClusterQueryImageResponseCallbackBridge - : public Callback::Callback { +class CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallbackBridge + : public Callback::Callback { public: - CHIPOtaSoftwareUpdateServerClusterQueryImageResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) - : Callback::Callback(CallbackFn, this) + CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) , mHandler(handler) , mQueue(queue) { } - ~CHIPOtaSoftwareUpdateServerClusterQueryImageResponseCallbackBridge() {}; + ~CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallbackBridge() {}; static void CallbackFn(void * context, uint32_t delayedActionTime, uint8_t * imageURI, uint32_t softwareVersion, - chip::ByteSpan updateToken, uint8_t userConsentNeeded, chip::ByteSpan metadataForClient) + chip::ByteSpan updateToken, uint8_t userConsentNeeded, chip::ByteSpan metadataForRequestor) { - CHIPOtaSoftwareUpdateServerClusterQueryImageResponseCallbackBridge * callback - = reinterpret_cast(context); + CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallbackBridge * callback + = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ callback->mHandler(nil, @ { @@ -2241,7 +2241,7 @@ static void CallbackFn(void * context, uint32_t delayedActionTime, uint8_t * ima @"softwareVersion" : [NSNumber numberWithUnsignedLong:softwareVersion], @"updateToken" : [NSData dataWithBytes:updateToken.data() length:updateToken.size()], @"userConsentNeeded" : [NSNumber numberWithUnsignedChar:userConsentNeeded], - @"metadataForClient" : [NSData dataWithBytes:metadataForClient.data() length:metadataForClient.size()], + @"metadataForRequestor" : [NSData dataWithBytes:metadataForRequestor.data() length:metadataForRequestor.size()], }); callback->Cancel(); delete callback; @@ -11996,11 +11996,11 @@ - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)respons @end -@interface CHIPOtaSoftwareUpdateServer () -@property (readonly) Controller::OtaSoftwareUpdateServerCluster cppCluster; +@interface CHIPOtaSoftwareUpdateProvider () +@property (readonly) Controller::OtaSoftwareUpdateProviderCluster cppCluster; @end -@implementation CHIPOtaSoftwareUpdateServer +@implementation CHIPOtaSoftwareUpdateProvider - (Controller::ClusterBase *)getCluster { @@ -12009,8 +12009,8 @@ @implementation CHIPOtaSoftwareUpdateServer - (void)applyUpdateRequest:(NSData *)updateToken newVersion:(uint32_t)newVersion responseHandler:(ResponseHandler)responseHandler { - CHIPOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallbackBridge * onSuccess - = new CHIPOtaSoftwareUpdateServerClusterApplyUpdateRequestResponseCallbackBridge(responseHandler, [self callbackQueue]); + CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallbackBridge * onSuccess + = new CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; @@ -12065,18 +12065,18 @@ - (void)notifyUpdateApplied:(NSData *)updateToken } } - (void)queryImage:(uint16_t)vendorId - productId:(uint16_t)productId - imageType:(uint16_t)imageType - hardwareVersion:(uint16_t)hardwareVersion - currentVersion:(uint32_t)currentVersion - protocolsSupported:(uint8_t)protocolsSupported - location:(NSString *)location - clientCanConsent:(uint8_t)clientCanConsent - metadataForServer:(NSData *)metadataForServer - responseHandler:(ResponseHandler)responseHandler + productId:(uint16_t)productId + imageType:(uint16_t)imageType + hardwareVersion:(uint16_t)hardwareVersion + currentVersion:(uint32_t)currentVersion + protocolsSupported:(uint8_t)protocolsSupported + location:(NSString *)location + requestorCanConsent:(uint8_t)requestorCanConsent + metadataForProvider:(NSData *)metadataForProvider + responseHandler:(ResponseHandler)responseHandler { - CHIPOtaSoftwareUpdateServerClusterQueryImageResponseCallbackBridge * onSuccess - = new CHIPOtaSoftwareUpdateServerClusterQueryImageResponseCallbackBridge(responseHandler, [self callbackQueue]); + CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallbackBridge * onSuccess + = new CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; @@ -12095,7 +12095,7 @@ - (void)queryImage:(uint16_t)vendorId currentVersion, protocolsSupported, chip::ByteSpan((const uint8_t *) [location dataUsingEncoding:NSUTF8StringEncoding].bytes, [location lengthOfBytesUsingEncoding:NSUTF8StringEncoding]), - clientCanConsent, chip::ByteSpan((const uint8_t *) metadataForServer.bytes, metadataForServer.length)); + requestorCanConsent, chip::ByteSpan((const uint8_t *) metadataForProvider.bytes, metadataForProvider.length)); }); if (err != CHIP_NO_ERROR) { diff --git a/src/darwin/Framework/CHIP/templates/helper.js b/src/darwin/Framework/CHIP/templates/helper.js index bae955582afdd0..86f540f185a36f 100644 --- a/src/darwin/Framework/CHIP/templates/helper.js +++ b/src/darwin/Framework/CHIP/templates/helper.js @@ -40,7 +40,7 @@ function asExpectedEndpointForCluster(clusterName) case 'NetworkCommissioning': case 'OperationalCredentials': case 'TrustedRootCertificates': - case 'OtaSoftwareUpdateServer': + case 'OtaSoftwareUpdateProvider': return 0; } return 1; diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index ef344228467d6a..4ac59b6403c8c9 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -5798,18 +5798,18 @@ - (void)testSendClusterNetworkCommissioningReadAttributeClusterRevisionWithRespo [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterOtaSoftwareUpdateServerReadAttributeClusterRevisionWithResponseHandler +- (void)testSendClusterOtaSoftwareUpdateProviderReadAttributeClusterRevisionWithResponseHandler { XCTestExpectation * expectation = - [self expectationWithDescription:@"OtaSoftwareUpdateServerReadAttributeClusterRevisionWithResponseHandler"]; + [self expectationWithDescription:@"OtaSoftwareUpdateProviderReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPOtaSoftwareUpdateServer * cluster = [[CHIPOtaSoftwareUpdateServer alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"OtaSoftwareUpdateServer ClusterRevision Error: %@", err); + NSLog(@"OtaSoftwareUpdateProvider ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; }];