diff --git a/src/app/clusters/ota-provider/ota-provider.cpp b/src/app/clusters/ota-provider/ota-provider.cpp index 3676a98304d9f4..bfe5430e06a77e 100644 --- a/src/app/clusters/ota-provider/ota-provider.cpp +++ b/src/app/clusters/ota-provider/ota-provider.cpp @@ -33,6 +33,14 @@ using namespace chip::app::Clusters; using namespace chip::app::Clusters::OtaSoftwareUpdateProvider; using chip::app::Clusters::OTAProviderDelegate; +// EMBER_AF_OTA_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT is only defined if the +// cluster is actually enabled in the ZAP config. To allow operation in setups +// where that's not the case (and custom dispatch is used), define it here as +// needed. +#ifndef EMBER_AF_OTA_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT +#define EMBER_AF_OTA_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT 0 +#endif // EMBER_AF_OTA_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT + static constexpr size_t kOtaProviderDelegateTableSize = EMBER_AF_OTA_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT; @@ -66,11 +74,7 @@ bool SendStatusIfDelegateNull(EndpointId endpoint) * @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. - * - * @param updateToken Identifier for the Software Image to be applied. Should be 32 octets long. - * @param newVersion The SoftwareVersion value of the new Software Image that the client is ready to apply. */ - bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback( app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::ApplyUpdateRequest::DecodableType & commandData) @@ -109,13 +113,7 @@ bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback( /** * @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 softwareVersion The current SoftwareVersion value. Should match the SoftwarVersion attribute in the - * OTA Requestor's Basic Information Cluster. */ - bool emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback( app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::NotifyUpdateApplied::DecodableType & commandData) @@ -154,21 +152,7 @@ bool emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback( /** * @brief OTA Software Update Provider Cluster QueryImage Command callback - * - * @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 softwareVersion 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 Requestor which is capable of obtaining user consent for OTA application. - * @param metadataForProvider Optional, max 512 octets. A TLV-encoded Vendor-specific payload. */ - bool emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::QueryImage::DecodableType & commandData) diff --git a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj index 335b2bed301d3f..66bfdc6837ade7 100644 --- a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj @@ -47,6 +47,7 @@ 5129BCFD26A9EE3300122DDF /* CHIPError.h in Headers */ = {isa = PBXBuildFile; fileRef = 5129BCFC26A9EE3300122DDF /* CHIPError.h */; settings = {ATTRIBUTES = (Public, ); }; }; 513DDB862761F69300DAA01A /* CHIPAttributeTLVValueDecoder_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 513DDB852761F69300DAA01A /* CHIPAttributeTLVValueDecoder_Internal.h */; }; 513DDB8A2761F6F900DAA01A /* CHIPAttributeTLVValueDecoder.mm in Sources */ = {isa = PBXBuildFile; fileRef = 513DDB892761F6F900DAA01A /* CHIPAttributeTLVValueDecoder.mm */; }; + 51431AFB27D29CA4008A7943 /* ota-provider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51431AFA27D29CA4008A7943 /* ota-provider.cpp */; }; 51B22C1E2740CB0A008D5055 /* CHIPStructsObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B22C1D2740CB0A008D5055 /* CHIPStructsObjc.h */; settings = {ATTRIBUTES = (Public, ); }; }; 51B22C222740CB1D008D5055 /* CHIPCommandPayloadsObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B22C212740CB1D008D5055 /* CHIPCommandPayloadsObjc.h */; settings = {ATTRIBUTES = (Public, ); }; }; 51B22C262740CB32008D5055 /* CHIPStructsObjc.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51B22C252740CB32008D5055 /* CHIPStructsObjc.mm */; }; @@ -149,6 +150,7 @@ 5129BCFC26A9EE3300122DDF /* CHIPError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CHIPError.h; path = CHIP/CHIPError.h; sourceTree = ""; }; 513DDB852761F69300DAA01A /* CHIPAttributeTLVValueDecoder_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CHIPAttributeTLVValueDecoder_Internal.h; sourceTree = ""; }; 513DDB892761F6F900DAA01A /* CHIPAttributeTLVValueDecoder.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CHIPAttributeTLVValueDecoder.mm; path = "zap-generated/CHIPAttributeTLVValueDecoder.mm"; sourceTree = ""; }; + 51431AFA27D29CA4008A7943 /* ota-provider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "ota-provider.cpp"; path = "../../../app/clusters/ota-provider/ota-provider.cpp"; sourceTree = ""; }; 51B22C1D2740CB0A008D5055 /* CHIPStructsObjc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CHIPStructsObjc.h; path = "zap-generated/CHIPStructsObjc.h"; sourceTree = ""; }; 51B22C212740CB1D008D5055 /* CHIPCommandPayloadsObjc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CHIPCommandPayloadsObjc.h; path = "zap-generated/CHIPCommandPayloadsObjc.h"; sourceTree = ""; }; 51B22C252740CB32008D5055 /* CHIPStructsObjc.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CHIPStructsObjc.mm; path = "zap-generated/CHIPStructsObjc.mm"; sourceTree = ""; }; @@ -229,6 +231,7 @@ isa = PBXGroup; children = ( 2FD775542695557E00FF4B12 /* error-mapping.cpp */, + 51431AFA27D29CA4008A7943 /* ota-provider.cpp */, 1E85731926551A490050A4D9 /* af-event.cpp */, 1E85731F26551A490050A4D9 /* attribute-size-util.cpp */, 1E85731626551A490050A4D9 /* attribute-storage.cpp */, @@ -578,6 +581,7 @@ 5A6FEC9827B5C6AF00F25F42 /* CHIPDeviceOverXPC.m in Sources */, 1E85732826551A490050A4D9 /* attribute-table.cpp in Sources */, 5A830D6E27CFCFF90053B85D /* CHIPDeviceControllerOverXPC+AttributeCache.m in Sources */, + 51431AFB27D29CA4008A7943 /* ota-provider.cpp in Sources */, 1E85732626551A490050A4D9 /* attribute-storage.cpp in Sources */, 1E85732C26551A490050A4D9 /* DataModelHandler.cpp in Sources */, ); diff --git a/src/platform/Darwin/CHIPDevicePlatformConfig.h b/src/platform/Darwin/CHIPDevicePlatformConfig.h index b9b2f4d7133c30..2912fd016b4ec8 100644 --- a/src/platform/Darwin/CHIPDevicePlatformConfig.h +++ b/src/platform/Darwin/CHIPDevicePlatformConfig.h @@ -79,3 +79,10 @@ // TODO: CHIP has redesigned the crypto interface, pending on the final version of CHIP HASH APIs #define CHIP_DEVICE_CONFIG_LOG_PROVISIONING_HASH 0 + +// Reserve a single dynamic endpoint that we can use to host things like OTA +// Provider server. +#if !defined(CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) || CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT == 0 +#undef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT +#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT 1 +#endif // CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT