diff --git a/.github/actions/bootstrap-cache/action.yaml b/.github/actions/bootstrap-cache/action.yaml index b22ed1e0ac60bf..9a883ecf22da79 100644 --- a/.github/actions/bootstrap-cache/action.yaml +++ b/.github/actions/bootstrap-cache/action.yaml @@ -1,5 +1,5 @@ name: Bootstrap cache -description: Bootstrap cache +description: Bootstrap cache (deprecated) runs: using: "composite" steps: diff --git a/.github/actions/bootstrap/action.yaml b/.github/actions/bootstrap/action.yaml index 8f94830b8c0e51..16a2fba998fcc0 100644 --- a/.github/actions/bootstrap/action.yaml +++ b/.github/actions/bootstrap/action.yaml @@ -5,9 +5,56 @@ inputs: description: "Platform name" required: false default: none + bootstrap-log-name: + description: "Bootstrap log name" + required: false + default: bootstrap-logs-${{ github.job }} +outputs: + cache-hit: + description: "Bootstrap environment was restored from cache" + value: ${{ fromJSON(steps.bootstrap-cache.outputs.outputs).cache-hit }} # retry returns all outputs in `outputs` + runs: using: "composite" steps: - - name: Bootstrap + - name: Calculate bootstrap cache key + id: bootstrap-cache-key + shell: bash + run: | + # Calculate bootstrap cache key + # In addition to the various setup files, the work directory matters as well, + # because the bootstrapped Pigweed environment contains absolute paths. + FILES_HASH="${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}" + FINAL_HASH="$(echo "$PWD:$FILES_HASH" | shasum -a 256 | cut -d' ' -f1)" + echo "Calculated bootstrap cache key for '$PWD': $FINAL_HASH" + echo "hash=$FINAL_HASH" >> "$GITHUB_OUTPUT" + + - uses: Wandalen/wretry.action@v1.4.10 + name: Bootstrap from cache + id: bootstrap-cache + continue-on-error: true + with: + action: buildjet/cache@v4 + attempt_limit: 3 + attempt_delay: 2000 + with: | + key: ${{ runner.os }}-${{ runner.arch }}-${{ inputs.platform }}-${{ steps.bootstrap-cache-key.outputs.hash}} + path: | + .environment + build_overrides/pigweed_environment.gni + + - name: Run bootstrap + if: fromJSON(steps.bootstrap-cache.outputs.outputs).cache-hit != 'true' + env: + PW_NO_CIPD_CACHE_DIR: Y shell: bash - run: bash scripts/bootstrap.sh -p all,${{ inputs.platform }} + run: source scripts/bootstrap.sh -p all,${{ inputs.platform }} + + - name: Uploading bootstrap logs + uses: actions/upload-artifact@v4 + if: always() && !env.ACT && fromJSON(steps.bootstrap-cache.outputs.outputs).cache-hit != 'true' + with: + name: ${{ inputs.bootstrap-log-name }} + path: | + .environment/gn_out/.ninja_log + .environment/pigweed-venv/*.log diff --git a/.github/actions/checkout-submodules-and-bootstrap/action.yaml b/.github/actions/checkout-submodules-and-bootstrap/action.yaml index 7424ca529f74df..df3fdff1e02ce4 100644 --- a/.github/actions/checkout-submodules-and-bootstrap/action.yaml +++ b/.github/actions/checkout-submodules-and-bootstrap/action.yaml @@ -26,21 +26,14 @@ runs: with: platform: ${{ inputs.platform }} extra-parameters: ${{ inputs.extra-submodule-parameters }} - - name: Bootstrap Cache - uses: ./.github/actions/bootstrap-cache - name: Bootstrap uses: ./.github/actions/bootstrap - env: - PW_NO_CIPD_CACHE_DIR: Y with: platform: ${{ inputs.platform }} + bootstrap-log-name: ${{ inputs.bootstrap-log-name }} - name: Dump disk info after checkout submodule & Bootstrap shell: bash run: scripts/dump_diskspace_info.sh - - name: Upload Bootstrap Logs - uses: ./.github/actions/upload-bootstrap-logs - with: - bootstrap-log-name: ${{ inputs.bootstrap-log-name }} - name: Work around TSAN ASLR issues if: runner.os == 'Linux' && !env.ACT shell: bash diff --git a/.github/actions/upload-bootstrap-logs/action.yaml b/.github/actions/upload-bootstrap-logs/action.yaml deleted file mode 100644 index 522058c16ff93c..00000000000000 --- a/.github/actions/upload-bootstrap-logs/action.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: Upload bootstrap logs -description: Upload bootstrap logs -inputs: - bootstrap-log-name: - description: "Bootstrap log name" - required: false - default: bootstrap-logs-${{ github.job }} -runs: - using: "composite" - steps: - - name: Uploading bootstrap logs - uses: actions/upload-artifact@v4 - if: ${{ always() && !env.ACT }} - with: - name: ${{ inputs.bootstrap-log-name }} - path: | - .environment/gn_out/.ninja_log - .environment/pigweed-venv/*.log diff --git a/.github/workflows/cirque.yaml b/.github/workflows/cirque.yaml index 1f0b7c5d327fcf..919085ac77ee0f 100644 --- a/.github/workflows/cirque.yaml +++ b/.github/workflows/cirque.yaml @@ -57,6 +57,7 @@ jobs: with: platform: linux + # TODO: Is what's being cached here actually compatible with a regular bootstrap? - name: Bootstrap Cache uses: ./.github/actions/bootstrap-cache - name: Bootstrap Cirque diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 147dc957e130da..99bf056af1e5df 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -59,7 +59,6 @@ jobs: timeout-minutes: 30 run: | scripts/examples/gn_silabs_example.sh examples/lighting-app/silabs ./out/light-app BRD4187C --slc_generate --docker - scripts/examples/gn_silabs_example.sh examples/lighting-app/silabs ./out/light-app BRD4164A --slc_generate --docker rm -rf ./out/ - name: Build some BRD4187C variants (1) run: | @@ -115,6 +114,7 @@ jobs: "./scripts/build/build_examples.py \ --enable-flashbundle \ --target efr32-brd4338a-light-wifi-917_soc-skip_rps_generation \ + --target efr32-brd4338a-lock-wifi-917_soc-skip_rps_generation \ build \ --copy-artifacts-to out/artifacts \ " diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml index ee19873cc32f2a..f354ce369c27fd 100644 --- a/.github/workflows/fuzzing-build.yaml +++ b/.github/workflows/fuzzing-build.yaml @@ -46,12 +46,8 @@ jobs: run: | mkdir objdir-clone || true - - name: Bootstrap Cache - uses: ./.github/actions/bootstrap-cache - name: Bootstrap uses: ./.github/actions/bootstrap - - name: Upload Bootstrap Logs - uses: ./.github/actions/upload-bootstrap-logs - name: Build all-clusters-app run: | @@ -84,12 +80,8 @@ jobs: run: | mkdir objdir-clone || true - - name: Bootstrap Cache - uses: ./.github/actions/bootstrap-cache - name: Bootstrap uses: ./.github/actions/bootstrap - - name: Upload Bootstrap Logs - uses: ./.github/actions/upload-bootstrap-logs - name: Build all-clusters-app run: | diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml index 5aa38ecc893d28..57a1ce7b325dc3 100644 --- a/.github/workflows/release_artifacts.yaml +++ b/.github/workflows/release_artifacts.yaml @@ -39,12 +39,8 @@ jobs: uses: actions/checkout@v4 with: ref: "${{ github.event.inputs.releaseTag }}" - - name: Bootstrap Cache - uses: ./.github/actions/bootstrap-cache - name: Bootstrap uses: ./.github/actions/bootstrap - - name: Upload Bootstrap Logs - uses: ./.github/actions/upload-bootstrap-logs - name: Build run: scripts/examples/esp_example.sh all-clusters-app @@ -74,12 +70,8 @@ jobs: uses: actions/checkout@v4 with: ref: "${{ github.event.inputs.releaseTag }}" - - name: Bootstrap Cache - uses: ./.github/actions/bootstrap-cache - name: Bootstrap uses: ./.github/actions/bootstrap - - name: Upload Bootstrap Logs - uses: ./.github/actions/upload-bootstrap-logs - name: Build example EFR32 Lock App run: scripts/examples/gn_silabs_example.sh examples/lock-app/efr32/ diff --git a/.restyled.yaml b/.restyled.yaml index 9acbe8e5134aed..be74f5b47aa61d 100644 --- a/.restyled.yaml +++ b/.restyled.yaml @@ -74,6 +74,7 @@ exclude: - "examples/chef/sample_app_util/test_files/*.yaml" - "examples/chef/zzz_generated/**/*" - "examples/platform/nxp/k32w/k32w0/scripts/demo_generated_certs/**/*" + - "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/*" # zap-generated files - "integrations/cloudbuild/*.yaml" # uglier long command line content - "scripts/run_codegen_targets.sh" # shellharden breaks for loops over command outputs - "scripts/tagging/tag_new_release.sh" # shellharden breaks parameter passing diff --git a/examples/chef/common/clusters/wake-on-lan/WakeOnLanManager.cpp b/examples/chef/common/clusters/wake-on-lan/WakeOnLanManager.cpp index 5f4e2e1ec7b6e2..4b9e0e5669fc2b 100644 --- a/examples/chef/common/clusters/wake-on-lan/WakeOnLanManager.cpp +++ b/examples/chef/common/clusters/wake-on-lan/WakeOnLanManager.cpp @@ -41,7 +41,7 @@ std::string getMacAddress() } char macStr[chip::DeviceLayer::ConfigurationManager::kPrimaryMACAddressLength * 2 + 1] = { 0 }; // added null char - if (BytesToHex(&macBuffer[0], sizeof(macBuffer), &macStr[0], sizeof(macBuffer) * 2u, chip::Encoding::HexFlags::kUppercase) != + if (BytesToHex(mac.data(), mac.size(), &macStr[0], sizeof(macBuffer) * 2u, chip::Encoding::HexFlags::kUppercase) != CHIP_NO_ERROR) { ChipLogProgress(Zcl, "WakeOnLanManager::getMacAddress hex conversion failed"); diff --git a/examples/platform/silabs/MatterConfig.cpp b/examples/platform/silabs/MatterConfig.cpp index dd2368f566d252..d41a4154697716 100644 --- a/examples/platform/silabs/MatterConfig.cpp +++ b/examples/platform/silabs/MatterConfig.cpp @@ -46,10 +46,6 @@ #include "wfx_rsi.h" #endif /* SLI_SI91X_MCU_INTERFACE */ -using namespace ::chip; -using namespace ::chip::Inet; -using namespace ::chip::DeviceLayer; - #include // If building with the EFR32-provided crypto backend, we can use the // opaque keystore @@ -75,6 +71,36 @@ static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeys #include #endif +#include + +#include +#include +#include +#include + +#include + +#include "FreeRTOSConfig.h" +#include "event_groups.h" +#include "task.h" + +/********************************************************** + * Defines + *********************************************************/ + +#define MAIN_TASK_STACK_SIZE (1024 * 5) +#define MAIN_TASK_PRIORITY (configMAX_PRIORITIES - 1) + +using namespace ::chip; +using namespace ::chip::Inet; +using namespace ::chip::DeviceLayer; +using namespace ::chip::Credentials::Silabs; +using namespace chip::DeviceLayer::Silabs; + +TaskHandle_t main_Task; +volatile int apperror_cnt; +static chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; + #if CHIP_ENABLE_OPENTHREAD #include #include @@ -129,6 +155,44 @@ CHIP_ERROR SilabsMatterConfig::InitOpenThread(void) } #endif // CHIP_ENABLE_OPENTHREAD +namespace { +void application_start(void * unused) +{ + CHIP_ERROR err = SilabsMatterConfig::InitMatter(BLE_DEV_NAME); + if (err != CHIP_NO_ERROR) + appError(err); + + gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage()); + chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider); + + chip::DeviceLayer::PlatformMgr().LockChipStack(); + // Initialize device attestation config + SetDeviceAttestationCredentialsProvider(Credentials::Silabs::GetSilabsDacProvider()); + chip::DeviceLayer::PlatformMgr().UnlockChipStack(); + + SILABS_LOG("Starting App Task"); + err = AppTask::GetAppTask().StartAppTask(); + if (err != CHIP_NO_ERROR) + appError(err); + + vTaskDelete(main_Task); +} +} // namespace + +void SilabsMatterConfig::AppInit() +{ + GetPlatform().Init(); + + xTaskCreate(application_start, "main_task", MAIN_TASK_STACK_SIZE, NULL, MAIN_TASK_PRIORITY, &main_Task); + SILABS_LOG("Starting scheduler"); + GetPlatform().StartScheduler(); + + // Should never get here. + chip::Platform::MemoryShutdown(); + SILABS_LOG("Start Scheduler Failed"); + appError(CHIP_ERROR_INTERNAL); +} + #if SILABS_OTA_ENABLED void SilabsMatterConfig::InitOTARequestorHandler(System::Layer * systemLayer, void * appState) { diff --git a/examples/platform/silabs/MatterConfig.h b/examples/platform/silabs/MatterConfig.h index 86c8b7e0a66ba4..4725e02d36e601 100644 --- a/examples/platform/silabs/MatterConfig.h +++ b/examples/platform/silabs/MatterConfig.h @@ -26,6 +26,7 @@ class SilabsMatterConfig { public: static CHIP_ERROR InitMatter(const char * appName); + static void AppInit(); private: static CHIP_ERROR InitOpenThread(void); diff --git a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp index c443bec49b072c..d1726d0ec71743 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp +++ b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp @@ -25,10 +25,12 @@ #include "FreeRTOS.h" #include "event_groups.h" #include "sl_board_configuration.h" +extern "C" { #include "sl_si91x_types.h" #include "sl_wifi_constants.h" #include "sl_wifi_types.h" #include "sl_wlan_config.h" +} #include "task.h" #if (EXP_BOARD) @@ -40,8 +42,10 @@ #if SL_ICD_ENABLED && SLI_SI91X_MCU_INTERFACE #include "rsi_rom_power_save.h" #include "sl_si91x_button_pin_config.h" +extern "C" { #include "sl_si91x_driver.h" #include "sl_si91x_m4_ps.h" +} // TODO: should be removed once we are getting the press interrupt for button 0 with sleep #define BUTTON_PRESSED 1 diff --git a/examples/platform/silabs/main.cpp b/examples/platform/silabs/main.cpp index a3155194e8d1dd..d01e27f17847f5 100644 --- a/examples/platform/silabs/main.cpp +++ b/examples/platform/silabs/main.cpp @@ -16,77 +16,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#include - -#include "AppConfig.h" - -#include +#include "sl_component_catalog.h" +#include "sl_system_init.h" +#include "sl_system_kernel.h" #include -#include -#include -#include - -#include - -#include "FreeRTOS.h" -#include "FreeRTOSConfig.h" -#include "event_groups.h" -#include "task.h" - -/********************************************************** - * Defines - *********************************************************/ - -#define MAIN_TASK_STACK_SIZE (1024 * 5) -#define MAIN_TASK_PRIORITY (configMAX_PRIORITIES - 1) - -using namespace ::chip; -using namespace ::chip::DeviceLayer; -using namespace ::chip::Credentials; -using namespace chip::DeviceLayer::Silabs; - -TaskHandle_t main_Task; -void application_start(void * unused); -volatile int apperror_cnt; -static chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; -// ================================================================================ -// Main Code -// ================================================================================ int main(void) { - GetPlatform().Init(); - - xTaskCreate(application_start, "main_task", MAIN_TASK_STACK_SIZE, NULL, MAIN_TASK_PRIORITY, &main_Task); - - SILABS_LOG("Starting scheduler"); - GetPlatform().StartScheduler(); - - // Should never get here. - chip::Platform::MemoryShutdown(); - SILABS_LOG("vTaskStartScheduler() failed"); - appError(CHIP_ERROR_INTERNAL); -} - -void application_start(void * unused) -{ - CHIP_ERROR err = SilabsMatterConfig::InitMatter(BLE_DEV_NAME); - if (err != CHIP_NO_ERROR) - appError(err); - - gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage()); - chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider); - - chip::DeviceLayer::PlatformMgr().LockChipStack(); - // Initialize device attestation config - SetDeviceAttestationCredentialsProvider(Credentials::Silabs::GetSilabsDacProvider()); - chip::DeviceLayer::PlatformMgr().UnlockChipStack(); - - SILABS_LOG("Starting App Task"); - err = AppTask::GetAppTask().StartAppTask(); - if (err != CHIP_NO_ERROR) - appError(err); + sl_system_init(); - vTaskDelete(main_Task); + // Initialize the application. For example, create periodic timer(s) or + // task(s) if the kernel is present. + SilabsMatterConfig::AppInit(); } diff --git a/examples/tv-app/tv-common/clusters/wake-on-lan/WakeOnLanManager.cpp b/examples/tv-app/tv-common/clusters/wake-on-lan/WakeOnLanManager.cpp index 53beedefcc8a98..0d4ebb60009646 100644 --- a/examples/tv-app/tv-common/clusters/wake-on-lan/WakeOnLanManager.cpp +++ b/examples/tv-app/tv-common/clusters/wake-on-lan/WakeOnLanManager.cpp @@ -39,7 +39,7 @@ std::string getMacAddress() } char macStr[chip::DeviceLayer::ConfigurationManager::kPrimaryMACAddressLength * 2 + 1] = { 0 }; // added null char - if (BytesToHex(&macBuffer[0], sizeof(macBuffer), &macStr[0], sizeof(macBuffer) * 2u, chip::Encoding::HexFlags::kUppercase) != + if (BytesToHex(mac.data(), mac.size(), &macStr[0], sizeof(macBuffer) * 2u, chip::Encoding::HexFlags::kUppercase) != CHIP_NO_ERROR) { ChipLogProgress(Zcl, "WakeOnLanManager::getMacAddress hex conversion failed"); diff --git a/examples/tv-casting-app/APIs.md b/examples/tv-casting-app/APIs.md index d4a51dcc3146bf..5d80fca16fb0bb 100644 --- a/examples/tv-casting-app/APIs.md +++ b/examples/tv-casting-app/APIs.md @@ -905,17 +905,26 @@ Once the Casting Client has selected an `Endpoint`, it is ready to [issue commands](#issuing-commands) to it, [read](#read-operations) current playback state, and [subscribe](#subscriptions) to playback events. -Refer to the following platform specific files for a list of clusters, command -and attributes supported by the Matter TV Casting library: +On Linux refer to the following platform specific files: -1. Linux: +1. For a list of clusters, commands and attributes supported by the Matter TV + Casting library: [tv-casting-common/clusters/Clusters.h](tv-casting-common/clusters/Clusters.h) +2. For the IDs and request / response types to use with these APIs: + [/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h](/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h) -Refer to the following platform specific files for the IDs and request / -response types to use with these APIs: +On iOS refer to the following platform specific files: -1. Linux: - [/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h](/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h) +1. For a list of clusters, commands and attributes supported by the Matter TV + Casting library: + [/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h](/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h) +2. For the IDs and request / response types to use with the commands: + [/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h](/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h) + and + [/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h](/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h) +3. For attribute [read operations](#read-operations) and + [subscriptions](#subscriptions): + [/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h](/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h) ### Issuing Commands @@ -998,7 +1007,7 @@ if(launchURLCommand == nil) } // create the LaunchURL request -let request: MCContentLauncherClusterLaunchURLRequest = MCContentLauncherClusterLaunchURLRequest() +let request: MCContentLauncherClusterLaunchURLParams = MCContentLauncherClusterLaunchURLParams() request.contentURL = contentUrl request.displayString = displayString diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj index f55ca2b5242b20..c9113281279627 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj @@ -7,14 +7,18 @@ objects = { /* Begin PBXBuildFile section */ - 39589F162B91556B00BE040C /* MCStructsObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 39589F152B91556B00BE040C /* MCStructsObjc.h */; }; - 39589F182B91557700BE040C /* MCStructsObjc.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39589F172B91557700BE040C /* MCStructsObjc.mm */; }; + 39589F162B91556B00BE040C /* MCInteractionModelStructs.h in Headers */ = {isa = PBXBuildFile; fileRef = 39589F152B91556B00BE040C /* MCInteractionModelStructs.h */; }; + 39589F182B91557700BE040C /* MCInteractionModelStructs.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39589F172B91557700BE040C /* MCInteractionModelStructs.mm */; }; 39BF57C52B8CFF790081653C /* MCAttributeObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = 39BF57C42B8CFF790081653C /* MCAttributeObjects.h */; }; 39BF57C72B8CFFB90081653C /* MCAttributeObjects.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39BF57C62B8CFFB90081653C /* MCAttributeObjects.mm */; }; 39BF57C92B8D66540081653C /* NSStringSpanConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 39BF57C82B8D66540081653C /* NSStringSpanConversion.h */; }; 39BF57CB2B8E54F80081653C /* NSDataSpanConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 39BF57CA2B8E54F80081653C /* NSDataSpanConversion.h */; }; 39BF57CD2B8FC0EF0081653C /* MCClusterObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = 39BF57CC2B8FC0EF0081653C /* MCClusterObjects.h */; }; 39BF57CF2B8FC1030081653C /* MCClusterObjects.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39BF57CE2B8FC1030081653C /* MCClusterObjects.mm */; }; + 39D4D2502B97942D00BF3CFE /* MCCommandObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = 39D4D24F2B97942D00BF3CFE /* MCCommandObjects.h */; }; + 39D4D2522B97943D00BF3CFE /* MCCommandObjects.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39D4D2512B97943D00BF3CFE /* MCCommandObjects.mm */; }; + 39DB29E92B9A3B1D0071334A /* MCCommandPayloads.h in Headers */ = {isa = PBXBuildFile; fileRef = 39DB29E82B9A3B1D0071334A /* MCCommandPayloads.h */; }; + 39DB29EB2B9A3B2D0071334A /* MCCommandPayloads.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39DB29EA2B9A3B2D0071334A /* MCCommandPayloads.mm */; }; 3C0474062B3F7E5F0012AE95 /* MCEndpointFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C0474052B3F7E5F0012AE95 /* MCEndpointFilter.h */; }; 3C04740C2B4604CF0012AE95 /* MCCryptoUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C04740B2B4604CF0012AE95 /* MCCryptoUtils.h */; }; 3C04740E2B4605B40012AE95 /* MCCryptoUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C04740D2B4605B40012AE95 /* MCCryptoUtils.mm */; }; @@ -42,8 +46,6 @@ 3C4F52282B51DB3000BB8A10 /* MCCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C4F52272B51DB3000BB8A10 /* MCCommand.h */; }; 3C4F522A2B51DFAE00BB8A10 /* MCCommand_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C4F52292B51DFAE00BB8A10 /* MCCommand_Internal.h */; }; 3C4F522C2B51E02800BB8A10 /* MCCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C4F522B2B51E02800BB8A10 /* MCCommand.mm */; }; - 3C621CA12B5F6CF8005CDBA3 /* MCCommandObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C621CA02B5F6CF8005CDBA3 /* MCCommandObjects.h */; }; - 3C621CA32B5F6D08005CDBA3 /* MCCommandObjects.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C621CA22B5F6D08005CDBA3 /* MCCommandObjects.mm */; }; 3C621CA52B605A6A005CDBA3 /* MCAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C621CA42B605A6A005CDBA3 /* MCAttribute.h */; }; 3C621CA72B605AA1005CDBA3 /* MCObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C621CA62B605AA1005CDBA3 /* MCObserver.h */; }; 3C621CA92B605C52005CDBA3 /* MCAttribute_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C621CA82B605C52005CDBA3 /* MCAttribute_Internal.h */; }; @@ -84,14 +86,19 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 39589F152B91556B00BE040C /* MCStructsObjc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCStructsObjc.h; sourceTree = ""; }; - 39589F172B91557700BE040C /* MCStructsObjc.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCStructsObjc.mm; sourceTree = ""; }; + 39589F152B91556B00BE040C /* MCInteractionModelStructs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCInteractionModelStructs.h; sourceTree = ""; }; + 39589F172B91557700BE040C /* MCInteractionModelStructs.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCInteractionModelStructs.mm; sourceTree = ""; }; + 399049A62B9FC4ED000C91F0 /* MCCommandPayloads_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCommandPayloads_Internal.h; sourceTree = ""; }; 39BF57C42B8CFF790081653C /* MCAttributeObjects.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCAttributeObjects.h; sourceTree = ""; }; 39BF57C62B8CFFB90081653C /* MCAttributeObjects.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCAttributeObjects.mm; sourceTree = ""; }; 39BF57C82B8D66540081653C /* NSStringSpanConversion.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSStringSpanConversion.h; sourceTree = ""; }; 39BF57CA2B8E54F80081653C /* NSDataSpanConversion.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSDataSpanConversion.h; sourceTree = ""; }; 39BF57CC2B8FC0EF0081653C /* MCClusterObjects.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCClusterObjects.h; sourceTree = ""; }; 39BF57CE2B8FC1030081653C /* MCClusterObjects.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCClusterObjects.mm; sourceTree = ""; }; + 39D4D24F2B97942D00BF3CFE /* MCCommandObjects.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCommandObjects.h; sourceTree = ""; }; + 39D4D2512B97943D00BF3CFE /* MCCommandObjects.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCCommandObjects.mm; sourceTree = ""; }; + 39DB29E82B9A3B1D0071334A /* MCCommandPayloads.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCommandPayloads.h; sourceTree = ""; }; + 39DB29EA2B9A3B2D0071334A /* MCCommandPayloads.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCCommandPayloads.mm; sourceTree = ""; }; 3C0474052B3F7E5F0012AE95 /* MCEndpointFilter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCEndpointFilter.h; sourceTree = ""; }; 3C04740B2B4604CF0012AE95 /* MCCryptoUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCryptoUtils.h; sourceTree = ""; }; 3C04740D2B4605B40012AE95 /* MCCryptoUtils.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCCryptoUtils.mm; sourceTree = ""; }; @@ -124,8 +131,6 @@ 3C4F52272B51DB3000BB8A10 /* MCCommand.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCommand.h; sourceTree = ""; }; 3C4F52292B51DFAE00BB8A10 /* MCCommand_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCommand_Internal.h; sourceTree = ""; }; 3C4F522B2B51E02800BB8A10 /* MCCommand.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCCommand.mm; sourceTree = ""; }; - 3C621CA02B5F6CF8005CDBA3 /* MCCommandObjects.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCommandObjects.h; sourceTree = ""; }; - 3C621CA22B5F6D08005CDBA3 /* MCCommandObjects.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCCommandObjects.mm; sourceTree = ""; }; 3C621CA42B605A6A005CDBA3 /* MCAttribute.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCAttribute.h; sourceTree = ""; }; 3C621CA62B605AA1005CDBA3 /* MCObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCObserver.h; sourceTree = ""; }; 3C621CA82B605C52005CDBA3 /* MCAttribute_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCAttribute_Internal.h; sourceTree = ""; }; @@ -192,8 +197,13 @@ 39BF57C62B8CFFB90081653C /* MCAttributeObjects.mm */, 39BF57CC2B8FC0EF0081653C /* MCClusterObjects.h */, 39BF57CE2B8FC1030081653C /* MCClusterObjects.mm */, - 39589F152B91556B00BE040C /* MCStructsObjc.h */, - 39589F172B91557700BE040C /* MCStructsObjc.mm */, + 39589F152B91556B00BE040C /* MCInteractionModelStructs.h */, + 39589F172B91557700BE040C /* MCInteractionModelStructs.mm */, + 39D4D24F2B97942D00BF3CFE /* MCCommandObjects.h */, + 39D4D2512B97943D00BF3CFE /* MCCommandObjects.mm */, + 39DB29E82B9A3B1D0071334A /* MCCommandPayloads.h */, + 39DB29EA2B9A3B2D0071334A /* MCCommandPayloads.mm */, + 399049A62B9FC4ED000C91F0 /* MCCommandPayloads_Internal.h */, ); path = "zap-generated"; sourceTree = ""; @@ -265,8 +275,6 @@ 3C621CA42B605A6A005CDBA3 /* MCAttribute.h */, 3C621CA82B605C52005CDBA3 /* MCAttribute_Internal.h */, 3C621CAA2B605C6E005CDBA3 /* MCAttribute.mm */, - 3C621CA02B5F6CF8005CDBA3 /* MCCommandObjects.h */, - 3C621CA22B5F6D08005CDBA3 /* MCCommandObjects.mm */, 3C4F521F2B507C4A00BB8A10 /* MCEndpointClusterType.h */, 3C4F52132B4F31DC00BB8A10 /* MCDeviceTypeStruct.h */, 3C4F52152B4F31FA00BB8A10 /* MCDeviceTypeStruct.m */, @@ -339,11 +347,13 @@ 3CF71C0E2A992DA2003A5CE5 /* MCDataSource.h in Headers */, 3C4F52142B4F31DC00BB8A10 /* MCDeviceTypeStruct.h in Headers */, 39BF57CD2B8FC0EF0081653C /* MCClusterObjects.h in Headers */, + 39D4D2502B97942D00BF3CFE /* MCCommandObjects.h in Headers */, 3C26AC8C2926FE0C00BA6881 /* DeviceAttestationCredentialsProviderImpl.hpp in Headers */, 3C621CA52B605A6A005CDBA3 /* MCAttribute.h in Headers */, 3CD73F1C2A9E8396009D82D1 /* MCCommissionableDataProvider.h in Headers */, 3C4F521E2B4F4B3B00BB8A10 /* MCEndpoint_Internal.h in Headers */, 39BF57C92B8D66540081653C /* NSStringSpanConversion.h in Headers */, + 39DB29E92B9A3B1D0071334A /* MCCommandPayloads.h in Headers */, 3C4F52262B50899700BB8A10 /* MCCluster_Internal.h in Headers */, 3CF71C0A2A992D0D003A5CE5 /* MCCastingApp.h in Headers */, 3C4F521C2B4F4B1B00BB8A10 /* MCCastingPlayer_Internal.h in Headers */, @@ -357,7 +367,7 @@ 3CD73F202A9EA060009D82D1 /* MCDeviceAttestationCredentials.h in Headers */, 3CCB8740286A593700771BAD /* CastingServerBridge.h in Headers */, 3CE5ECCE2A673B30007CF331 /* CommissioningCallbackHandlers.h in Headers */, - 39589F162B91556B00BE040C /* MCStructsObjc.h in Headers */, + 39589F162B91556B00BE040C /* MCInteractionModelStructs.h in Headers */, 3CCB8742286A593700771BAD /* ConversionUtils.hpp in Headers */, 3C621CA72B605AA1005CDBA3 /* MCObserver.h in Headers */, 3C9437922B3B478E0096E5F4 /* MCErrorUtils.h in Headers */, @@ -365,7 +375,6 @@ 3CCB8741286A593700771BAD /* DiscoveredNodeData.h in Headers */, 3C0474062B3F7E5F0012AE95 /* MCEndpointFilter.h in Headers */, 3CCB87212869085400771BAD /* MatterTvCastingBridge.h in Headers */, - 3C621CA12B5F6CF8005CDBA3 /* MCCommandObjects.h in Headers */, 3C4F52202B507C4A00BB8A10 /* MCEndpointClusterType.h in Headers */, 3C6920462AA1093300D0F613 /* MCDeviceAttestationCredentialsProvider.h in Headers */, 39BF57C52B8CFF790081653C /* MCAttributeObjects.h in Headers */, @@ -475,13 +484,13 @@ 3CE5ECD02A673E2C007CF331 /* CommissioningCallbackHandlers.m in Sources */, 39BF57CF2B8FC1030081653C /* MCClusterObjects.mm in Sources */, 3CD73F192A9E68A7009D82D1 /* MCRotatingDeviceIdUniqueIdProvider.mm in Sources */, - 39589F182B91557700BE040C /* MCStructsObjc.mm in Sources */, + 39589F182B91557700BE040C /* MCInteractionModelStructs.mm in Sources */, + 39DB29EB2B9A3B2D0071334A /* MCCommandPayloads.mm in Sources */, 3CF8532728E37F1000F07B9F /* MatterError.mm in Sources */, 3C4F522C2B51E02800BB8A10 /* MCCommand.mm in Sources */, 3C4E53B628E5595A00F293E8 /* ContentLauncherTypes.mm in Sources */, 3C81C75028F7A7D3001CB9D1 /* VideoPlayer.m in Sources */, 3CCB8744286A593700771BAD /* ConversionUtils.mm in Sources */, - 3C621CA32B5F6D08005CDBA3 /* MCCommandObjects.mm in Sources */, 3CF71C0C2A992D25003A5CE5 /* MCCastingApp.mm in Sources */, 3C621CAB2B605C6E005CDBA3 /* MCAttribute.mm in Sources */, 3C4F52122B4E18ED00BB8A10 /* MCEndpoint.mm in Sources */, @@ -498,6 +507,7 @@ 3C26AC9329282B8100BA6881 /* DeviceAttestationCredentialsHolder.m in Sources */, 3C26AC902927008900BA6881 /* DeviceAttestationCredentialsProviderImpl.mm in Sources */, 3CCB873F286A593700771BAD /* DiscoveredNodeData.mm in Sources */, + 39D4D2522B97943D00BF3CFE /* MCCommandObjects.mm in Sources */, 3C4F52162B4F31FA00BB8A10 /* MCDeviceTypeStruct.m in Sources */, 3C2696FB2B4A5FC50026E771 /* MCEndpointFilter.m in Sources */, 3C81C74C28F7A777001CB9D1 /* ContentApp.mm in Sources */, diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommandObjects.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommandObjects.h deleted file mode 100644 index c600d151febf1f..00000000000000 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommandObjects.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * - * Copyright (c) 2020-2024 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "MCCommand.h" -#import - -#ifndef MCCommandObjects_h -#define MCCommandObjects_h - -@interface MCContentLauncherClusterDimensionStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull width; -@property (nonatomic, copy) NSNumber * _Nonnull height; -@property (nonatomic, copy) NSNumber * _Nonnull metric; -@end - -@interface MCContentLauncherClusterStyleInformationStruct : NSObject -@property (nonatomic, copy) NSString * _Nullable imageURL; -@property (nonatomic, copy) NSString * _Nullable imageUrl; -@property (nonatomic, copy) NSString * _Nullable color; -@property (nonatomic, copy) MCContentLauncherClusterDimensionStruct * _Nullable size; -@end - -@interface MCContentLauncherClusterBrandingInformationStruct : NSObject -@property (nonatomic, copy) NSString * _Nonnull providerName; -@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable background; -@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable logo; -@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable progressBar; -@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable splash; -@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable waterMark; -@end - -@interface MCContentLauncherClusterLaunchURLRequest : NSObject -@property (nonatomic, copy) NSString * _Nonnull contentURL; -@property (nonatomic, copy) NSString * _Nullable displayString; -@property (nonatomic, copy) MCContentLauncherClusterBrandingInformationStruct * _Nullable brandingInformation; -@end - -@interface MCContentLauncherClusterLauncherResponse : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull status; -@property (nonatomic, copy) NSString * _Nullable data; -@end - -@interface MCContentLauncherClusterLaunchURLCommand : MCCommand -@end - -#endif /* MCCommandObjects_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommandObjects.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommandObjects.mm deleted file mode 100644 index 8c37d0911668fb..00000000000000 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommandObjects.mm +++ /dev/null @@ -1,132 +0,0 @@ -/** - * - * Copyright (c) 2024 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "MCCommandObjects.h" - -#import "MCCastingApp.h" -#import "MCCommand_Internal.h" -#import "MCErrorUtils.h" - -#include "core/Command.h" -#include - -#import - -@implementation MCContentLauncherClusterLaunchURLRequest - -- (instancetype)init -{ - if (self = [super init]) { - _contentURL = @""; - _displayString = nil; - _brandingInformation = nil; - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MCContentLauncherClusterLaunchURLRequest alloc] init]; - other.contentURL = self.contentURL; - other.displayString = self.displayString; - other.brandingInformation = self.brandingInformation; - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: contentURL:%@; displayString:%@; brandingInformation:%@; >", NSStringFromClass([self class]), _contentURL, _displayString, _brandingInformation]; - return descriptionString; -} -@end - -@implementation MCContentLauncherClusterLauncherResponse - -- (instancetype)init -{ - if (self = [super init]) { - _status = @(0); - _data = nil; - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MCContentLauncherClusterLauncherResponse alloc] init]; - - other.status = self.status; - other.data = self.data; - return other; -} - -- (instancetype)initWithDecodableStruct:(const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType &)decodableStruct -{ - if (self = [super init]) { - _status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; - _data = [[NSString alloc] initWithBytes:decodableStruct.data.Value().data() length:decodableStruct.data.Value().size() encoding:NSUTF8StringEncoding]; - } - return self; -} - -@end - -@implementation MCContentLauncherClusterLaunchURLCommand - -- (void)invoke:(id)request - context:(void * _Nullable)context - completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion - timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs -{ - MCCommandTemplate * mcCommand = new MCCommandTemplate( - self.cppCommand, - [self](id objCRequest) { - return [self getCppRequestFromObjC:objCRequest]; - }, - [self](std::any cppResponse) { - return [self getObjCResponseFromCpp:cppResponse]; - }); - mcCommand->invoke( - request, context, [mcCommand, completion](void * context, NSError * err, id response) { - completion(context, err, response); - delete mcCommand; - }, timedInvokeTimeoutMs); -} - -- (std::any)getCppRequestFromObjC:(MCContentLauncherClusterLaunchURLRequest *)objcRequest -{ - VerifyOrReturnValue(objcRequest != nil, nullptr); - - std::shared_ptr cppRequest = std::make_shared(); - cppRequest->contentURL = chip::CharSpan([objcRequest.contentURL UTF8String], [objcRequest.contentURL lengthOfBytesUsingEncoding:NSUTF8StringEncoding]); - if (objcRequest.displayString != nil) { - cppRequest->displayString = chip::Optional(chip::CharSpan([objcRequest.displayString UTF8String], [objcRequest.displayString lengthOfBytesUsingEncoding:NSUTF8StringEncoding])); - } - cppRequest->brandingInformation = chip::MakeOptional(chip::app::Clusters::ContentLauncher::Structs::BrandingInformationStruct::Type()); // TODO: map brandingInformation - return std::any(cppRequest); -} - -- (id)getObjCResponseFromCpp:(std::any)cppResponse -{ - MCContentLauncherClusterLauncherResponse * objCResponse = nil; - if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); - objCResponse = responseSharedPtr != nil ? [[MCContentLauncherClusterLauncherResponse alloc] initWithDecodableStruct:*responseSharedPtr] : nil; - } - return objCResponse; -} -@end diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommand_Internal.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommand_Internal.h index 384004467fef30..6665c8c52ea8c9 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommand_Internal.h +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommand_Internal.h @@ -75,6 +75,7 @@ class MCCommandTemplate { *cppRequest, context, [clientQueue, completion, this](void * context, const typename Type::ResponseType & response) { ChipLogProgress(AppServer, " converting 'response' from Cpp to ObjC"); + // Get cpp response here. id objCResponse = mGetObjCResponseFromCppFn(std::any(std::make_shared(response))); dispatch_async(clientQueue, ^{ completion(context, nil, objCResponse); diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterTvCastingBridge.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterTvCastingBridge.h index 19db166102a973..851b94606d628a 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterTvCastingBridge.h +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterTvCastingBridge.h @@ -32,7 +32,6 @@ FOUNDATION_EXPORT const unsigned char MatterTvCastingBridgeVersionString[]; #import "MCCastingPlayerDiscovery.h" #import "MCCluster.h" #import "MCCommand.h" -#import "MCCommandObjects.h" #import "MCCommissionableData.h" #import "MCCryptoUtils.h" #import "MCDataSource.h" @@ -42,3 +41,4 @@ FOUNDATION_EXPORT const unsigned char MatterTvCastingBridgeVersionString[]; #import "MCObserver.h" #import "zap-generated/MCAttributeObjects.h" #import "zap-generated/MCClusterObjects.h" +#import "zap-generated/MCCommandObjects.h" diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects-src.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects-src.zapt index 90b0f400523ae9..52f09bc83c1f8e 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects-src.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects-src.zapt @@ -14,13 +14,11 @@ #import {{#zcl_clusters}} -{{#if (isSupported (asUpperCamelCase name preserveAcronyms=true))}} {{#if (isInConfigList name "MatterCastingClusters")}} // {{asUpperCamelCase name}} cluster attributes: {{#zcl_attributes_server removeKeys='isOptional'}} -{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} @implementation MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Attribute - (void)read:(void * _Nullable)context completion:(void (^_Nonnull __strong)(void * _Nullable, id _Nullable __strong before, id _Nullable __strong after, NSError * _Nullable __strong error))completion @@ -57,7 +55,6 @@ if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::{{asUpperCamelCase ../name}}::Attributes::{{asUpperCamelCase name}}::TypeInfo::DecodableType _cppValue = *sharedPtr; - //auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; {{asObjectiveCType type parent.name structTypePrefix="MC"}} value; {{>decode_value target="value" source="_cppValue" cluster=parent.name errorCode="*aError = err; return nil;" depth=0}} @@ -68,8 +65,6 @@ } @end -{{/if}} {{/zcl_attributes_server}} {{/if}} -{{/if}} {{/zcl_clusters}} \ No newline at end of file diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects.zapt index 37390b3e4cb004..3f174e14e42ff1 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects.zapt @@ -1,6 +1,6 @@ {{> header excludeZapComment=false}} -#import "MCStructsObjc.h" +#import "MCInteractionModelStructs.h" #import "../MCAttribute.h" #import @@ -9,20 +9,16 @@ #define MCAttributeObjects_h {{#zcl_clusters}} -{{#if (isSupported (asUpperCamelCase name))}} {{#if (isInConfigList name "MatterCastingClusters")}} // {{asUpperCamelCase name}} cluster attributes: {{#zcl_attributes_server}} -{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} @interface MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Attribute : MCAttribute <{{asObjectiveCClass type ../name structTypePrefix="MC"}} *> @end -{{/if}} {{/zcl_attributes_server}} {{/if}} -{{/if}} {{/zcl_clusters}} #endif /* MCAttributeObjects_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects-src.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects-src.zapt index 0b9207e4e72244..b760874291e05f 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects-src.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects-src.zapt @@ -13,7 +13,6 @@ #import {{#zcl_clusters}} -{{#if (isSupported (asUpperCamelCase name))}} {{#if (isInConfigList name "MatterCastingClusters")}} // {{asUpperCamelCase name}} cluster: @@ -23,8 +22,7 @@ // {{asUpperCamelCase name}} cluster commands: {{#zcl_commands}} -{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} -{{#if (isInConfigList name "MatterCastingImplementedCommands")}} +{{#if (is_str_equal source 'client')}} - (id){{asMethodName name}}Command { @@ -32,22 +30,18 @@ return cppCommand != nil ? [[MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Command alloc] initWithCppCommand:cppCommand] : nil; } -{{/if}} {{/if}} {{/zcl_commands}} // {{asUpperCamelCase name}} cluster attributes: {{#zcl_attributes_server}} -{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} - (id){{asMethodName name}}Attribute { void * cppAttribute = self.cppCluster->GetAttribute(chip::app::Clusters::{{asUpperCamelCase ../name}}::Attributes::{{asUpperCamelCase name}}::Id); return cppAttribute != nil ? [[MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Attribute alloc] initWithCppAttribute:cppAttribute] : nil; } -{{/if}} {{/zcl_attributes_server}} @end {{/if}} -{{/if}} {{/zcl_clusters}} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects.zapt index a4ecab1d389625..1b7fdabe4b3835 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects.zapt @@ -1,15 +1,14 @@ {{> header excludeZapComment=false}} -#import "MCAttributeObjects.h" #import "../MCCluster.h" -#import "../MCCommandObjects.h" +#import "MCAttributeObjects.h" +#import "MCCommandObjects.h" #import #ifndef MCClusterObjects_h #define MCClusterObjects_h {{#zcl_clusters}} -{{#if (isSupported (asUpperCamelCase name))}} {{#if (isInConfigList name "MatterCastingClusters")}} // {{asUpperCamelCase name}} cluster: @@ -19,30 +18,25 @@ // {{asUpperCamelCase name}} cluster commands: {{#zcl_commands}} -{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} -{{#if (isInConfigList name "MatterCastingImplementedCommands")}} +{{#if (is_str_equal source 'client')}} /** * @brief Returns non-nil pointer to MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Command if supported, nil otherwise. */ - (MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Command * _Nullable){{asMethodName name}}Command; {{/if}} -{{/if}} {{/zcl_commands}} // {{asUpperCamelCase name}} cluster attributes: {{#zcl_attributes_server}} -{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} /** * @brief Returns non-nil pointer to MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Attribute if supported, nil otherwise. */ - (MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Attribute * _Nullable){{asMethodName name}}Attribute; -{{/if}} {{/zcl_attributes_server}} @end {{/if}} -{{/if}} {{/zcl_clusters}} #endif /* MCClusterObjects_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects-src.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects-src.zapt index 21eab792b8c2f2..befedb90d6d0ab 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects-src.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects-src.zapt @@ -1,3 +1,84 @@ {{> header excludeZapComment=false}} -// TODO: To be implemented in the following PR. +#import "MCCommandObjects.h" +#import "MCCommandPayloads.h" +#import "MCCommandPayloads_internal.h" + +#import "../MCCastingApp.h" +#import "../MCCommand_Internal.h" +#import "../MCErrorUtils.h" + +#include "core/Command.h" +#include + +#import + +@implementation MCNullObjectType +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + return CHIP_NO_ERROR; +} +@end + +{{#zcl_clusters}} +{{#if (isInConfigList name "MatterCastingClusters")}} + +// {{asUpperCamelCase name}} cluster: + +{{#zcl_commands}} +{{#if (is_str_equal source 'client')}} +@implementation MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Command +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Params *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto& cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast& e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + {{>command_response_type command=.}} * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[{{>command_response_type command=.}} alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Command getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +{{/if}} +{{/zcl_commands}} +{{/if}} +{{/zcl_clusters}} \ No newline at end of file diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects.zapt index 21eab792b8c2f2..6c4615d10a2ae9 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects.zapt @@ -1,3 +1,27 @@ {{> header excludeZapComment=false}} -// TODO: To be implemented in the following PR. +#import "../MCCommand.h" +#import "MCCommandPayloads.h" +#import + +#ifndef MCCommandObjects_h +#define MCCommandObjects_h + +@interface MCNullObjectType : NSObject +@end + +{{#zcl_clusters}} +{{#if (isInConfigList name "MatterCastingClusters")}} + +// {{asUpperCamelCase name}} cluster: + +{{#zcl_commands}} +{{#if (is_str_equal source 'client')}} +@interface MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Command : MCCommand command_response_type command=.}} *> +@end + +{{/if}} +{{/zcl_commands}} +{{/if}} +{{/zcl_clusters}} +#endif /* MCCommandObjects_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads-src.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads-src.zapt new file mode 100644 index 00000000000000..fe3a151518dc48 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads-src.zapt @@ -0,0 +1,125 @@ +{{> header excludeZapComment=false}} + +#import "MCCommandPayloads_Internal.h" + +#import "../MCAttribute_Internal.h" +#import "../MCCastingApp.h" +#import "../MCErrorUtils.h" +#import "../NSDataSpanConversion.h" +#import "../NSStringSpanConversion.h" + +#include +#include + +NS_ASSUME_NONNULL_BEGIN + +@implementation MCAbstractPayload +- (std::any)getCppRequestFromObjCRequest +{ + return nil; +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + return CHIP_NO_ERROR; +} + +- (nonnull id)copyWithZone:(nullable NSZone *)zone +{ + auto other = [[MCAbstractPayload alloc] init]; + + return other; +} +@end + +{{#zcl_clusters}} +{{#if (isInConfigList name "MatterCastingClusters")}} + +// {{asUpperCamelCase name}} cluster: +{{#zcl_commands}} + +{{#*inline "completeImpl"}} +@implementation MC{{cluster}}Cluster{{command}}Params +- (instancetype)init +{ + if (self = [super init]) { +{{#zcl_command_arguments}} + + {{>init_struct_member label=label type=type cluster=parent.parent.name}} +{{/zcl_command_arguments}} +{{#if (isStrEqual source "client")}} +{{/if}} + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MC{{cluster}}Cluster{{command}}Params alloc] init]; + + {{#zcl_command_arguments}} + other.{{asStructPropertyName label}} = self.{{asStructPropertyName label}}; + {{/zcl_command_arguments}} + + return other; +} + +- (NSString *)description +{ + NSString *descriptionString = [NSString stringWithFormat:@"<%@: {{#zcl_command_arguments}}{{asStructPropertyName label}}:%@; {{/zcl_command_arguments}}>", NSStringFromClass([self class]) {{#zcl_command_arguments}},{{#if isArray}}_{{asStructPropertyName label}}{{else if (isOctetString type)}}[_{{asStructPropertyName label}} base64EncodedStringWithOptions:0]{{else}}_{{asStructPropertyName label}}{{/if}}{{/zcl_command_arguments}}]; + return descriptionString; +} + +{{#if (isStrEqual source "client")}} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::Type cppStruct; + ListFreer listFreer; + {{#zcl_command_arguments}} + { + {{>encode_value target=(concat "cppStruct." (asLowerCamelCase label)) source=(concat "self." (asStructPropertyName label)) cluster=parent.parent.name errorCode="return CHIP_ERROR_INVALID_ARGUMENT;" depth=0}} + } + {{/zcl_command_arguments}} + + return std::any(cppStruct); +} +{{else}} + +- (std::any)getCppRequestFromObjCRequest { + // Default implementation + return CHIP_NO_ERROR; +} +{{/if}} +{{#if (isStrEqual source "server")}} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppResponse +{ + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType cppDecodableStruct = *responseSharedPtr; + + {{#zcl_command_arguments}} + { + {{>decode_value target=(concat "self." (asStructPropertyName label)) source=(concat "cppDecodableStruct." (asLowerCamelCase label)) cluster=parent.parent.name errorCode="return err;" depth=0}} + } + {{/zcl_command_arguments}} + return CHIP_NO_ERROR; +} +{{else}} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +{{/if}} +@end +{{/inline}} +{{> completeImpl cluster=(asUpperCamelCase parent.name preserveAcronyms=true) + command=(asUpperCamelCase name preserveAcronyms=true)}} + +{{/zcl_commands}} +{{/if}} +{{/zcl_clusters}} + +NS_ASSUME_NONNULL_END diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads.zapt new file mode 100644 index 00000000000000..db9a41045a81ec --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads.zapt @@ -0,0 +1,34 @@ +{{> header excludeZapComment=false}} + +#import "MCInteractionModelStructs.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface MCAbstractPayload : NSObject +@end + +{{#zcl_clusters}} +{{#if (isInConfigList name "MatterCastingClusters")}} + +// {{asUpperCamelCase name}} cluster: +{{#zcl_commands}} +{{#*inline "completeDecl"}} + +@interface MC{{cluster}}Cluster{{command}}Params : {{base}} +{{#zcl_command_arguments}} +{{> struct_field_decl cluster=parent.parent.name type=type label=label}}; +{{#*inline "oldNameFieldDecl"}} +{{> struct_field_decl cluster=parent.parent.name type=type label=commandField}}; +{{/inline}} +{{/zcl_command_arguments}} +@end +{{/inline}} +{{> completeDecl cluster=(asUpperCamelCase parent.name preserveAcronyms=true) + command=(asUpperCamelCase name preserveAcronyms=true) + deprecationMessage="This command has been removed" + base="MCAbstractPayload"}} +{{/zcl_commands}} +{{/if}} +{{/zcl_clusters}} + +NS_ASSUME_NONNULL_END diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/availability.yaml b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/availability.yaml deleted file mode 100644 index aa94eeb919f6dc..00000000000000 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/availability.yaml +++ /dev/null @@ -1,8664 +0,0 @@ -# The magic value "future" for versions can be used once we are -# tracking a release but don't know what its version numbers will be. -# -# Each release has: -# * A name (labeled "release") -# * A versions field which is either a dictionary of per-OS versions, or "future" -# * "introduced" and "deprecated" fields, which are dictionaries with the following keys: -# * "clusters": An array of cluster names -# * "attributes": A dictionary with cluster names as keys and arrays of -# attribute names as values. -# * "commands": A dictionary with cluster names as keys and arrays of -# command names as values. -# * "command fields": A dictionary with cluster names as keys and dictionaries -# as values. Those dictionaries have command names as -# keys and arrays of field names as values. -# * "structs": A dictionary with cluster names as keys and arrays of -# struct names as values. -# * "struct fields": A dictionary with cluster names as keys and dictionaries -# as values. Those dictionaries have struct names as -# keys and arrays of field names as values. -# * "events": A dictionary with cluster names as keys and arrays of -# event names as values. -# * "event fields": A dictionary with cluster names as keys and dictionaries -# as values. Those dictionaries have event names as -# keys and arrays of field names as values. -# * "enums": A dictionary with cluster names as keys and arrays of -# enum names as values. -# * "enum values": A dictionary with cluster names as keys and dictionaries -# as values. Those dictionaries have enum names as -# keys and arrays of enum value names as values. -# * "bitmaps": A dictionary with cluster names as keys and arrays of -# bitmap names as values. -# * "bitmap values": A dictionary with cluster names as keys and dictionaries -# as values. Those dictionaries have bitmap names as -# keys and arrays of bitmap value names as values. -# * "ids": Can contain clusters, attributes, commands, events as described -# above inside it, but just indicates whether the id was -# introduced/deprecated, not the construct itself. -# * "command payloads": Lists commands only, if we introduced the payload without -# actually exposing API for the command. -# * "global attributes": An array of names of global attributes. -# * "apis": An array of API labels that codegen can use. -# -# * "renames": Can contain clusters, attributes, etc as described -# above for "introduced" and "deprecated", with the one -# difference that instead of an array the value is a hash -# with new names as keys and old names as values. -# -# * "removed": Can contain clusters, commands, attributes, etc as described -# above for "introduced" and "deprecated". Items can be removed -# without ever being introduced, if they are added to the XML but -# we have never shipped generated APIs for them. -# NOTE: support for "removed" may not be complete in the templates. -# Please examine codegen carefully when using "removed" to make -# sure all the things that should have been removed have been. -# -# * "swiftUnavailable": Can contain clusters, commands, attributes, etc as -# described above for "introduced" and "deprecated". This -# can be used to mark APIs with NS_SWIFT_UNAVAILABLE, -# typically when an API was renamed between two names that -# map to the same Swift name and then both names were -# deprecated. -# -# * "provisional": Can contain clusters, commands, attributes, etc as described -# above for "introduced" and "deprecated". Items can be -# defined as provisional to prevent code generation for them. -# If they are then listed as introduced in a release that is -# later than the one where they were marked provisional, -# they will start being code-generated. -# NOTE: support for "provisional" may not be complete in the -# templates. Please examine codegen carefully when using -# "provisional" to make sure all the things that should have -# been omitted have been. - -- release: "Initial release" - versions: - iOS: "16.1" - macOS: "13.0" - watchOS: "9.1" - tvOS: "16.1" - introduced: - clusters: - - Identify - - Groups - - Scenes - - OnOff - - OnOffSwitchConfiguration - - LevelControl - - BinaryInputBasic - - Descriptor - - Binding - - AccessControl - - Actions - - Basic - - OtaSoftwareUpdateProvider - - OtaSoftwareUpdateRequestor - - LocalizationConfiguration - - TimeFormatLocalization - - UnitLocalization - - PowerSourceConfiguration - - PowerSource - - GeneralCommissioning - - NetworkCommissioning - - DiagnosticLogs - - GeneralDiagnostics - - SoftwareDiagnostics - - ThreadNetworkDiagnostics - - WiFiNetworkDiagnostics - - EthernetNetworkDiagnostics - - BridgedDeviceBasic - - Switch - - AdministratorCommissioning - - OperationalCredentials - - GroupKeyManagement - - FixedLabel - - UserLabel - - BooleanState - - ModeSelect - - DoorLock - - WindowCovering - - BarrierControl - - PumpConfigurationAndControl - - Thermostat - - FanControl - - ThermostatUserInterfaceConfiguration - - ColorControl - - BallastConfiguration - - IlluminanceMeasurement - - TemperatureMeasurement - - PressureMeasurement - - FlowMeasurement - - RelativeHumidityMeasurement - - OccupancySensing - - WakeOnLan - - Channel - - TargetNavigator - - MediaPlayback - - MediaInput - - LowPower - - KeypadInput - - ContentLauncher - - AudioOutput - - ApplicationLauncher - - ApplicationBasic - - AccountLogin - - ElectricalMeasurement - - TestCluster - attributes: - Identify: - - IdentifyTime - - IdentifyType - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - Groups: - - NameSupport - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - Scenes: - - SceneCount - - CurrentScene - - CurrentGroup - - SceneValid - - NameSupport - - LastConfiguredBy - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - OnOff: - - OnOff - - GlobalSceneControl - - OnTime - - OffWaitTime - - StartUpOnOff - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - OnOffSwitchConfiguration: - - SwitchType - - SwitchActions - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - LevelControl: - - CurrentLevel - - RemainingTime - - MinLevel - - MaxLevel - - CurrentFrequency - - MinFrequency - - MaxFrequency - - Options - - OnOffTransitionTime - - OnLevel - - OnTransitionTime - - OffTransitionTime - - DefaultMoveRate - - StartUpCurrentLevel - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - BinaryInputBasic: - - ActiveText - - Description - - InactiveText - - OutOfService - - Polarity - - PresentValue - - Reliability - - StatusFlags - - ApplicationType - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - Descriptor: - - DeviceList - - ServerList - - ClientList - - PartsList - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - Binding: - - Binding - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - AccessControl: - - Acl - - Extension - - SubjectsPerAccessControlEntry - - TargetsPerAccessControlEntry - - AccessControlEntriesPerFabric - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - Actions: - - ActionList - - EndpointLists - - SetupURL - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - Basic: - - DataModelRevision - - VendorName - - VendorID - - ProductName - - ProductID - - NodeLabel - - Location - - HardwareVersion - - HardwareVersionString - - SoftwareVersion - - SoftwareVersionString - - ManufacturingDate - - PartNumber - - ProductURL - - ProductLabel - - SerialNumber - - LocalConfigDisabled - - Reachable - - UniqueID - - CapabilityMinima - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - OtaSoftwareUpdateProvider: - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - OtaSoftwareUpdateRequestor: - - DefaultOtaProviders - - UpdatePossible - - UpdateState - - UpdateStateProgress - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - LocalizationConfiguration: - - ActiveLocale - - SupportedLocales - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - TimeFormatLocalization: - - HourFormat - - ActiveCalendarType - - SupportedCalendarTypes - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - UnitLocalization: - - TemperatureUnit - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - PowerSourceConfiguration: - - Sources - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - PowerSource: - - Status - - Order - - Description - - WiredAssessedInputVoltage - - WiredAssessedInputFrequency - - WiredCurrentType - - WiredAssessedCurrent - - WiredNominalVoltage - - WiredMaximumCurrent - - WiredPresent - - ActiveWiredFaults - - BatVoltage - - BatPercentRemaining - - BatTimeRemaining - - BatChargeLevel - - BatReplacementNeeded - - BatReplaceability - - BatPresent - - ActiveBatFaults - - BatReplacementDescription - - BatCommonDesignation - - BatANSIDesignation - - BatIECDesignation - - BatApprovedChemistry - - BatCapacity - - BatQuantity - - BatChargeState - - BatTimeToFullCharge - - BatFunctionalWhileCharging - - BatChargingCurrent - - ActiveBatChargeFaults - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - GeneralCommissioning: - - Breadcrumb - - BasicCommissioningInfo - - RegulatoryConfig - - LocationCapability - - SupportsConcurrentConnection - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - NetworkCommissioning: - - MaxNetworks - - Networks - - ScanMaxTimeSeconds - - ConnectMaxTimeSeconds - - InterfaceEnabled - - LastNetworkingStatus - - LastNetworkID - - LastConnectErrorValue - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - DiagnosticLogs: - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - GeneralDiagnostics: - - NetworkInterfaces - - RebootCount - - UpTime - - TotalOperationalHours - - BootReasons - - ActiveHardwareFaults - - ActiveRadioFaults - - ActiveNetworkFaults - - TestEventTriggersEnabled - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - SoftwareDiagnostics: - - ThreadMetrics - - CurrentHeapFree - - CurrentHeapUsed - - CurrentHeapHighWatermark - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - ThreadNetworkDiagnostics: - - Channel - - RoutingRole - - NetworkName - - PanId - - ExtendedPanId - - MeshLocalPrefix - - OverrunCount - - NeighborTableList - - RouteTableList - - PartitionId - - Weighting - - DataVersion - - StableDataVersion - - LeaderRouterId - - DetachedRoleCount - - ChildRoleCount - - RouterRoleCount - - LeaderRoleCount - - AttachAttemptCount - - PartitionIdChangeCount - - BetterPartitionAttachAttemptCount - - ParentChangeCount - - TxTotalCount - - TxUnicastCount - - TxBroadcastCount - - TxAckRequestedCount - - TxAckedCount - - TxNoAckRequestedCount - - TxDataCount - - TxDataPollCount - - TxBeaconCount - - TxBeaconRequestCount - - TxOtherCount - - TxRetryCount - - TxDirectMaxRetryExpiryCount - - TxIndirectMaxRetryExpiryCount - - TxErrCcaCount - - TxErrAbortCount - - TxErrBusyChannelCount - - RxTotalCount - - RxUnicastCount - - RxBroadcastCount - - RxDataCount - - RxDataPollCount - - RxBeaconCount - - RxBeaconRequestCount - - RxOtherCount - - RxAddressFilteredCount - - RxDestAddrFilteredCount - - RxDuplicatedCount - - RxErrNoFrameCount - - RxErrUnknownNeighborCount - - RxErrInvalidSrcAddrCount - - RxErrSecCount - - RxErrFcsCount - - RxErrOtherCount - - ActiveTimestamp - - PendingTimestamp - - Delay - - SecurityPolicy - - ChannelPage0Mask - - OperationalDatasetComponents - - ActiveNetworkFaultsList - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - WiFiNetworkDiagnostics: - - Bssid - - SecurityType - - WiFiVersion - - ChannelNumber - - Rssi - - BeaconLostCount - - BeaconRxCount - - PacketMulticastRxCount - - PacketMulticastTxCount - - PacketUnicastRxCount - - PacketUnicastTxCount - - CurrentMaxRate - - OverrunCount - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - EthernetNetworkDiagnostics: - - PHYRate - - FullDuplex - - PacketRxCount - - PacketTxCount - - TxErrCount - - CollisionCount - - OverrunCount - - CarrierDetect - - TimeSinceReset - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - BridgedDeviceBasic: - - VendorName - - VendorID - - ProductName - - NodeLabel - - HardwareVersion - - HardwareVersionString - - SoftwareVersion - - SoftwareVersionString - - ManufacturingDate - - PartNumber - - ProductURL - - ProductLabel - - SerialNumber - - Reachable - - UniqueID - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - Switch: - - NumberOfPositions - - CurrentPosition - - MultiPressMax - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - AdministratorCommissioning: - - WindowStatus - - AdminFabricIndex - - AdminVendorId - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - OperationalCredentials: - - NOCs - - Fabrics - - SupportedFabrics - - CommissionedFabrics - - TrustedRootCertificates - - CurrentFabricIndex - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - GroupKeyManagement: - - GroupKeyMap - - GroupTable - - MaxGroupsPerFabric - - MaxGroupKeysPerFabric - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - FixedLabel: - - LabelList - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - UserLabel: - - LabelList - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - BooleanState: - - StateValue - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - ModeSelect: - - Description - - StandardNamespace - - SupportedModes - - CurrentMode - - StartUpMode - - OnMode - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - DoorLock: - - LockState - - LockType - - ActuatorEnabled - - DoorState - - DoorOpenEvents - - DoorClosedEvents - - OpenPeriod - - NumberOfTotalUsersSupported - - NumberOfPINUsersSupported - - NumberOfRFIDUsersSupported - - NumberOfWeekDaySchedulesSupportedPerUser - - NumberOfYearDaySchedulesSupportedPerUser - - NumberOfHolidaySchedulesSupported - - MaxPINCodeLength - - MinPINCodeLength - - MaxRFIDCodeLength - - MinRFIDCodeLength - - CredentialRulesSupport - - NumberOfCredentialsSupportedPerUser - - Language - - LEDSettings - - AutoRelockTime - - SoundVolume - - OperatingMode - - SupportedOperatingModes - - DefaultConfigurationRegister - - EnableLocalProgramming - - EnableOneTouchLocking - - EnableInsideStatusLED - - EnablePrivacyModeButton - - LocalProgrammingFeatures - - WrongCodeEntryLimit - - UserCodeTemporaryDisableTime - - SendPINOverTheAir - - RequirePINforRemoteOperation - - ExpiringUserTimeout - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - WindowCovering: - - Type - - PhysicalClosedLimitLift - - PhysicalClosedLimitTilt - - CurrentPositionLift - - CurrentPositionTilt - - NumberOfActuationsLift - - NumberOfActuationsTilt - - ConfigStatus - - CurrentPositionLiftPercentage - - CurrentPositionTiltPercentage - - OperationalStatus - - TargetPositionLiftPercent100ths - - TargetPositionTiltPercent100ths - - EndProductType - - CurrentPositionLiftPercent100ths - - CurrentPositionTiltPercent100ths - - InstalledOpenLimitLift - - InstalledClosedLimitLift - - InstalledOpenLimitTilt - - InstalledClosedLimitTilt - - Mode - - SafetyStatus - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - BarrierControl: - - BarrierMovingState - - BarrierSafetyStatus - - BarrierCapabilities - - BarrierOpenEvents - - BarrierCloseEvents - - BarrierCommandOpenEvents - - BarrierCommandCloseEvents - - BarrierOpenPeriod - - BarrierClosePeriod - - BarrierPosition - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - PumpConfigurationAndControl: - - MaxPressure - - MaxSpeed - - MaxFlow - - MinConstPressure - - MaxConstPressure - - MinCompPressure - - MaxCompPressure - - MinConstSpeed - - MaxConstSpeed - - MinConstFlow - - MaxConstFlow - - MinConstTemp - - MaxConstTemp - - PumpStatus - - EffectiveOperationMode - - EffectiveControlMode - - Capacity - - Speed - - LifetimeRunningHours - - Power - - LifetimeEnergyConsumed - - OperationMode - - ControlMode - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - Thermostat: - - LocalTemperature - - OutdoorTemperature - - Occupancy - - AbsMinHeatSetpointLimit - - AbsMaxHeatSetpointLimit - - AbsMinCoolSetpointLimit - - AbsMaxCoolSetpointLimit - - PICoolingDemand - - PIHeatingDemand - - HVACSystemTypeConfiguration - - LocalTemperatureCalibration - - OccupiedCoolingSetpoint - - OccupiedHeatingSetpoint - - UnoccupiedCoolingSetpoint - - UnoccupiedHeatingSetpoint - - MinHeatSetpointLimit - - MaxHeatSetpointLimit - - MinCoolSetpointLimit - - MaxCoolSetpointLimit - - MinSetpointDeadBand - - RemoteSensing - - ControlSequenceOfOperation - - SystemMode - - ThermostatRunningMode - - StartOfWeek - - NumberOfWeeklyTransitions - - NumberOfDailyTransitions - - TemperatureSetpointHold - - TemperatureSetpointHoldDuration - - ThermostatProgrammingOperationMode - - ThermostatRunningState - - SetpointChangeSource - - SetpointChangeAmount - - SetpointChangeSourceTimestamp - - OccupiedSetback - - OccupiedSetbackMin - - OccupiedSetbackMax - - UnoccupiedSetback - - UnoccupiedSetbackMin - - UnoccupiedSetbackMax - - EmergencyHeatDelta - - ACType - - ACCapacity - - ACRefrigerantType - - ACCompressorType - - ACErrorCode - - ACLouverPosition - - ACCoilTemperature - - ACCapacityformat - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - FanControl: - - FanMode - - FanModeSequence - - PercentSetting - - PercentCurrent - - SpeedMax - - SpeedSetting - - SpeedCurrent - - RockSupport - - RockSetting - - WindSupport - - WindSetting - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - ThermostatUserInterfaceConfiguration: - - TemperatureDisplayMode - - KeypadLockout - - ScheduleProgrammingVisibility - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - ColorControl: - - CurrentHue - - CurrentSaturation - - RemainingTime - - CurrentX - - CurrentY - - DriftCompensation - - CompensationText - - ColorTemperatureMireds - - ColorMode - - Options - - NumberOfPrimaries - - Primary1X - - Primary1Y - - Primary1Intensity - - Primary2X - - Primary2Y - - Primary2Intensity - - Primary3X - - Primary3Y - - Primary3Intensity - - Primary4X - - Primary4Y - - Primary4Intensity - - Primary5X - - Primary5Y - - Primary5Intensity - - Primary6X - - Primary6Y - - Primary6Intensity - - WhitePointX - - WhitePointY - - ColorPointRX - - ColorPointRY - - ColorPointRIntensity - - ColorPointGX - - ColorPointGY - - ColorPointGIntensity - - ColorPointBX - - ColorPointBY - - ColorPointBIntensity - - EnhancedCurrentHue - - EnhancedColorMode - - ColorLoopActive - - ColorLoopDirection - - ColorLoopTime - - ColorLoopStartEnhancedHue - - ColorLoopStoredEnhancedHue - - ColorCapabilities - - ColorTempPhysicalMinMireds - - ColorTempPhysicalMaxMireds - - CoupleColorTempToLevelMinMireds - - StartUpColorTemperatureMireds - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - BallastConfiguration: - - PhysicalMinLevel - - PhysicalMaxLevel - - BallastStatus - - MinLevel - - MaxLevel - - IntrinsicBalanceFactor - - BallastFactorAdjustment - - LampQuantity - - LampType - - LampManufacturer - - LampRatedHours - - LampBurnHours - - LampAlarmMode - - LampBurnHoursTripPoint - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - IlluminanceMeasurement: - - MeasuredValue - - MinMeasuredValue - - MaxMeasuredValue - - Tolerance - - LightSensorType - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - TemperatureMeasurement: - - MeasuredValue - - MinMeasuredValue - - MaxMeasuredValue - - Tolerance - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - PressureMeasurement: - - MeasuredValue - - MinMeasuredValue - - MaxMeasuredValue - - Tolerance - - ScaledValue - - MinScaledValue - - MaxScaledValue - - ScaledTolerance - - Scale - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - FlowMeasurement: - - MeasuredValue - - MinMeasuredValue - - MaxMeasuredValue - - Tolerance - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - RelativeHumidityMeasurement: - - MeasuredValue - - MinMeasuredValue - - MaxMeasuredValue - - Tolerance - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - OccupancySensing: - - Occupancy - - OccupancySensorType - - OccupancySensorTypeBitmap - - PirOccupiedToUnoccupiedDelay - - PirUnoccupiedToOccupiedDelay - - PirUnoccupiedToOccupiedThreshold - - UltrasonicOccupiedToUnoccupiedDelay - - UltrasonicUnoccupiedToOccupiedDelay - - UltrasonicUnoccupiedToOccupiedThreshold - - PhysicalContactOccupiedToUnoccupiedDelay - - PhysicalContactUnoccupiedToOccupiedDelay - - PhysicalContactUnoccupiedToOccupiedThreshold - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - WakeOnLan: - - MACAddress - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - Channel: - - ChannelList - - Lineup - - CurrentChannel - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - TargetNavigator: - - TargetList - - CurrentTarget - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - MediaPlayback: - - CurrentState - - StartTime - - Duration - - SampledPosition - - PlaybackSpeed - - SeekRangeEnd - - SeekRangeStart - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - MediaInput: - - InputList - - CurrentInput - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - LowPower: - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - KeypadInput: - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - ContentLauncher: - - AcceptHeader - - SupportedStreamingProtocols - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - AudioOutput: - - OutputList - - CurrentOutput - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - ApplicationLauncher: - - CatalogList - - CurrentApp - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - ApplicationBasic: - - VendorName - - VendorID - - ApplicationName - - ProductID - - Application - - Status - - ApplicationVersion - - AllowedVendorList - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - AccountLogin: - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - ElectricalMeasurement: - - MeasurementType - - DcVoltage - - DcVoltageMin - - DcVoltageMax - - DcCurrent - - DcCurrentMin - - DcCurrentMax - - DcPower - - DcPowerMin - - DcPowerMax - - DcVoltageMultiplier - - DcVoltageDivisor - - DcCurrentMultiplier - - DcCurrentDivisor - - DcPowerMultiplier - - DcPowerDivisor - - AcFrequency - - AcFrequencyMin - - AcFrequencyMax - - NeutralCurrent - - TotalActivePower - - TotalReactivePower - - TotalApparentPower - - Measured1stHarmonicCurrent - - Measured3rdHarmonicCurrent - - Measured5thHarmonicCurrent - - Measured7thHarmonicCurrent - - Measured9thHarmonicCurrent - - Measured11thHarmonicCurrent - - MeasuredPhase1stHarmonicCurrent - - MeasuredPhase3rdHarmonicCurrent - - MeasuredPhase5thHarmonicCurrent - - MeasuredPhase7thHarmonicCurrent - - MeasuredPhase9thHarmonicCurrent - - MeasuredPhase11thHarmonicCurrent - - AcFrequencyMultiplier - - AcFrequencyDivisor - - PowerMultiplier - - PowerDivisor - - HarmonicCurrentMultiplier - - PhaseHarmonicCurrentMultiplier - - InstantaneousVoltage - - InstantaneousLineCurrent - - InstantaneousActiveCurrent - - InstantaneousReactiveCurrent - - InstantaneousPower - - RmsVoltage - - RmsVoltageMin - - RmsVoltageMax - - RmsCurrent - - RmsCurrentMin - - RmsCurrentMax - - ActivePower - - ActivePowerMin - - ActivePowerMax - - ReactivePower - - ApparentPower - - PowerFactor - - AverageRmsVoltageMeasurementPeriod - - AverageRmsUnderVoltageCounter - - RmsExtremeOverVoltagePeriod - - RmsExtremeUnderVoltagePeriod - - RmsVoltageSagPeriod - - RmsVoltageSwellPeriod - - AcVoltageMultiplier - - AcVoltageDivisor - - AcCurrentMultiplier - - AcCurrentDivisor - - AcPowerMultiplier - - AcPowerDivisor - - OverloadAlarmsMask - - VoltageOverload - - CurrentOverload - - AcOverloadAlarmsMask - - AcVoltageOverload - - AcCurrentOverload - - AcActivePowerOverload - - AcReactivePowerOverload - - AverageRmsOverVoltage - - AverageRmsUnderVoltage - - RmsExtremeOverVoltage - - RmsExtremeUnderVoltage - - RmsVoltageSag - - RmsVoltageSwell - - LineCurrentPhaseB - - ActiveCurrentPhaseB - - ReactiveCurrentPhaseB - - RmsVoltagePhaseB - - RmsVoltageMinPhaseB - - RmsVoltageMaxPhaseB - - RmsCurrentPhaseB - - RmsCurrentMinPhaseB - - RmsCurrentMaxPhaseB - - ActivePowerPhaseB - - ActivePowerMinPhaseB - - ActivePowerMaxPhaseB - - ReactivePowerPhaseB - - ApparentPowerPhaseB - - PowerFactorPhaseB - - AverageRmsVoltageMeasurementPeriodPhaseB - - AverageRmsOverVoltageCounterPhaseB - - AverageRmsUnderVoltageCounterPhaseB - - RmsExtremeOverVoltagePeriodPhaseB - - RmsExtremeUnderVoltagePeriodPhaseB - - RmsVoltageSagPeriodPhaseB - - RmsVoltageSwellPeriodPhaseB - - LineCurrentPhaseC - - ActiveCurrentPhaseC - - ReactiveCurrentPhaseC - - RmsVoltagePhaseC - - RmsVoltageMinPhaseC - - RmsVoltageMaxPhaseC - - RmsCurrentPhaseC - - RmsCurrentMinPhaseC - - RmsCurrentMaxPhaseC - - ActivePowerPhaseC - - ActivePowerMinPhaseC - - ActivePowerMaxPhaseC - - ReactivePowerPhaseC - - ApparentPowerPhaseC - - PowerFactorPhaseC - - AverageRmsVoltageMeasurementPeriodPhaseC - - AverageRmsOverVoltageCounterPhaseC - - AverageRmsUnderVoltageCounterPhaseC - - RmsExtremeOverVoltagePeriodPhaseC - - RmsExtremeUnderVoltagePeriodPhaseC - - RmsVoltageSagPeriodPhaseC - - RmsVoltageSwellPeriodPhaseC - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - TestCluster: - - Boolean - - Bitmap8 - - Bitmap16 - - Bitmap32 - - Bitmap64 - - Int8u - - Int16u - - Int24u - - Int32u - - Int40u - - Int48u - - Int56u - - Int64u - - Int8s - - Int16s - - Int24s - - Int32s - - Int40s - - Int48s - - Int56s - - Int64s - - Enum8 - - Enum16 - - FloatSingle - - FloatDouble - - OctetString - - ListInt8u - - ListOctetString - - ListStructOctetString - - LongOctetString - - CharString - - LongCharString - - EpochUs - - EpochS - - VendorId - - ListNullablesAndOptionalsStruct - - EnumAttr - - StructAttr - - RangeRestrictedInt8u - - RangeRestrictedInt8s - - RangeRestrictedInt16u - - RangeRestrictedInt16s - - ListLongOctetString - - ListFabricScoped - - TimedWriteBoolean - - GeneralErrorBoolean - - ClusterErrorBoolean - - Unsupported - - NullableBoolean - - NullableBitmap8 - - NullableBitmap16 - - NullableBitmap32 - - NullableBitmap64 - - NullableInt8u - - NullableInt16u - - NullableInt24u - - NullableInt32u - - NullableInt40u - - NullableInt48u - - NullableInt56u - - NullableInt64u - - NullableInt8s - - NullableInt16s - - NullableInt24s - - NullableInt32s - - NullableInt40s - - NullableInt48s - - NullableInt56s - - NullableInt64s - - NullableEnum8 - - NullableEnum16 - - NullableFloatSingle - - NullableFloatDouble - - NullableOctetString - - NullableCharString - - NullableEnumAttr - - NullableStruct - - NullableRangeRestrictedInt8u - - NullableRangeRestrictedInt8s - - NullableRangeRestrictedInt16u - - NullableRangeRestrictedInt16s - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - commands: - Identify: - - Identify - - TriggerEffect - Groups: - - AddGroup - - AddGroupResponse - - ViewGroup - - ViewGroupResponse - - GetGroupMembership - - GetGroupMembershipResponse - - RemoveGroup - - RemoveGroupResponse - - RemoveAllGroups - - AddGroupIfIdentifying - Scenes: - - AddScene - - AddSceneResponse - - ViewScene - - ViewSceneResponse - - RemoveScene - - RemoveSceneResponse - - RemoveAllScenes - - RemoveAllScenesResponse - - StoreScene - - StoreSceneResponse - - RecallScene - - GetSceneMembership - - GetSceneMembershipResponse - - EnhancedAddScene - - EnhancedAddSceneResponse - - EnhancedViewScene - - EnhancedViewSceneResponse - - CopyScene - - CopySceneResponse - OnOff: - - Off - - On - - Toggle - - OffWithEffect - - OnWithRecallGlobalScene - - OnWithTimedOff - LevelControl: - - MoveToLevel - - Move - - Step - - Stop - - MoveToLevelWithOnOff - - MoveWithOnOff - - StepWithOnOff - - StopWithOnOff - - MoveToClosestFrequency - Actions: - - InstantAction - - InstantActionWithTransition - - StartAction - - StartActionWithDuration - - StopAction - - PauseAction - - PauseActionWithDuration - - ResumeAction - - EnableAction - - EnableActionWithDuration - - DisableAction - - DisableActionWithDuration - Basic: - - MfgSpecificPing - OtaSoftwareUpdateProvider: - - QueryImage - - QueryImageResponse - - ApplyUpdateRequest - - ApplyUpdateResponse - - NotifyUpdateApplied - OtaSoftwareUpdateRequestor: - - AnnounceOtaProvider - GeneralCommissioning: - - ArmFailSafe - - ArmFailSafeResponse - - SetRegulatoryConfig - - SetRegulatoryConfigResponse - - CommissioningComplete - - CommissioningCompleteResponse - NetworkCommissioning: - - ScanNetworks - - ScanNetworksResponse - - AddOrUpdateWiFiNetwork - - AddOrUpdateThreadNetwork - - RemoveNetwork - - NetworkConfigResponse - - ConnectNetwork - - ConnectNetworkResponse - - ReorderNetwork - DiagnosticLogs: - - RetrieveLogsRequest - - RetrieveLogsResponse - GeneralDiagnostics: - - TestEventTrigger - SoftwareDiagnostics: - - ResetWatermarks - ThreadNetworkDiagnostics: - - ResetCounts - WiFiNetworkDiagnostics: - - ResetCounts - EthernetNetworkDiagnostics: - - ResetCounts - AdministratorCommissioning: - - OpenCommissioningWindow - - OpenBasicCommissioningWindow - - RevokeCommissioning - OperationalCredentials: - - AttestationRequest - - AttestationResponse - - CertificateChainRequest - - CertificateChainResponse - - CSRRequest - - CSRResponse - - AddNOC - - UpdateNOC - - NOCResponse - - UpdateFabricLabel - - RemoveFabric - - AddTrustedRootCertificate - GroupKeyManagement: - - KeySetWrite - - KeySetRead - - KeySetReadResponse - - KeySetRemove - - KeySetReadAllIndices - - KeySetReadAllIndicesResponse - ModeSelect: - - ChangeToMode - DoorLock: - - LockDoor - - UnlockDoor - - UnlockWithTimeout - - SetWeekDaySchedule - - GetWeekDaySchedule - - GetWeekDayScheduleResponse - - ClearWeekDaySchedule - - SetYearDaySchedule - - GetYearDaySchedule - - GetYearDayScheduleResponse - - ClearYearDaySchedule - - SetHolidaySchedule - - GetHolidaySchedule - - GetHolidayScheduleResponse - - ClearHolidaySchedule - - SetUser - - GetUser - - GetUserResponse - - ClearUser - - SetCredential - - SetCredentialResponse - - GetCredentialStatus - - GetCredentialStatusResponse - - ClearCredential - WindowCovering: - - UpOrOpen - - DownOrClose - - StopMotion - - GoToLiftValue - - GoToLiftPercentage - - GoToTiltValue - - GoToTiltPercentage - BarrierControl: - - BarrierControlGoToPercent - - BarrierControlStop - Thermostat: - - SetpointRaiseLower - - GetWeeklyScheduleResponse - - SetWeeklySchedule - - GetWeeklySchedule - - ClearWeeklySchedule - ColorControl: - - MoveToHue - - MoveHue - - StepHue - - MoveToSaturation - - MoveSaturation - - StepSaturation - - MoveToHueAndSaturation - - MoveToColor - - MoveColor - - StepColor - - MoveToColorTemperature - - EnhancedMoveToHue - - EnhancedMoveHue - - EnhancedStepHue - - EnhancedMoveToHueAndSaturation - - ColorLoopSet - - StopMoveStep - - MoveColorTemperature - - StepColorTemperature - Channel: - - ChangeChannel - - ChangeChannelResponse - - ChangeChannelByNumber - - SkipChannel - TargetNavigator: - - NavigateTarget - - NavigateTargetResponse - MediaPlayback: - - Play - - Pause - - StopPlayback - - StartOver - - Previous - - Next - - Rewind - - FastForward - - SkipForward - - SkipBackward - - PlaybackResponse - - Seek - MediaInput: - - SelectInput - - ShowInputStatus - - HideInputStatus - - RenameInput - LowPower: - - Sleep - KeypadInput: - - SendKey - - SendKeyResponse - ContentLauncher: - - LaunchContent - - LaunchURL - - LaunchResponse - AudioOutput: - - SelectOutput - - RenameOutput - ApplicationLauncher: - - LaunchApp - - StopApp - - HideApp - - LauncherResponse - AccountLogin: - - GetSetupPIN - - GetSetupPINResponse - - Login - - Logout - ElectricalMeasurement: - - GetProfileInfoResponseCommand - - GetProfileInfoCommand - - GetMeasurementProfileResponseCommand - - GetMeasurementProfileCommand - TestCluster: - - Test - - TestSpecificResponse - - TestNotHandled - - TestAddArgumentsResponse - - TestSpecific - - TestSimpleArgumentResponse - - TestUnknownCommand - - TestStructArrayArgumentResponse - - TestAddArguments - - TestListInt8UReverseResponse - - TestSimpleArgumentRequest - - TestEnumsResponse - - TestStructArrayArgumentRequest - - TestNullableOptionalResponse - - TestStructArgumentRequest - - TestComplexNullableOptionalResponse - - TestNestedStructArgumentRequest - - BooleanResponse - - TestListStructArgumentRequest - - SimpleStructResponse - - TestListInt8UArgumentRequest - - TestEmitTestEventResponse - - TestNestedStructListArgumentRequest - - TestEmitTestFabricScopedEventResponse - - TestListNestedStructListArgumentRequest - - TestListInt8UReverseRequest - - TestEnumsRequest - - TestNullableOptionalRequest - - TestComplexNullableOptionalRequest - - SimpleStructEchoRequest - - TimedInvokeRequest - - TestSimpleOptionalArgumentRequest - - TestEmitTestEventRequest - - TestEmitTestFabricScopedEventRequest - command fields: - Identify: - Identify: - - identifyTime - TriggerEffect: - - effectIdentifier - - effectVariant - Groups: - AddGroup: - - groupId - - groupName - AddGroupResponse: - - status - - groupId - ViewGroup: - - groupId - ViewGroupResponse: - - status - - groupId - - groupName - GetGroupMembership: - - groupList - GetGroupMembershipResponse: - - capacity - - groupList - RemoveGroup: - - groupId - RemoveGroupResponse: - - status - - groupId - AddGroupIfIdentifying: - - groupId - - groupName - Scenes: - AddScene: - - groupId - - sceneId - - transitionTime - - sceneName - - extensionFieldSets - AddSceneResponse: - - status - - groupId - - sceneId - ViewScene: - - groupId - - sceneId - ViewSceneResponse: - - status - - groupId - - sceneId - - transitionTime - - sceneName - - extensionFieldSets - RemoveScene: - - groupId - - sceneId - RemoveSceneResponse: - - status - - groupId - - sceneId - RemoveAllScenes: - - groupId - RemoveAllScenesResponse: - - status - - groupId - StoreScene: - - groupId - - sceneId - StoreSceneResponse: - - status - - groupId - - sceneId - RecallScene: - - groupId - - sceneId - - transitionTime - GetSceneMembership: - - groupId - GetSceneMembershipResponse: - - status - - capacity - - groupId - - sceneList - EnhancedAddScene: - - groupId - - sceneId - - transitionTime - - sceneName - - extensionFieldSets - EnhancedAddSceneResponse: - - status - - groupId - - sceneId - EnhancedViewScene: - - groupId - - sceneId - EnhancedViewSceneResponse: - - status - - groupId - - sceneId - - transitionTime - - sceneName - - extensionFieldSets - CopyScene: - - mode - - groupIdFrom - - sceneIdFrom - - groupIdTo - - sceneIdTo - CopySceneResponse: - - status - - groupIdFrom - - sceneIdFrom - OnOff: - OffWithEffect: - - effectId - - effectVariant - OnWithTimedOff: - - onOffControl - - onTime - - offWaitTime - LevelControl: - MoveToLevel: - - level - - transitionTime - - optionsMask - - optionsOverride - Move: - - moveMode - - rate - - optionsMask - - optionsOverride - Step: - - stepMode - - stepSize - - transitionTime - - optionsMask - - optionsOverride - Stop: - - optionsMask - - optionsOverride - MoveToLevelWithOnOff: - - level - - transitionTime - - optionsMask - - optionsOverride - MoveWithOnOff: - - moveMode - - rate - - optionsMask - - optionsOverride - StepWithOnOff: - - stepMode - - stepSize - - transitionTime - - optionsMask - - optionsOverride - StopWithOnOff: - - optionsMask - - optionsOverride - MoveToClosestFrequency: - - frequency - Actions: - InstantAction: - - actionID - - invokeID - InstantActionWithTransition: - - actionID - - invokeID - - transitionTime - StartAction: - - actionID - - invokeID - StartActionWithDuration: - - actionID - - invokeID - - duration - StopAction: - - actionID - - invokeID - PauseAction: - - actionID - - invokeID - PauseActionWithDuration: - - actionID - - invokeID - - duration - ResumeAction: - - actionID - - invokeID - EnableAction: - - actionID - - invokeID - EnableActionWithDuration: - - actionID - - invokeID - - duration - DisableAction: - - actionID - - invokeID - DisableActionWithDuration: - - actionID - - invokeID - - duration - OtaSoftwareUpdateProvider: - QueryImage: - - vendorId - - productId - - softwareVersion - - protocolsSupported - - hardwareVersion - - location - - requestorCanConsent - - metadataForProvider - QueryImageResponse: - - status - - delayedActionTime - - imageURI - - softwareVersion - - softwareVersionString - - updateToken - - userConsentNeeded - - metadataForRequestor - ApplyUpdateRequest: - - updateToken - - newVersion - ApplyUpdateResponse: - - action - - delayedActionTime - NotifyUpdateApplied: - - updateToken - - softwareVersion - OtaSoftwareUpdateRequestor: - AnnounceOtaProvider: - - providerNodeId - - vendorId - - announcementReason - - metadataForNode - - endpoint - GeneralCommissioning: - ArmFailSafe: - - expiryLengthSeconds - - breadcrumb - ArmFailSafeResponse: - - errorCode - - debugText - SetRegulatoryConfig: - - newRegulatoryConfig - - countryCode - - breadcrumb - SetRegulatoryConfigResponse: - - errorCode - - debugText - CommissioningCompleteResponse: - - errorCode - - debugText - NetworkCommissioning: - ScanNetworks: - - ssid - - breadcrumb - ScanNetworksResponse: - - networkingStatus - - debugText - - wiFiScanResults - - threadScanResults - AddOrUpdateWiFiNetwork: - - ssid - - credentials - - breadcrumb - AddOrUpdateThreadNetwork: - - operationalDataset - - breadcrumb - RemoveNetwork: - - networkID - - breadcrumb - NetworkConfigResponse: - - networkingStatus - - debugText - - networkIndex - ConnectNetwork: - - networkID - - breadcrumb - ConnectNetworkResponse: - - networkingStatus - - debugText - - errorValue - ReorderNetwork: - - networkID - - networkIndex - - breadcrumb - DiagnosticLogs: - RetrieveLogsRequest: - - intent - - requestedProtocol - RetrieveLogsResponse: - - status - - content - - timeStamp - - timeSinceBoot - GeneralDiagnostics: - TestEventTrigger: - - enableKey - - eventTrigger - SoftwareDiagnostics: - ThreadNetworkDiagnostics: - WiFiNetworkDiagnostics: - EthernetNetworkDiagnostics: - TimeSynchronization: - SetUtcTime: - - utcTime - - granularity - - timeSource - AdministratorCommissioning: - OpenCommissioningWindow: - - commissioningTimeout - - pakeVerifier - - discriminator - - iterations - - salt - OpenBasicCommissioningWindow: - - commissioningTimeout - OperationalCredentials: - AttestationRequest: - - attestationNonce - AttestationResponse: - - attestationElements - - signature - CertificateChainRequest: - - certificateType - CertificateChainResponse: - - certificate - CSRRequest: - - csrNonce - - isForUpdateNOC - CSRResponse: - - nocsrElements - - attestationSignature - AddNOC: - - nocValue - - icacValue - - ipkValue - - caseAdminSubject - - adminVendorId - UpdateNOC: - - nocValue - - icacValue - NOCResponse: - - statusCode - - fabricIndex - - debugText - UpdateFabricLabel: - - label - RemoveFabric: - - fabricIndex - AddTrustedRootCertificate: - - rootCertificate - GroupKeyManagement: - KeySetWrite: - - groupKeySet - KeySetRead: - - groupKeySetID - KeySetReadResponse: - - groupKeySet - KeySetRemove: - - groupKeySetID - KeySetReadAllIndices: - - groupKeySetIDs - KeySetReadAllIndicesResponse: - - groupKeySetIDs - ModeSelect: - ChangeToMode: - - newMode - DoorLock: - LockDoor: - - pinCode - UnlockDoor: - - pinCode - UnlockWithTimeout: - - timeout - - pinCode - SetWeekDaySchedule: - - weekDayIndex - - userIndex - - daysMask - - startHour - - startMinute - - endHour - - endMinute - GetWeekDaySchedule: - - weekDayIndex - - userIndex - GetWeekDayScheduleResponse: - - weekDayIndex - - userIndex - - status - - daysMask - - startHour - - startMinute - - endHour - - endMinute - ClearWeekDaySchedule: - - weekDayIndex - - userIndex - SetYearDaySchedule: - - yearDayIndex - - userIndex - - localStartTime - - localEndTime - GetYearDaySchedule: - - yearDayIndex - - userIndex - GetYearDayScheduleResponse: - - yearDayIndex - - userIndex - - status - - localStartTime - - localEndTime - ClearYearDaySchedule: - - yearDayIndex - - userIndex - SetHolidaySchedule: - - holidayIndex - - localStartTime - - localEndTime - - operatingMode - GetHolidaySchedule: - - holidayIndex - GetHolidayScheduleResponse: - - holidayIndex - - status - - localStartTime - - localEndTime - - operatingMode - ClearHolidaySchedule: - - holidayIndex - SetUser: - - operationType - - userIndex - - userName - - userUniqueId - - userStatus - - userType - - credentialRule - GetUser: - - userIndex - GetUserResponse: - - userIndex - - userName - - userUniqueId - - userStatus - - userType - - credentialRule - - credentials - - creatorFabricIndex - - lastModifiedFabricIndex - - nextUserIndex - ClearUser: - - userIndex - SetCredential: - - operationType - - credential - - credentialData - - userIndex - - userStatus - - userType - SetCredentialResponse: - - status - - userIndex - - nextCredentialIndex - GetCredentialStatus: - - credential - GetCredentialStatusResponse: - - credentialExists - - userIndex - - creatorFabricIndex - - lastModifiedFabricIndex - - nextCredentialIndex - ClearCredential: - - credential - WindowCovering: - GoToLiftValue: - - liftValue - GoToLiftPercentage: - - liftPercent100thsValue - GoToTiltValue: - - tiltValue - GoToTiltPercentage: - - tiltPercent100thsValue - BarrierControl: - BarrierControlGoToPercent: - - percentOpen - Thermostat: - SetpointRaiseLower: - - mode - - amount - GetWeeklyScheduleResponse: - - numberOfTransitionsForSequence - - dayOfWeekForSequence - - modeForSequence - - transitions - SetWeeklySchedule: - - numberOfTransitionsForSequence - - dayOfWeekForSequence - - modeForSequence - - transitions - GetWeeklySchedule: - - daysToReturn - - modeToReturn - ColorControl: - MoveToHue: - - hue - - direction - - transitionTime - - optionsMask - - optionsOverride - MoveHue: - - moveMode - - rate - - optionsMask - - optionsOverride - StepHue: - - stepMode - - stepSize - - transitionTime - - optionsMask - - optionsOverride - MoveToSaturation: - - saturation - - transitionTime - - optionsMask - - optionsOverride - MoveSaturation: - - moveMode - - rate - - optionsMask - - optionsOverride - StepSaturation: - - stepMode - - stepSize - - transitionTime - - optionsMask - - optionsOverride - MoveToHueAndSaturation: - - hue - - saturation - - transitionTime - - optionsMask - - optionsOverride - MoveToColor: - - colorX - - colorY - - transitionTime - - optionsMask - - optionsOverride - MoveColor: - - rateX - - rateY - - optionsMask - - optionsOverride - StepColor: - - stepX - - stepY - - transitionTime - - optionsMask - - optionsOverride - MoveToColorTemperature: - - colorTemperature - - transitionTime - - optionsMask - - optionsOverride - EnhancedMoveToHue: - - enhancedHue - - direction - - transitionTime - - optionsMask - - optionsOverride - EnhancedMoveHue: - - moveMode - - rate - - optionsMask - - optionsOverride - EnhancedStepHue: - - stepMode - - stepSize - - transitionTime - - optionsMask - - optionsOverride - EnhancedMoveToHueAndSaturation: - - enhancedHue - - saturation - - transitionTime - - optionsMask - - optionsOverride - ColorLoopSet: - - updateFlags - - action - - direction - - time - - startHue - - optionsMask - - optionsOverride - StopMoveStep: - - optionsMask - - optionsOverride - MoveColorTemperature: - - moveMode - - rate - - colorTemperatureMinimumMireds - - colorTemperatureMaximumMireds - - optionsMask - - optionsOverride - StepColorTemperature: - - stepMode - - stepSize - - transitionTime - - colorTemperatureMinimumMireds - - colorTemperatureMaximumMireds - - optionsMask - - optionsOverride - Channel: - ChangeChannel: - - match - ChangeChannelResponse: - - status - - data - ChangeChannelByNumber: - - majorNumber - - minorNumber - SkipChannel: - - count - TargetNavigator: - NavigateTarget: - - target - - data - NavigateTargetResponse: - - status - - data - MediaPlayback: - SkipForward: - - deltaPositionMilliseconds - SkipBackward: - - deltaPositionMilliseconds - PlaybackResponse: - - status - - data - Seek: - - position - MediaInput: - SelectInput: - - index - RenameInput: - - index - - name - LowPower: - KeypadInput: - SendKey: - - keyCode - SendKeyResponse: - - status - ContentLauncher: - LaunchContent: - - search - - autoPlay - - data - LaunchURL: - - contentURL - - displayString - - brandingInformation - LaunchResponse: - - status - - data - AudioOutput: - SelectOutput: - - index - RenameOutput: - - index - - name - ApplicationLauncher: - LaunchApp: - - application - - data - StopApp: - - application - HideApp: - - application - LauncherResponse: - - status - - data - AccountLogin: - GetSetupPIN: - - tempAccountIdentifier - GetSetupPINResponse: - - setupPIN - Login: - - tempAccountIdentifier - - setupPIN - ElectricalMeasurement: - GetProfileInfoResponseCommand: - - profileCount - - profileIntervalPeriod - - maxNumberOfIntervals - - listOfAttributes - GetMeasurementProfileResponseCommand: - - startTime - - status - - profileIntervalPeriod - - numberOfIntervalsDelivered - - attributeId - - intervals - GetMeasurementProfileCommand: - - attributeId - - startTime - - numberOfIntervals - TestCluster: - TestSpecificResponse: - - returnValue - TestAddArgumentsResponse: - - returnValue - TestSimpleArgumentResponse: - - returnValue - TestStructArrayArgumentResponse: - - arg1 - - arg2 - - arg3 - - arg4 - - arg5 - - arg6 - TestAddArguments: - - arg1 - - arg2 - TestListInt8UReverseResponse: - - arg1 - TestSimpleArgumentRequest: - - arg1 - TestEnumsResponse: - - arg1 - - arg2 - TestStructArrayArgumentRequest: - - arg1 - - arg2 - - arg3 - - arg4 - - arg5 - - arg6 - TestNullableOptionalResponse: - - wasPresent - - wasNull - - value - - originalValue - TestStructArgumentRequest: - - arg1 - TestComplexNullableOptionalResponse: - - nullableIntWasNull - - nullableIntValue - - optionalIntWasPresent - - optionalIntValue - - nullableOptionalIntWasPresent - - nullableOptionalIntWasNull - - nullableOptionalIntValue - - nullableStringWasNull - - nullableStringValue - - optionalStringWasPresent - - optionalStringValue - - nullableOptionalStringWasPresent - - nullableOptionalStringWasNull - - nullableOptionalStringValue - - nullableStructWasNull - - nullableStructValue - - optionalStructWasPresent - - optionalStructValue - - nullableOptionalStructWasPresent - - nullableOptionalStructWasNull - - nullableOptionalStructValue - - nullableListWasNull - - nullableListValue - - optionalListWasPresent - - optionalListValue - - nullableOptionalListWasPresent - - nullableOptionalListWasNull - - nullableOptionalListValue - TestNestedStructArgumentRequest: - - arg1 - BooleanResponse: - - value - TestListStructArgumentRequest: - - arg1 - SimpleStructResponse: - - arg1 - TestListInt8UArgumentRequest: - - arg1 - TestEmitTestEventResponse: - - value - TestNestedStructListArgumentRequest: - - arg1 - TestEmitTestFabricScopedEventResponse: - - value - TestListNestedStructListArgumentRequest: - - arg1 - TestListInt8UReverseRequest: - - arg1 - TestEnumsRequest: - - arg1 - - arg2 - TestNullableOptionalRequest: - - arg1 - TestComplexNullableOptionalRequest: - - nullableInt - - optionalInt - - nullableOptionalInt - - nullableString - - optionalString - - nullableOptionalString - - nullableStruct - - optionalStruct - - nullableOptionalStruct - - nullableList - - optionalList - - nullableOptionalList - SimpleStructEchoRequest: - - arg1 - TestSimpleOptionalArgumentRequest: - - arg1 - TestEmitTestEventRequest: - - arg1 - - arg2 - - arg3 - TestEmitTestFabricScopedEventRequest: - - arg1 - FaultInjection: - FailAtFault: - - type - - id - - numCallsToSkip - - numCallsToFail - - takeMutex - FailRandomlyAtFault: - - type - - id - - percentage - structs: - Scenes: - - AttributeValuePair - - ExtensionFieldSet - Descriptor: - - DeviceType - Binding: - - TargetStruct - AccessControl: - - Target - - AccessControlEntry - - ExtensionEntry - Actions: - - ActionStruct - - EndpointListStruct - Basic: - - CapabilityMinimaStruct - OtaSoftwareUpdateRequestor: - - ProviderLocation - PowerSource: - - BatChargeFaultChangeType - - BatFaultChangeType - - WiredFaultChangeType - GeneralCommissioning: - - BasicCommissioningInfo - NetworkCommissioning: - - NetworkInfo - - ThreadInterfaceScanResult - - WiFiInterfaceScanResult - GeneralDiagnostics: - - NetworkInterfaceType - SoftwareDiagnostics: - - ThreadMetrics - ThreadNetworkDiagnostics: - - NeighborTable - - OperationalDatasetComponents - - RouteTable - - SecurityPolicy - TimeSynchronization: - - DstOffsetType - - TimeZoneType - OperationalCredentials: - - FabricDescriptor - - NOCStruct - GroupKeyManagement: - - GroupInfoMapStruct - - GroupKeyMapStruct - - GroupKeySetStruct - FixedLabel: - - LabelStruct - UserLabel: - - LabelStruct - ModeSelect: - - SemanticTag - - ModeOptionStruct - DoorLock: - - DlCredential - Thermostat: - - ThermostatScheduleTransition - Channel: - - ChannelInfo - - LineupInfo - TargetNavigator: - - TargetInfo - MediaPlayback: - - PlaybackPosition - MediaInput: - - InputInfo - ContentLauncher: - - Dimension - - AdditionalInfo - - Parameter - - ContentSearch - - StyleInformation - - BrandingInformation - AudioOutput: - - OutputInfo - ApplicationLauncher: - - Application - - ApplicationEP - ApplicationBasic: - - ApplicationBasicApplication - TestCluster: - - SimpleStruct - - TestFabricScoped - - NullablesAndOptionalsStruct - - NestedStruct - - NestedStructList - - DoubleNestedStructList - - TestListStructOctet - struct fields: - Scenes: - AttributeValuePair: - - attributeId - - attributeValue - ExtensionFieldSet: - - clusterId - - attributeValueList - Descriptor: - DeviceType: - - type - - revision - Binding: - TargetStruct: - - node - - group - - endpoint - - cluster - - fabricIndex - AccessControl: - Target: - - cluster - - endpoint - - deviceType - AccessControlEntry: - - privilege - - authMode - - subjects - - targets - - fabricIndex - ExtensionEntry: - - data - - fabricIndex - Actions: - ActionStruct: - - actionID - - name - - type - - endpointListID - - supportedCommands - - state - EndpointListStruct: - - endpointListID - - name - - type - - endpoints - Basic: - CapabilityMinimaStruct: - - caseSessionsPerFabric - - subscriptionsPerFabric - OtaSoftwareUpdateRequestor: - ProviderLocation: - - providerNodeID - - endpoint - - fabricIndex - PowerSource: - BatChargeFaultChangeType: - - current - - previous - BatFaultChangeType: - - current - - previous - WiredFaultChangeType: - - current - - previous - GeneralCommissioning: - BasicCommissioningInfo: - - failSafeExpiryLengthSeconds - - maxCumulativeFailsafeSeconds - NetworkCommissioning: - NetworkInfo: - - networkID - - connected - ThreadInterfaceScanResult: - - panId - - extendedPanId - - networkName - - channel - - version - - extendedAddress - - rssi - - lqi - WiFiInterfaceScanResult: - - security - - ssid - - bssid - - channel - - wiFiBand - - rssi - GeneralDiagnostics: - NetworkInterfaceType: - - name - - isOperational - - offPremiseServicesReachableIPv4 - - offPremiseServicesReachableIPv6 - - hardwareAddress - - iPv4Addresses - - iPv6Addresses - - type - SoftwareDiagnostics: - ThreadMetrics: - - id - - name - - stackFreeCurrent - - stackFreeMinimum - - stackSize - ThreadNetworkDiagnostics: - NeighborTable: - - extAddress - - age - - rloc16 - - linkFrameCounter - - mleFrameCounter - - lqi - - averageRssi - - lastRssi - - frameErrorRate - - messageErrorRate - - rxOnWhenIdle - - fullThreadDevice - - fullNetworkData - - isChild - OperationalDatasetComponents: - - activeTimestampPresent - - pendingTimestampPresent - - masterKeyPresent - - networkNamePresent - - extendedPanIdPresent - - meshLocalPrefixPresent - - delayPresent - - panIdPresent - - channelPresent - - pskcPresent - - securityPolicyPresent - - channelMaskPresent - RouteTable: - - extAddress - - rloc16 - - routerId - - nextHop - - pathCost - - lqiIn - - lqiOut - - age - - allocated - - linkEstablished - SecurityPolicy: - - rotationTime - - flags - TimeSynchronization: - DstOffsetType: - - offset - - validStarting - - validUntil - TimeZoneType: - - offset - - validAt - - name - OperationalCredentials: - FabricDescriptor: - - rootPublicKey - - vendorId - - fabricId - - nodeId - - label - - fabricIndex - NOCStruct: - - noc - - icac - - fabricIndex - GroupKeyManagement: - GroupInfoMapStruct: - - groupId - - endpoints - - groupName - - fabricIndex - GroupKeyMapStruct: - - groupId - - groupKeySetID - - fabricIndex - GroupKeySetStruct: - - groupKeySetID - - groupKeySecurityPolicy - - epochKey0 - - epochStartTime0 - - epochKey1 - - epochStartTime1 - - epochKey2 - - epochStartTime2 - FixedLabel: - LabelStruct: - - label - - value - UserLabel: - LabelStruct: - - label - - value - ModeSelect: - SemanticTag: - - mfgCode - - value - ModeOptionStruct: - - label - - mode - - semanticTags - DoorLock: - DlCredential: - - credentialType - - credentialIndex - Thermostat: - ThermostatScheduleTransition: - - transitionTime - - heatSetpoint - - coolSetpoint - Channel: - ChannelInfo: - - majorNumber - - minorNumber - - name - - callSign - - affiliateCallSign - LineupInfo: - - operatorName - - lineupName - - postalCode - - lineupInfoType - TargetNavigator: - TargetInfo: - - identifier - - name - MediaPlayback: - PlaybackPosition: - - updatedAt - - position - MediaInput: - InputInfo: - - index - - inputType - - name - - descriptionString - ContentLauncher: - Dimension: - - width - - height - - metric - AdditionalInfo: - - name - - value - Parameter: - - type - - value - - externalIDList - ContentSearch: - - parameterList - StyleInformation: - - imageUrl - - color - - size - BrandingInformation: - - providerName - - background - - logo - - progressBar - - splash - - waterMark - AudioOutput: - OutputInfo: - - index - - outputType - - name - ApplicationLauncher: - Application: - - catalogVendorId - - applicationId - ApplicationEP: - - application - - endpoint - ApplicationBasic: - ApplicationBasicApplication: - - catalogVendorId - - applicationId - TestCluster: - SimpleStruct: - - a - - b - - c - - d - - e - - f - - g - - h - TestFabricScoped: - - fabricSensitiveInt8u - - optionalFabricSensitiveInt8u - - nullableFabricSensitiveInt8u - - nullableOptionalFabricSensitiveInt8u - - fabricSensitiveCharString - - fabricSensitiveStruct - - fabricSensitiveInt8uList - - fabricIndex - NullablesAndOptionalsStruct: - - nullableInt - - optionalInt - - nullableOptionalInt - - nullableString - - optionalString - - nullableOptionalString - - nullableStruct - - optionalStruct - - nullableOptionalStruct - - nullableList - - optionalList - - nullableOptionalList - NestedStruct: - - a - - b - - c - NestedStructList: - - a - - b - - c - - d - - e - - f - - g - DoubleNestedStructList: - - a - TestListStructOctet: - - member1 - - member2 - events: - AccessControl: - - AccessControlEntryChanged - - AccessControlExtensionChanged - Actions: - - StateChanged - - ActionFailed - Basic: - - StartUp - - ShutDown - - Leave - - ReachableChanged - OtaSoftwareUpdateRequestor: - - StateTransition - - VersionApplied - - DownloadError - GeneralDiagnostics: - - HardwareFaultChange - - RadioFaultChange - - NetworkFaultChange - - BootReason - SoftwareDiagnostics: - - SoftwareFault - ThreadNetworkDiagnostics: - - ConnectionStatus - - NetworkFaultChange - WiFiNetworkDiagnostics: - - Disconnection - - AssociationFailure - - ConnectionStatus - BridgedDeviceBasic: - - StartUp - - ShutDown - - Leave - - ReachableChanged - Switch: - - SwitchLatched - - InitialPress - - LongPress - - ShortRelease - - LongRelease - - MultiPressOngoing - - MultiPressComplete - BooleanState: - - StateChange - DoorLock: - - DoorLockAlarm - - DoorStateChange - - LockOperation - - LockOperationError - - LockUserChange - PumpConfigurationAndControl: - - SupplyVoltageLow - - SupplyVoltageHigh - - PowerMissingPhase - - SystemPressureLow - - SystemPressureHigh - - DryRunning - - MotorTemperatureHigh - - PumpMotorFatalFailure - - ElectronicTemperatureHigh - - PumpBlocked - - SensorFailure - - ElectronicNonFatalFailure - - ElectronicFatalFailure - - GeneralFault - - Leakage - - AirDetection - - TurbineOperation - TestCluster: - - TestEvent - - TestFabricScopedEvent - event fields: - AccessControl: - AccessControlEntryChanged: - - adminNodeID - - adminPasscodeID - - changeType - - latestValue - - fabricIndex - AccessControlExtensionChanged: - - adminNodeID - - adminPasscodeID - - changeType - - latestValue - - fabricIndex - Actions: - StateChanged: - - actionID - - invokeID - - newState - ActionFailed: - - actionID - - invokeID - - newState - - error - Basic: - StartUp: - - softwareVersion - Leave: - - fabricIndex - ReachableChanged: - - reachableNewValue - OtaSoftwareUpdateRequestor: - StateTransition: - - previousState - - newState - - reason - - targetSoftwareVersion - VersionApplied: - - softwareVersion - - productID - DownloadError: - - softwareVersion - - bytesDownloaded - - progressPercent - - platformCode - GeneralDiagnostics: - HardwareFaultChange: - - current - - previous - RadioFaultChange: - - current - - previous - NetworkFaultChange: - - current - - previous - BootReason: - - bootReason - SoftwareDiagnostics: - SoftwareFault: - - id - - name - - faultRecording - ThreadNetworkDiagnostics: - ConnectionStatus: - - connectionStatus - NetworkFaultChange: - - current - - previous - WiFiNetworkDiagnostics: - Disconnection: - - reasonCode - AssociationFailure: - - associationFailure - - status - ConnectionStatus: - - connectionStatus - BridgedDeviceBasic: - StartUp: - - softwareVersion - ReachableChanged: - - reachableNewValue - Switch: - SwitchLatched: - - newPosition - InitialPress: - - newPosition - LongPress: - - newPosition - ShortRelease: - - previousPosition - LongRelease: - - previousPosition - MultiPressOngoing: - - newPosition - - currentNumberOfPressesCounted - MultiPressComplete: - - newPosition - - totalNumberOfPressesCounted - BooleanState: - StateChange: - - stateValue - DoorLock: - DoorLockAlarm: - - alarmCode - DoorStateChange: - - doorState - LockOperation: - - lockOperationType - - operationSource - - userIndex - - fabricIndex - - sourceNode - - credentials - LockOperationError: - - lockOperationType - - operationSource - - operationError - - userIndex - - fabricIndex - - sourceNode - - credentials - LockUserChange: - - lockDataType - - dataOperationType - - operationSource - - userIndex - - fabricIndex - - sourceNode - - dataIndex - PumpConfigurationAndControl: - TestCluster: - TestEvent: - - arg1 - - arg2 - - arg3 - - arg4 - - arg5 - - arg6 - TestFabricScopedEvent: - - fabricIndex - enums: - Identify: - # EffectIdentifierEnum, EffectVariantEnum, and IdentifyTypeEnum - # were originally named IdentifyEffectIdentifier, - # IdentifyEffectVariant, and IdentifyIdentifyType, but we generate - # the same API for the names with/without "Enum" at the end, and - # with/without the cluster name at the beginning, so the name can - # just change here. - - EffectIdentifierEnum - - EffectVariantEnum - - IdentifyTypeEnum - OnOff: - # DelayedOnOffEffectVariantEnum, DyingLightEffectVariantEnum, - # EffectIdentifierEnum, and StartUpOnOffEnum were originally named - # OnOffDelayedAllOffEffectVariant, - # OnOffDelayedAllOffEffectVariant, OnOffEffectIdentifier, and - # OnOffStartUpOnOff, but we generate the same API for the names - # with/without "Enum" at the end, and with/without the cluster - # name at the beginning, so the name can just change here. - - DelayedAllOffEffectVariantEnum - - DyingLightEffectVariantEnum - - EffectIdentifierEnum - - StartUpOnOffEnum - LevelControl: - # MoveModeEnum and StepModeEnum were originally named MoveMode and - # StepMode, but we generate the same API for the names - # with/without "Enum" at the end, and with/without the cluster - # name at the beginning, so the name can just change here. - - MoveModeEnum - - StepModeEnum - AccessControl: - - AuthMode - - ChangeTypeEnum - - Privilege - Actions: - - ActionErrorEnum - - ActionStateEnum - - ActionTypeEnum - - EndpointListTypeEnum - OtaSoftwareUpdateProvider: - - OTAApplyUpdateAction - - OTADownloadProtocol - - OTAQueryStatus - OtaSoftwareUpdateRequestor: - - OTAAnnouncementReason - - OTAChangeReasonEnum - - OTAUpdateStateEnum - TimeFormatLocalization: - # CalendarTypeEnum and HourFormatEnum were originally just named - # CalendarType and HourFormat, but we generate the same API for - # the names with/without "Enum" at the end, so the name can just - # change here. - - CalendarTypeEnum - - HourFormatEnum - UnitLocalization: - # TempUnitEnum was originally just named TempUnit, but - # we generate the same API for both of those names, so the name - # can just change here. - - TempUnitEnum - PowerSource: - # All the PowerSource enums originally did not have the "Enum" - # suffix, but we generate the same API whether that suffix is - # there or not, so the names can just change here. - - BatChargeFaultEnum - - BatChargeLevelEnum - - BatChargeStateEnum - - BatFaultEnum - - BatReplaceabilityEnum - - PowerSourceStatusEnum - - WiredCurrentTypeEnum - - WiredFaultEnum - GeneralCommissioning: - # CommissioningErrorEnum was originally just named - # CommissioningError, but we generate the same API - # for both of those names, so the name can just change - # here. - - CommissioningErrorEnum - # RegulatoryLocationTypeEnum was originally just named - # RegulatoryLocationType, but we generate the same API - # for both of those names, so the name can just change - # here. - - RegulatoryLocationTypeEnum - NetworkCommissioning: - # NetworkCommissioningStatusEnum and WiFiBandEnum were originally - # just named NetworkCommissioningStatus and WiFiBand, but we - # generate the same API for both of those names, so the name can - # just change here. - - NetworkCommissioningStatusEnum - - WiFiBandEnum - DiagnosticLogs: - - LogsIntent - - LogsStatus - - LogsTransferProtocol - GeneralDiagnostics: - - BootReasonType - - HardwareFaultType - # InterfaceTypeEnum was originally just named InterfaceType, but - # we generate the same API for both of those names, so the name - # can just change here. - - InterfaceTypeEnum - - NetworkFaultType - - RadioFaultType - ThreadNetworkDiagnostics: - # NetworkFaultEnum and RoutingRoleEnum were originally just named - # NetworkFault and RoutingRole, but we generate the same API for - # both of those names, so the name can just change here. - - NetworkFaultEnum - - RoutingRoleEnum - - ThreadConnectionStatus - WiFiNetworkDiagnostics: - # AssociationFailureCauseEnum was originally just named - # AssociationFailureCause, but we generate the same API for both - # of those names, so the name can just change here. - - AssociationFailureCauseEnum - # SecurityTypeEnum was originally just named SecurityType, but we - # generate the same API for both of those names, so the name can - # just change here. - - SecurityTypeEnum - - WiFiConnectionStatus - - WiFiVersionType - EthernetNetworkDiagnostics: - - PHYRateType - TimeSynchronization: - - GranularityEnum - - TimeSourceEnum - AdministratorCommissioning: - # CommissioningWindowStatusEnum was originally just named - # CommissioningWindowStatus, but we generate the same API for both - # of those names, so the name can just change here. - - CommissioningWindowStatusEnum - - StatusCode - OperationalCredentials: - - OperationalCertStatus - GroupKeyManagement: - # GroupKeySecurityPolicyEnum was originally just named - # GroupKeySecurityPolicy, but we generate the same API for both of - # those names, so the name can just change here. - - GroupKeySecurityPolicyEnum - DoorLock: - - DlAlarmCode - - DlCredentialRule - - DlCredentialType - - DlDataOperationType - - DlDoorState - - DlLockDataType - - DlLockOperationType - - DlLockState - - DlLockType - - DlOperatingMode - - DlOperationError - - DlOperationSource - - DlStatus - - DlUserStatus - - DlUserType - - DoorLockOperationEventCode - - DoorLockProgrammingEventCode - - DoorLockSetPinOrIdStatus - - DoorLockUserStatus - - DoorLockUserType - # UserTypeEnum and UserStatusEnum use the same generated name as - # DoorLockUserStatus and DoorLockUserType, so need to be - # considered as introduced at the same time. - - UserStatusEnum - - UserTypeEnum - WindowCovering: - - EndProductType - - Type - PumpConfigurationAndControl: - - PumpControlMode - - PumpOperationMode - Thermostat: - - SetpointAdjustMode - - ThermostatControlSequence - # ThermostatRunningModeEnum was originally named - # ThermostatRunningMode, but we generate the same API for the - # names with/without "Enum" at the end, so the name can just - # change here. - - ThermostatRunningModeEnum - # SystemModeEnum was originally named ThermostatSystemMode, but we - # generate the same API for the names with/without "Enum" at the - # end and the cluster name present/absent at the beginning, so the - # name can just change here. - - SystemModeEnum - FanControl: - - FanModeSequenceType - - FanModeType - ColorControl: - - ColorLoopAction - - ColorLoopDirection - - ColorMode - - HueDirection - - HueMoveMode - - HueStepMode - - SaturationMoveMode - - SaturationStepMode - IlluminanceMeasurement: - # LightSensorTypeEnum was originally named LightSensorType, but we - # generate the same API for the names with/without "Enum" at the - # end, so the name can just change here. - - LightSensorTypeEnum - Channel: - # StatusEnum was originally named ChannelStatusEnum, but we - # generate the same API for the names with/without the cluster - # name at the beginning, so the name can just change here. - - StatusEnum - - LineupInfoTypeEnum - TargetNavigator: - # StatusEnum was originally named TargetNavigatorStatusEnum, but - # we generate the same API for the names with/without the cluster - # name at the beginning, so the name can just change here. - - StatusEnum - MediaPlayback: - # StatusEnum was originally named MediaPlaybackStatusEnum, but we - # generate the same API for the names with/without the cluster - # name at the beginning, so the name can just change here. - - StatusEnum - - PlaybackStateEnum - MediaInput: - - InputTypeEnum - KeypadInput: - - CecKeyCode - # StatusEnum was originally named KeypadInputStatusEnum, but we - # generate the same API for the names with/without the cluster - # name at the beginning, so the name can just change here. - - StatusEnum - ContentLauncher: - - ContentLaunchStatusEnum - - MetricTypeEnum - - ParameterEnum - AudioOutput: - - OutputTypeEnum - ApplicationLauncher: - # StatusEnum was originally named ApplicationLauncherStatusEnum, but we - # generate the same API for the names with/without the cluster name at the - # beginning, so the name can just change here. - - StatusEnum - ApplicationBasic: - - ApplicationStatusEnum - TestCluster: - - SimpleEnum - FaultInjection: - - FaultType - enum values: - Identify: - # EffectIdentifierEnum, EffectVariantEnum, and IdentifyTypeEnum - # were originally named IdentifyEffectIdentifier, - # IdentifyEffectVariant, and IdentifyIdentifyType, but we generate - # the same API for the names with/without "Enum" at the end, and - # with/without the cluster name at the beginning, so the name can - # just change here. - EffectIdentifierEnum: - - Blink - - Breathe - - Okay - - ChannelChange - - FinishEffect - - StopEffect - EffectVariantEnum: - - Default - IdentifyTypeEnum: - - None - - VisibleLight - - VisibleLED - - AudibleBeep - - Display - - Actuator - OnOff: - # DelayedOnOffEffectVariantEnum, DyingLightEffectVariantEnum, - # EffectIdentifierEnum, and StartUpOnOffEnum were originally named - # OnOffDelayedAllOffEffectVariant, - # OnOffDelayedAllOffEffectVariant, OnOffEffectIdentifier, and - # OnOffStartUpOnOff, but we generate the same API for the names - # with/without "Enum" at the end, and with/without the cluster - # name at the beginning, so the name can just change here. - DelayedAllOffEffectVariantEnum: - - FadeToOffIn0p8Seconds - - NoFade - - 50PercentDimDownIn0p8SecondsThenFadeToOffIn12Seconds - DyingLightEffectVariantEnum: - - 20PercenterDimUpIn0p5SecondsThenFadeToOffIn1Second - EffectIdentifierEnum: - - DelayedAllOff - - DyingLight - StartUpOnOffEnum: - - Off - - On - - TogglePreviousOnOff - LevelControl: - # MoveModeEnum and StepModeEnum were originally named MoveMode and - # StepMode, but we generate the same API for the names - # with/without "Enum" at the end, and with/without the cluster - # name at the beginning, so the name can just change here. - MoveModeEnum: - - Up - - Down - StepModeEnum: - - Up - - Down - AccessControl: - AuthMode: - - PASE - - CASE - - Group - ChangeTypeEnum: - - Changed - - Added - - Removed - Privilege: - - View - - ProxyView - - Operate - - Manage - - Administer - Actions: - ActionErrorEnum: - - Unknown - - Interrupted - ActionStateEnum: - - Inactive - - Active - - Paused - - Disabled - ActionTypeEnum: - - Other - - Scene - - Sequence - - Automation - - Exception - - Notification - - Alarm - EndpointListTypeEnum: - - Other - - Room - - Zone - OtaSoftwareUpdateProvider: - OTAApplyUpdateAction: - - Proceed - - AwaitNextAction - - Discontinue - OTADownloadProtocol: - - BDXSynchronous - - BDXAsynchronous - - HTTPS - - VendorSpecific - OTAQueryStatus: - - UpdateAvailable - - Busy - - NotAvailable - - DownloadProtocolNotSupported - OtaSoftwareUpdateRequestor: - OTAAnnouncementReason: - - SimpleAnnouncement - - UpdateAvailable - - UrgentUpdateAvailable - OTAChangeReasonEnum: - - Unknown - - Success - - Failure - - TimeOut - - DelayByProvider - OTAUpdateStateEnum: - - Unknown - - Idle - - Querying - - DelayedOnQuery - - Downloading - - Applying - - DelayedOnApply - - RollingBack - - DelayedOnUserConsent - TimeFormatLocalization: - # CalendarTypeEnum and HourFormatEnum were originally just named - # CalendarType and HourFormat, but we generate the same API for - # the names with/without "Enum" at the end, so the name can just - # change here. - CalendarTypeEnum: - - Buddhist - - Chinese - - Coptic - - Ethiopian - - Gregorian - - Hebrew - - Indian - - Islamic - - Japanese - - Korean - - Persian - - Taiwanese - HourFormatEnum: - - 12hr - - 24hr - UnitLocalization: - # TempUnitEnum was originally just named TempUnit, but - # we generate the same API for both of those names, so the name - # can just change here. - TempUnitEnum: - - Fahrenheit - - Celsius - - Kelvin - PowerSource: - # All the PowerSource enums originally did not have the "Enum" - # suffix, but we generate the same API whether that suffix is - # there or not, so the names can just change here. - BatChargeFaultEnum: - - Unspecfied - - AmbientTooHot - - AmbientTooCold - - BatteryTooHot - - BatteryTooCold - - BatteryAbsent - - BatteryOverVoltage - - BatteryUnderVoltage - - ChargerOverVoltage - - ChargerUnderVoltage - - SafetyTimeout - BatChargeLevelEnum: - - Ok - - Warning - - Critical - BatChargeStateEnum: - - Unknown - - IsCharging - - IsAtFullCharge - - IsNotCharging - BatFaultEnum: - - Unspecfied - - OverTemp - - UnderTemp - BatReplaceabilityEnum: - - Unspecified - - NotReplaceable - - UserReplaceable - - FactoryReplaceable - PowerSourceStatusEnum: - - Unspecfied - - Active - - Standby - - Unavailable - WiredCurrentTypeEnum: - - AC - - DC - WiredFaultEnum: - - Unspecfied - - OverVoltage - - UnderVoltage - GeneralCommissioning: - # CommissioningErrorEnum was originally just named - # CommissioningError, but we generate the same API - # for both of those names, so the name can just change - # here. - CommissioningErrorEnum: - - Ok - - ValueOutsideRange - - InvalidAuthentication - - NoFailSafe - - BusyWithOtherAdmin - # RegulatoryLocationTypeEnum was originally just named - # RegulatoryLocationType, but we generate the same API - # for both of those names, so the name can just change - # here. - RegulatoryLocationTypeEnum: - - Indoor - - Outdoor - - IndoorOutdoor - NetworkCommissioning: - # NetworkCommissioningStatusEnum and WiFiBandEnum were originally - # just named NetworkCommissioningStatus and WiFiBand, but we - # generate the same API for both of those names, so the name can - # just change here. - NetworkCommissioningStatusEnum: - - Success - - OutOfRange - - BoundsExceeded - - NetworkIDNotFound - - DuplicateNetworkID - - NetworkNotFound - - RegulatoryError - - AuthFailure - - UnsupportedSecurity - - OtherConnectionFailure - - IPV6Failed - - IPBindFailed - - UnknownError - WiFiBandEnum: - - 2G4 - - 3G65 - - 5G - - 6G - - 60G - DiagnosticLogs: - LogsIntent: - - EndUserSupport - - NetworkDiag - - CrashLogs - LogsStatus: - - Success - - Exhausted - - NoLogs - - Busy - - Denied - LogsTransferProtocol: - - ResponsePayload - - BDX - GeneralDiagnostics: - BootReasonType: - - Unspecified - - PowerOnReboot - - BrownOutReset - - SoftwareWatchdogReset - - HardwareWatchdogReset - - SoftwareUpdateCompleted - - SoftwareReset - HardwareFaultType: - - Unspecified - - Radio - - Sensor - - ResettableOverTemp - - NonResettableOverTemp - - PowerSource - - VisualDisplayFault - - AudioOutputFault - - UserInterfaceFault - - NonVolatileMemoryError - - TamperDetected - # InterfaceTypeEnum was originally just named InterfaceType, but - # we generate the same API for both of those names, so the name - # can just change here. - InterfaceTypeEnum: - - Unspecified - - WiFi - - Ethernet - - Cellular - - Thread - NetworkFaultType: - - Unspecified - - HardwareFailure - - NetworkJammed - - ConnectionFailed - RadioFaultType: - - Unspecified - - WiFiFault - - CellularFault - - ThreadFault - - NFCFault - - BLEFault - - EthernetFault - ThreadNetworkDiagnostics: - # NetworkFaultEnum and RoutingRoleEnum were originally just named - # NetworkFault and RoutingRole, but we generate the same API for - # both of those names, so the name can just change here. - NetworkFaultEnum: - - Unspecified - - LinkDown - - HardwareFailure - - NetworkJammed - RoutingRoleEnum: - - Unspecified - - Unassigned - - SleepyEndDevice - - EndDevice - - REED - - Router - - Leader - ThreadConnectionStatus: - - Connected - - NotConnected - WiFiNetworkDiagnostics: - # AssociationFailureCauseEnum was originally just named - # AssociationFailureCause, but we generate the same API for both - # of those names, so the name can just change here. - AssociationFailureCauseEnum: - - Unknown - - AssociationFailed - - AuthenticationFailed - - SsidNotFound - # SecurityTypeEnum was originally just named SecurityType, but we - # generate the same API for both of those names, so the name can - # just change here. - SecurityTypeEnum: - - Unspecified - - None - - WEP - - WPA - - WPA2 - - WPA3 - WiFiConnectionStatus: - - Connected - - NotConnected - WiFiVersionType: - - 80211a - - 80211b - - 80211g - - 80211n - - 80211ac - - 80211ax - EthernetNetworkDiagnostics: - PHYRateType: - - 10M - - 100M - - 1000M - - 25G - - 5G - - 10G - - 40G - - 100G - - 200G - - 400G - TimeSynchronization: - GranularityEnum: - - NoTimeGranularity - - MinutesGranularity - - SecondsGranularity - - MillisecondsGranularity - - MicrosecondsGranularity - TimeSourceEnum: - - None - - Unknown - - Admin - - NodeTimeCluster - - NonFabricSntp - - NonFabricNtp - - FabricSntp - - FabricNtp - - MixedNtp - - NonFabricSntpNts - - NonFabricNtpNts - - FabricSntpNts - - FabricNtpNts - - MixedNtpNts - - CloudSource - - Ptp - - Gnss - AdministratorCommissioning: - # CommissioningWindowStatusEnum was originally just named - # CommissioningWindowStatus, but we generate the same API for both - # of those names, so the name can just change here. - CommissioningWindowStatusEnum: - - WindowNotOpen - - EnhancedWindowOpen - - BasicWindowOpen - StatusCode: - - Busy - - PAKEParameterError - - WindowNotOpen - OperationalCredentials: - OperationalCertStatus: - - SUCCESS - - InvalidPublicKey - - InvalidNodeOpId - - InvalidNOC - - MissingCsr - - TableFull - - InvalidAdminSubject - - FabricConflict - - LabelConflict - - InvalidFabricIndex - GroupKeyManagement: - # GroupKeySecurityPolicyEnum was originally just named - # GroupKeySecurityPolicy, but we generate the same API for both of - # those names, so the name can just change here. - GroupKeySecurityPolicyEnum: - - TrustFirst - - CacheAndSync - DoorLock: - DlAlarmCode: - - LockJammed - - LockFactoryReset - - LockRadioPowerCycled - - WrongCodeEntryLimit - - FrontEsceutcheonRemoved - - DoorForcedOpen - - DoorAjar - - ForcedUser - DlCredentialRule: - - Single - - Double - - Tri - DlCredentialType: - - ProgrammingPIN - - PIN - - RFID - - Fingerprint - - FingerVein - - Face - DlDataOperationType: - - Add - - Clear - - Modify - DlDoorState: - - DoorOpen - - DoorClosed - - DoorJammed - - DoorForcedOpen - - DoorUnspecifiedError - - DoorAjar - DlLockDataType: - - Unspecified - - ProgrammingCode - - UserIndex - - WeekDaySchedule - - YearDaySchedule - - HolidaySchedule - - PIN - - RFID - - Fingerprint - DlLockOperationType: - - Lock - - Unlock - - NonAccessUserEvent - - ForcedUserEvent - DlLockState: - - NotFullyLocked - - Locked - - Unlocked - DlLockType: - - DeadBolt - - Magnetic - - Other - - Mortise - - Rim - - LatchBolt - - CylindricalLock - - TubularLock - - InterconnectedLock - - DeadLatch - - DoorFurniture - DlOperatingMode: - - Normal - - Vacation - - Privacy - - NoRemoteLockUnlock - - Passage - DlOperationError: - - Unspecified - - InvalidCredential - - DisabledUserDenied - - Restricted - - InsufficientBattery - DlOperationSource: - - Unspecified - - Manual - - ProprietaryRemote - - Keypad - - Auto - - Button - - Schedule - - Remote - - RFID - - Biometric - DlStatus: - - Success - - Failure - - Duplicate - - Occupied - - InvalidField - - ResourceExhausted - - NotFound - DlUserStatus: - - Available - - OccupiedEnabled - - OccupiedDisabled - DlUserType: - - UnrestrictedUser - - YearDayScheduleUser - - WeekDayScheduleUser - - ProgrammingUser - - NonAccessUser - - ForcedUser - - DisposableUser - - ExpiringUser - - ScheduleRestrictedUser - - RemoteOnlyUser - DoorLockOperationEventCode: - - UnknownOrMfgSpecific - - Lock - - Unlock - - LockInvalidPinOrId - - LockInvalidSchedule - - UnlockInvalidPinOrId - - UnlockInvalidSchedule - - OneTouchLock - - KeyLock - - KeyUnlock - - AutoLock - - ScheduleLock - - ScheduleUnlock - - ManualLock - - ManualUnlock - DoorLockProgrammingEventCode: - - UnknownOrMfgSpecific - - MasterCodeChanged - - PinAdded - - PinDeleted - - PinChanged - - IdAdded - - IdDeleted - DoorLockSetPinOrIdStatus: - - Success - - GeneralFailure - - MemoryFull - - DuplicateCodeError - DoorLockUserStatus: - - Available - - OccupiedEnabled - - OccupiedDisabled - - NotSupported - DoorLockUserType: - - Unrestricted - - YearDayScheduleUser - - WeekDayScheduleUser - - MasterUser - - NonAccessUser - - NotSupported - # UserTypeEnum and UserStatusEnum use the same generated name as - # DoorLockUserStatus and DoorLockUserType, so need to be - # considered as introduced at the same time, with the enum value - # names that match DoorLockUserStatus and DoorLockUserType. - UserStatusEnum: - - Available - - OccupiedEnabled - - OccupiedDisabled - - NotSupported - UserTypeEnum: - - Unrestricted - - YearDayScheduleUser - - WeekDayScheduleUser - - MasterUser - - NonAccessUser - - NotSupported - WindowCovering: - EndProductType: - - RollerShade - - RomanShade - - BalloonShade - - WovenWood - - PleatedShade - - CellularShade - - LayeredShade - - LayeredShade2D - - SheerShade - - TiltOnlyInteriorBlind - - InteriorBlind - - VerticalBlindStripCurtain - - InteriorVenetianBlind - - ExteriorVenetianBlind - - LateralLeftCurtain - - LateralRightCurtain - - CentralCurtain - - RollerShutter - - ExteriorVerticalScreen - - AwningTerracePatio - - AwningVerticalScreen - - TiltOnlyPergola - - SwingingShutter - - SlidingShutter - - Unknown - Type: - - RollerShade - - RollerShade2Motor - - RollerShadeExterior - - RollerShadeExterior2Motor - - Drapery - - Awning - - Shutter - - TiltBlindTiltOnly - - TiltBlindLiftAndTilt - - ProjectorScreen - - Unknown - PumpConfigurationAndControl: - PumpControlMode: - - ConstantSpeed - - ConstantPressure - - ProportionalPressure - - ConstantFlow - - ConstantTemperature - - Automatic - PumpOperationMode: - - Normal - - Minimum - - Maximum - - Local - Thermostat: - SetpointAdjustMode: - - HeatSetpoint - - CoolSetpoint - - HeatAndCoolSetpoints - ThermostatControlSequence: - - CoolingOnly - - CoolingWithReheat - - HeatingOnly - - HeatingWithReheat - - CoolingAndHeating - - CoolingAndHeatingWithReheat - # ThermostatRunningModeEnum was originally named - # ThermostatRunningMode, but we generate the same API for the - # names with/without "Enum" at the end, so the name can just - # change here. - ThermostatRunningModeEnum: - - Off - - Cool - - Heat - # SystemModeEnum was originally named ThermostatSystemMode, but we - # generate the same API for the names with/without "Enum" at the - # end and the cluster name present/absent at the beginning, so the - # name can just change here. - SystemModeEnum: - - Off - - Auto - - Cool - - Heat - - EmergencyHeating - - Precooling - - FanOnly - FanControl: - FanModeSequenceType: - - OffLowMedHigh - - OffLowHigh - - OffLowMedHighAuto - - OffLowHighAuto - - OffOnAuto - - OffOn - FanModeType: - - Off - - Low - - Medium - - High - - On - - Auto - - Smart - ColorControl: - ColorLoopAction: - - Deactivate - - ActivateFromColorLoopStartEnhancedHue - - ActivateFromEnhancedCurrentHue - ColorLoopDirection: - - DecrementHue - - IncrementHue - ColorMode: - - CurrentHueAndCurrentSaturation - - CurrentXAndCurrentY - - ColorTemperature - HueDirection: - - ShortestDistance - - LongestDistance - - Up - - Down - HueMoveMode: - - Stop - - Up - - Down - HueStepMode: - - Up - - Down - SaturationMoveMode: - - Stop - - Up - - Down - SaturationStepMode: - - Up - - Down - IlluminanceMeasurement: - LightSensorTypeEnum: - - Photodiode - - CMOS - Channel: - # StatusEnum was originally named ChannelStatusEnum, but we - # generate the same API for the names with/without the cluster - # name at the beginning, so the name can just change here. - StatusEnum: - - Success - - MultipleMatches - - NoMatches - LineupInfoTypeEnum: - - Mso - TargetNavigator: - # StatusEnum was originally named TargetNavigatorStatusEnum, but - # we generate the same API for the names with/without the cluster - # name at the beginning, so the name can just change here. - StatusEnum: - - Success - - TargetNotFound - - NotAllowed - MediaPlayback: - # StatusEnum was originally named MediaPlaybackStatusEnum, but we - # generate the same API for the names with/without the cluster - # name at the beginning, so the name can just change here. - StatusEnum: - - Success - - InvalidStateForCommand - - NotAllowed - - NotActive - - SpeedOutOfRange - - SeekOutOfRange - PlaybackStateEnum: - - Playing - - Paused - - NotPlaying - - Buffering - MediaInput: - InputTypeEnum: - - Internal - - Aux - - Coax - - Composite - - Hdmi - - Input - - Line - - Optical - - Video - - Scart - - Usb - - Other - KeypadInput: - CecKeyCode: - - Select - - Up - - Down - - Left - - Right - - RightUp - - RightDown - - LeftUp - - LeftDown - - RootMenu - - SetupMenu - - ContentsMenu - - FavoriteMenu - - Exit - - MediaTopMenu - - MediaContextSensitiveMenu - - NumberEntryMode - - Number11 - - Number12 - - Number0OrNumber10 - - Numbers1 - - Numbers2 - - Numbers3 - - Numbers4 - - Numbers5 - - Numbers6 - - Numbers7 - - Numbers8 - - Numbers9 - - Dot - - Enter - - Clear - - NextFavorite - - ChannelUp - - ChannelDown - - PreviousChannel - - SoundSelect - - InputSelect - - DisplayInformation - - Help - - PageUp - - PageDown - - Power - - VolumeUp - - VolumeDown - - Mute - - Play - - Stop - - Pause - - Record - - Rewind - - FastForward - - Eject - - Forward - - Backward - - StopRecord - - PauseRecord - - Reserved - - Angle - - SubPicture - - VideoOnDemand - - ElectronicProgramGuide - - TimerProgramming - - InitialConfiguration - - SelectBroadcastType - - SelectSoundPresentation - - PlayFunction - - PausePlayFunction - - RecordFunction - - PauseRecordFunction - - StopFunction - - MuteFunction - - RestoreVolumeFunction - - TuneFunction - - SelectMediaFunction - - SelectAvInputFunction - - SelectAudioInputFunction - - PowerToggleFunction - - PowerOffFunction - - PowerOnFunction - - F1Blue - - F2Red - - F3Green - - F4Yellow - - F5 - - Data - # StatusEnum was originally named KeypadInputStatusEnum, but we - # generate the same API for the names with/without the cluster - # name at the beginning, so the name can just change here. - StatusEnum: - - Success - - UnsupportedKey - - InvalidKeyInCurrentState - ContentLauncher: - ContentLaunchStatusEnum: - - Success - - UrlNotAvailable - - AuthFailed - MetricTypeEnum: - - PIXELS - - PERCENTAGE - ParameterEnum: - - Actor - - Channel - - Character - - Director - - Event - - Franchise - - Genre - - League - - Popularity - - Provider - - Sport - - SportsTeam - - Type - AudioOutput: - OutputTypeEnum: - - Hdmi - - Bt - - Optical - - Headphone - - Internal - - Other - ApplicationLauncher: - # StatusEnum was originally named ApplicationLauncherStatusEnum, but we - # generate the same API for the names with/without the cluster name at the - # beginning, so the name can just change here. - StatusEnum: - - Success - - AppNotAvailable - - SystemBusy - ApplicationBasic: - ApplicationStatusEnum: - - Stopped - - ActiveVisibleFocus - - ActiveHidden - - ActiveVisibleNotFocus - TestCluster: - SimpleEnum: - - Unspecified - - ValueA - - ValueB - - ValueC - bitmaps: - Groups: - - GroupClusterFeature - Scenes: - - ScenesCopyMode - OnOff: - - OnOffControl - # Feature was originally named OnOffFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - - Feature - LevelControl: - # Feature was originally named LevelControlFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - - Feature - Actions: - - CommandBits - UnitLocalization: - # Feature was originally named UnitLocalizationFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - - Feature - PowerSource: - # Feature was originally named PowerSourceFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - - Feature - NetworkCommissioning: - # Feature was originally named NetworkCommissioningFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - - Feature - - WiFiSecurity - SoftwareDiagnostics: - # Feature was originally named SoftwareDiagnosticsFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - - Feature - ThreadNetworkDiagnostics: - # Feature was originally named ThreadNetworkDiagnosticsFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - - Feature - ModeSelect: - # Feature was originally named ModeSelectFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - - Feature - DoorLock: - - DlCredentialRuleMask - - DlCredentialRulesSupport - - DlDaysMaskMap - - DlDefaultConfigurationRegister - - DlKeypadOperationEventMask - - DlKeypadProgrammingEventMask - - DlLocalProgrammingFeatures - - DlManualOperationEventMask - - DlRFIDOperationEventMask - - DlRFIDProgrammingEventMask - - DlRemoteOperationEventMask - - DlRemoteProgrammingEventMask - - DlSupportedOperatingModes - - DoorLockDayOfWeek - # Feature was originally named DoorLockFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - - Feature - WindowCovering: - - ConfigStatus - - Feature - - Mode - - OperationalStatus - - SafetyStatus - PumpConfigurationAndControl: - - PumpStatus - Thermostat: - - DayOfWeek - - ModeForSequence - # Feature was originally named ThermostatFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - - Feature - FanControl: - # Feature was originally named FanControlFeature, but - # we generate the same API for both of those names, so the name - # can just change here. - - Feature - - RockSupportMask - - WindSettingMask - - WindSupportMask - ColorControl: - - ColorCapabilities - # Feature was originally named ColorControlFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - - Feature - - ColorLoopUpdateFlags - PressureMeasurement: - - PressureFeature - Channel: - # Feature was originally named ChannelFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - - Feature - MediaInput: - # Feature was originally named MediaInputFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - - Feature - KeypadInput: - # Feature was originally named KeypadInputFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - - Feature - ContentLauncher: - # Feature was originally named ContentLauncherFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - - Feature - - SupportedStreamingProtocol - AudioOutput: - # Feature was originally named AudioOutputFeature, but - # we generate the same API for both of those names, so the name - # can just change here. - - Feature - ApplicationLauncher: - # Feature was originally named ApplicationLauncherFeature, but - # we generate the same API for both of those names, so the name - # can just change here. - - Feature - TestCluster: - - Bitmap16MaskMap - - Bitmap32MaskMap - - Bitmap64MaskMap - - Bitmap8MaskMap - - SimpleBitmap - bitmap values: - Groups: - GroupClusterFeature: - - GroupNames - Scenes: - ScenesCopyMode: - - CopyAllScenes - OnOff: - OnOffControl: - - AcceptOnlyWhenOn - # Feature was originally named OnOffFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - Lighting - LevelControl: - # Feature was originally named LevelControlFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - OnOff - - Lighting - - Frequency - Actions: - CommandBits: - - InstantAction - - InstantActionWithTransition - - StartAction - - StartActionWithDuration - - StopAction - - PauseAction - - PauseActionWithDuration - - ResumeAction - - EnableAction - - EnableActionWithDuration - - DisableAction - - DisableActionWithDuration - UnitLocalization: - # Feature was originally named UnitLocalizationFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - TemperatureUnit - PowerSource: - # Feature was originally named PowerSourceFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - Wired - - Battery - - Rechargeable - - Replaceable - NetworkCommissioning: - # Feature was originally named NetworkCommissioningFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - WiFiNetworkInterface - - ThreadNetworkInterface - - EthernetNetworkInterface - WiFiSecurity: - - Unencrypted - - WepPersonal - - WpaPersonal - - Wpa2Personal - - Wpa3Personal - SoftwareDiagnostics: - # Feature was originally named SoftwareDiagnosticsFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - WaterMarks - ThreadNetworkDiagnostics: - # Feature was originally named ThreadNetworkDiagnosticsFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - PacketCounts - - ErrorCounts - - MLECounts - - MACCounts - ModeSelect: - # Feature was originally named ModeSelectFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - DEPONOFF - DoorLock: - DlCredentialRuleMask: - - Single - - Dual - - Tri - DlCredentialRulesSupport: - - Single - - Dual - - Tri - DlDaysMaskMap: - - Sunday - - Monday - - Tuesday - - Wednesday - - Thursday - - Friday - - Saturday - DlDefaultConfigurationRegister: - - EnableLocalProgrammingEnabled - - KeypadInterfaceDefaultAccessEnabled - - RemoteInterfaceDefaultAccessIsEnabled - - SoundEnabled - - AutoRelockTimeSet - - LEDSettingsSet - DlKeypadOperationEventMask: - - Unknown - - Lock - - Unlock - - LockInvalidPIN - - LockInvalidSchedule - - UnlockInvalidCode - - UnlockInvalidSchedule - - NonAccessUserOpEvent - DlKeypadProgrammingEventMask: - - Unknown - - ProgrammingPINChanged - - PINAdded - - PINCleared - - PINChanged - DlLocalProgrammingFeatures: - - AddUsersCredentialsSchedulesLocally - - ModifyUsersCredentialsSchedulesLocally - - ClearUsersCredentialsSchedulesLocally - - AdjustLockSettingsLocally - DlManualOperationEventMask: - - Unknown - - ThumbturnLock - - ThumbturnUnlock - - OneTouchLock - - KeyLock - - KeyUnlock - - AutoLock - - ScheduleLock - - ScheduleUnlock - - ManualLock - - ManualUnlock - DlRFIDOperationEventMask: - - Unknown - - Lock - - Unlock - - LockInvalidRFID - - LockInvalidSchedule - - UnlockInvalidRFID - - UnlockInvalidSchedule - DlRFIDProgrammingEventMask: - - Unknown - - RFIDCodeAdded - - RFIDCodeCleared - DlRemoteOperationEventMask: - - Unknown - - Lock - - Unlock - - LockInvalidCode - - LockInvalidSchedule - - UnlockInvalidCode - - UnlockInvalidSchedule - DlRemoteProgrammingEventMask: - - Unknown - - ProgrammingPINChanged - - PINAdded - - PINCleared - - PINChanged - - RFIDCodeAdded - - RFIDCodeCleared - DlSupportedOperatingModes: - - Normal - - Vacation - - Privacy - - NoRemoteLockUnlock - - Passage - DoorLockDayOfWeek: - - Sunday - - Monday - - Tuesday - - Wednesday - - Thursday - - Friday - - Saturday - # Feature was originally named DoorLockFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - PINCredentials - - RFIDCredentials - - FingerCredentials - - Logging - - WeekDaySchedules - - DoorPositionSensor - - FaceCredentials - - CredentialsOTA - - UsersManagement - - Notifications - - YearDaySchedules - - HolidaySchedules - WindowCovering: - ConfigStatus: - - Operational - - OnlineReserved - - LiftMovementReversed - - LiftPositionAware - - TiltPositionAware - - LiftEncoderControlled - - TiltEncoderControlled - Feature: - - Lift - - Tilt - - PositionAwareLift - - AbsolutePosition - - PositionAwareTilt - Mode: - - MotorDirectionReversed - - CalibrationMode - - MaintenanceMode - - LedFeedback - OperationalStatus: - - Global - - Lift - - Tilt - SafetyStatus: - - RemoteLockout - - TamperDetection - - FailedCommunication - - PositionFailure - - ThermalProtection - - ObstacleDetected - - Power - - StopInput - - MotorJammed - - HardwareFailure - - ManualOperation - - Protection - PumpConfigurationAndControl: - PumpStatus: - - DeviceFault - - Supplyfault - - SpeedLow - - SpeedHigh - - LocalOverride - - Running - - RemotePressure - - RemoteFlow - - RemoteTemperature - Thermostat: - DayOfWeek: - - Sunday - - Monday - - Tuesday - - Wednesday - - Thursday - - Friday - - Saturday - - AwayOrVacation - ModeForSequence: - - HeatSetpointFieldPresent - - CoolSetpointFieldPresent - # Feature was originally named ThermostatFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - Heating - - Cooling - - Occupancy - - Schedule - - Setback - - Automode - FanControl: - # Feature was originally named FanControlFeature, but - # we generate the same API for both of those names, so the name - # can just change here. - Feature: - - MultiSpeed - - Auto - - Rocking - - Wind - RockSupportMask: - - RockLeftRight - - RockUpDown - - RockRound - WindSettingMask: - - SleepWind - - NaturalWind - WindSupportMask: - - SleepWind - - NaturalWind - ColorControl: - ColorCapabilities: - - HueSaturationSupported - - EnhancedHueSupported - - ColorLoopSupported - - XYAttributesSupported - - ColorTemperatureSupported - # Feature was originally named ColorControlFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - HueAndSaturation - - EnhancedHue - - ColorLoop - - XY - - ColorTemperature - ColorLoopUpdateFlags: - - UpdateAction - - UpdateDirection - - UpdateTime - - UpdateStartHue - PressureMeasurement: - PressureFeature: - - EXT - Channel: - # Feature was originally named ChannelFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - ChannelList - - LineupInfo - MediaInput: - # Feature was originally named MediaInputFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - NameUpdates - KeypadInput: - # Feature was originally named KeypadInputFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - NavigationKeyCodes - - LocationKeys - - NumberKeys - ContentLauncher: - # Feature was originally named ContentLauncherFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - ContentSearch - - URLPlayback - SupportedStreamingProtocol: - - DASH - - HLS - AudioOutput: - # Feature was originally named AudioOutputFeature, but - # we generate the same API for both of those names, so the name - # can just change here. - Feature: - - NameUpdates - ApplicationLauncher: - # Feature was originally named ApplicationLauncherFeature, but - # we generate the same API for both of those names, so the name - # can just change here. - Feature: - - ApplicationPlatform - TestCluster: - Bitmap16MaskMap: - - MaskVal1 - - MaskVal2 - - MaskVal3 - - MaskVal4 - Bitmap32MaskMap: - - MaskVal1 - - MaskVal2 - - MaskVal3 - - MaskVal4 - Bitmap64MaskMap: - - MaskVal1 - - MaskVal2 - - MaskVal3 - - MaskVal4 - Bitmap8MaskMap: - - MaskVal1 - - MaskVal2 - - MaskVal3 - - MaskVal4 - SimpleBitmap: - - ValueA - - ValueB - - ValueC - ids: - clusters: - - PulseWidthModulation - - TimeSynchronization - attributes: - PulseWidthModulation: - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - TimeSynchronization: - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - - UTCTime - - Granularity - - TimeSource - - TrustedTimeNodeId - - DefaultNtp - - TimeZone - - DstOffset - - LocalTime - - TimeZoneDatabase - - NtpServerPort - commands: - TimeSynchronization: - - SetUtcTime - command payloads: - TimeSynchronization: - - SetUtcTime - global attributes: - - FeatureMap - - ClusterRevision - - AttributeList - - GeneratedCommandList - - AcceptedCommandList - apis: - - Timed Invoke for server to client commands - - Deprecated global attribute names - provisional: - clusters: - - PulseWidthModulation - - TimeSynchronization - -- release: "First dot-release" - versions: - iOS: "16.2" - macOS: "13.1" - watchOS: "9.2" - tvOS: "16.2" - introduced: - attributes: - TestCluster: - - WriteOnlyInt8u - structs: - Descriptor: - - DeviceTypeStruct - struct fields: - Descriptor: - DeviceTypeStruct: - - type - - revision - bitmaps: - Switch: - # Feature was originally named SwitchFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - - Feature - MediaPlayback: - # Feature was originally named MediaPlaybackFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - - Feature - bitmap values: - Switch: - # Feature was originally named SwitchFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - LatchingSwitch - - MomentarySwitch - - MomentarySwitchRelease - - MomentarySwitchLongPress - - MomentarySwitchMultiPress - MediaPlayback: - # Feature was originally named MediaPlaybackFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - AdvancedSeek - - VariableSpeed - ids: - attributes: - Descriptor: - - DeviceTypeList - renames: - structs: - Descriptor: - DeviceTypeStruct: DeviceType - -- release: "First major API revamp" - versions: - iOS: "16.4" - macOS: "13.3" - watchOS: "9.4" - tvOS: "16.4" - introduced: - clusters: - - OTASoftwareUpdateProvider - - OTASoftwareUpdateRequestor - - UnitTesting - - WakeOnLAN - - BasicInformation - - BridgedDeviceBasicInformation - attributes: - Descriptor: - # We really only started treating DeviceTypeList as DeviceTypeList in the API revamp, - # except in the list of attribute ids. - - DeviceTypeList - AccessControl: - - ACL - BallastConfiguration: - - IntrinsicBallastFactor - OccupancySensing: - - PIROccupiedToUnoccupiedDelay - - PIRUnoccupiedToOccupiedDelay - - PIRUnoccupiedToOccupiedThreshold - UnitTesting: - - Boolean - - Bitmap8 - - Bitmap16 - - Bitmap32 - - Bitmap64 - - Int8u - - Int16u - - Int24u - - Int32u - - Int40u - - Int48u - - Int56u - - Int64u - - Int8s - - Int16s - - Int24s - - Int32s - - Int40s - - Int48s - - Int56s - - Int64s - - Enum8 - - Enum16 - - FloatSingle - - FloatDouble - - OctetString - - ListInt8u - - ListOctetString - - ListStructOctetString - - LongOctetString - - CharString - - LongCharString - - EpochUs - - EpochS - - VendorId - - ListNullablesAndOptionalsStruct - - EnumAttr - - StructAttr - - RangeRestrictedInt8u - - RangeRestrictedInt8s - - RangeRestrictedInt16u - - RangeRestrictedInt16s - - ListLongOctetString - - ListFabricScoped - - TimedWriteBoolean - - GeneralErrorBoolean - - ClusterErrorBoolean - - Unsupported - - NullableBoolean - - NullableBitmap8 - - NullableBitmap16 - - NullableBitmap32 - - NullableBitmap64 - - NullableInt8u - - NullableInt16u - - NullableInt24u - - NullableInt32u - - NullableInt40u - - NullableInt48u - - NullableInt56u - - NullableInt64u - - NullableInt8s - - NullableInt16s - - NullableInt24s - - NullableInt32s - - NullableInt40s - - NullableInt48s - - NullableInt56s - - NullableInt64s - - NullableEnum8 - - NullableEnum16 - - NullableFloatSingle - - NullableFloatDouble - - NullableOctetString - - NullableCharString - - NullableEnumAttr - - NullableStruct - - NullableRangeRestrictedInt8u - - NullableRangeRestrictedInt8s - - NullableRangeRestrictedInt16u - - NullableRangeRestrictedInt16s - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - - WriteOnlyInt8u - OTASoftwareUpdateProvider: - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - OTASoftwareUpdateRequestor: - - DefaultOTAProviders - - UpdatePossible - - UpdateState - - UpdateStateProgress - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - WakeOnLAN: - - MACAddress - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - BasicInformation: - - DataModelRevision - - VendorName - - VendorID - - ProductName - - ProductID - - NodeLabel - - Location - - HardwareVersion - - HardwareVersionString - - SoftwareVersion - - SoftwareVersionString - - ManufacturingDate - - PartNumber - - ProductURL - - ProductLabel - - SerialNumber - - LocalConfigDisabled - - Reachable - - UniqueID - - CapabilityMinima - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - ThreadNetworkDiagnostics: - - NeighborTable - - RouteTable - WiFiNetworkDiagnostics: - - BSSID - - RSSI - GeneralDiagnostics: - - BootReason - BridgedDeviceBasicInformation: - - VendorName - - VendorID - - ProductName - - NodeLabel - - HardwareVersion - - HardwareVersionString - - SoftwareVersion - - SoftwareVersionString - - ManufacturingDate - - PartNumber - - ProductURL - - ProductLabel - - SerialNumber - - Reachable - - UniqueID - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - commands: - OTASoftwareUpdateProvider: - - QueryImage - - QueryImageResponse - - ApplyUpdateRequest - - ApplyUpdateResponse - - NotifyUpdateApplied - OTASoftwareUpdateRequestor: - - AnnounceOTAProvider - UnitTesting: - - Test - - TestSpecificResponse - - TestNotHandled - - TestAddArgumentsResponse - - TestSpecific - - TestSimpleArgumentResponse - - TestUnknownCommand - - TestStructArrayArgumentResponse - - TestAddArguments - - TestListInt8UReverseResponse - - TestSimpleArgumentRequest - - TestEnumsResponse - - TestStructArrayArgumentRequest - - TestNullableOptionalResponse - - TestStructArgumentRequest - - TestComplexNullableOptionalResponse - - TestNestedStructArgumentRequest - - BooleanResponse - - TestListStructArgumentRequest - - SimpleStructResponse - - TestListInt8UArgumentRequest - - TestEmitTestEventResponse - - TestNestedStructListArgumentRequest - - TestEmitTestFabricScopedEventResponse - - TestListNestedStructListArgumentRequest - - TestListInt8UReverseRequest - - TestEnumsRequest - - TestNullableOptionalRequest - - TestComplexNullableOptionalRequest - - SimpleStructEchoRequest - - TimedInvokeRequest - - TestSimpleOptionalArgumentRequest - - TestEmitTestEventRequest - - TestEmitTestFabricScopedEventRequest - ContentLauncher: - - LauncherResponse - MediaPlayback: - - Stop - command fields: - UnitTesting: - TestSpecificResponse: - - returnValue - TestAddArgumentsResponse: - - returnValue - TestSimpleArgumentResponse: - - returnValue - TestStructArrayArgumentResponse: - - arg1 - - arg2 - - arg3 - - arg4 - - arg5 - - arg6 - TestAddArguments: - - arg1 - - arg2 - TestListInt8UReverseResponse: - - arg1 - TestSimpleArgumentRequest: - - arg1 - TestEnumsResponse: - - arg1 - - arg2 - TestStructArrayArgumentRequest: - - arg1 - - arg2 - - arg3 - - arg4 - - arg5 - - arg6 - TestNullableOptionalResponse: - - wasPresent - - wasNull - - value - - originalValue - TestStructArgumentRequest: - - arg1 - TestComplexNullableOptionalResponse: - - nullableIntWasNull - - nullableIntValue - - optionalIntWasPresent - - optionalIntValue - - nullableOptionalIntWasPresent - - nullableOptionalIntWasNull - - nullableOptionalIntValue - - nullableStringWasNull - - nullableStringValue - - optionalStringWasPresent - - optionalStringValue - - nullableOptionalStringWasPresent - - nullableOptionalStringWasNull - - nullableOptionalStringValue - - nullableStructWasNull - - nullableStructValue - - optionalStructWasPresent - - optionalStructValue - - nullableOptionalStructWasPresent - - nullableOptionalStructWasNull - - nullableOptionalStructValue - - nullableListWasNull - - nullableListValue - - optionalListWasPresent - - optionalListValue - - nullableOptionalListWasPresent - - nullableOptionalListWasNull - - nullableOptionalListValue - TestNestedStructArgumentRequest: - - arg1 - BooleanResponse: - - value - TestListStructArgumentRequest: - - arg1 - SimpleStructResponse: - - arg1 - TestListInt8UArgumentRequest: - - arg1 - TestEmitTestEventResponse: - - value - TestNestedStructListArgumentRequest: - - arg1 - TestEmitTestFabricScopedEventResponse: - - value - TestListNestedStructListArgumentRequest: - - arg1 - TestListInt8UReverseRequest: - - arg1 - TestEnumsRequest: - - arg1 - - arg2 - TestNullableOptionalRequest: - - arg1 - TestComplexNullableOptionalRequest: - - nullableInt - - optionalInt - - nullableOptionalInt - - nullableString - - optionalString - - nullableOptionalString - - nullableStruct - - optionalStruct - - nullableOptionalStruct - - nullableList - - optionalList - - nullableOptionalList - SimpleStructEchoRequest: - - arg1 - TestSimpleOptionalArgumentRequest: - - arg1 - TestEmitTestEventRequest: - - arg1 - - arg2 - - arg3 - TestEmitTestFabricScopedEventRequest: - - arg1 - OTASoftwareUpdateProvider: - QueryImage: - - vendorID - - productID - - softwareVersion - - protocolsSupported - - hardwareVersion - - location - - requestorCanConsent - - metadataForProvider - # Next two were introduced and deprecated at the same time, effectively - - vendorId - - productId - QueryImageResponse: - - status - - delayedActionTime - - imageURI - - softwareVersion - - softwareVersionString - - updateToken - - userConsentNeeded - - metadataForRequestor - ApplyUpdateRequest: - - updateToken - - newVersion - ApplyUpdateResponse: - - action - - delayedActionTime - NotifyUpdateApplied: - - updateToken - - softwareVersion - OTASoftwareUpdateRequestor: - AnnounceOTAProvider: - - providerNodeID - - vendorID - - announcementReason - - metadataForNode - - endpoint - # Next two were introduced and deprecated at the same time, effectively - - providerNodeId - - vendorId - Groups: - AddGroup: - - groupID - AddGroupIfIdentifying: - - groupID - AddGroupResponse: - - groupID - RemoveGroup: - - groupID - RemoveGroupResponse: - - groupID - ViewGroup: - - groupID - ViewGroupResponse: - - groupID - OnOff: - OffWithEffect: - - effectIdentifier - DiagnosticLogs: - RetrieveLogsResponse: - - logContent - - utcTimeStamp - AdministratorCommissioning: - OpenCommissioningWindow: - - pakePasscodeVerifier - OperationalCredentials: - AttestationResponse: - - attestationSignature - AddTrustedRootCertificate: - - rootCACertificate - DoorLock: - SetUser: - - userUniqueID - GetUserResponse: - - userUniqueID - ColorControl: - MoveToColorTemperature: - - colorTemperatureMireds - ContentLauncher: - LauncherResponse: - - status - - data - Scenes: - AddScene: - - groupID - - sceneID - ViewScene: - - groupID - - sceneID - RemoveScene: - - groupID - - sceneID - RemoveAllScenes: - - groupID - StoreScene: - - groupID - - sceneID - RecallScene: - - groupID - - sceneID - GetSceneMembership: - - groupID - EnhancedAddScene: - - groupID - - sceneID - EnhancedViewScene: - - groupID - - sceneID - CopyScene: - - groupIdentifierFrom - - sceneIdentifierFrom - - groupIdentifierTo - - sceneIdentifierTo - AddSceneResponse: - - groupID - - sceneID - ViewSceneResponse: - - groupID - - sceneID - RemoveSceneResponse: - - groupID - - sceneID - RemoveAllScenesResponse: - - groupID - StoreSceneResponse: - - groupID - - sceneID - GetSceneMembershipResponse: - - groupID - EnhancedAddSceneResponse: - - groupID - - sceneID - EnhancedViewSceneResponse: - - groupID - - sceneID - CopySceneResponse: - - groupIdentifierFrom - - sceneIdentifierFrom - structs: - OTASoftwareUpdateRequestor: - - ProviderLocation - UnitTesting: - - SimpleStruct - - TestFabricScoped - - NullablesAndOptionalsStruct - - NestedStruct - - NestedStructList - - DoubleNestedStructList - - TestListStructOctet - BasicInformation: - - CapabilityMinimaStruct - AccessControl: - - AccessControlEntryStruct - - AccessControlExtensionStruct - SoftwareDiagnostics: - - ThreadMetricsStruct - GeneralDiagnostics: - - NetworkInterface - ModeSelect: - - SemanticTagStruct - OperationalCredentials: - - FabricDescriptorStruct - DoorLock: - - CredentialStruct - MediaPlayback: - - PlaybackPositionStruct - TargetNavigator: - - TargetInfoStruct - MediaInput: - - InputInfoStruct - AudioOutput: - - OutputInfoStruct - Channel: - - ChannelInfoStruct - - LineupInfoStruct - ContentLauncher: - - DimensionStruct - - AdditionalInfoStruct - - ParameterStruct - - ContentSearchStruct - - StyleInformationStruct - - BrandingInformationStruct - ApplicationLauncher: - - ApplicationStruct - - ApplicationEPStruct - ApplicationBasic: - - ApplicationStruct - struct fields: - UnitTesting: - SimpleStruct: - - a - - b - - c - - d - - e - - f - - g - - h - TestFabricScoped: - - fabricSensitiveInt8u - - optionalFabricSensitiveInt8u - - nullableFabricSensitiveInt8u - - nullableOptionalFabricSensitiveInt8u - - fabricSensitiveCharString - - fabricSensitiveStruct - - fabricSensitiveInt8uList - - fabricIndex - NullablesAndOptionalsStruct: - - nullableInt - - optionalInt - - nullableOptionalInt - - nullableString - - optionalString - - nullableOptionalString - - nullableStruct - - optionalStruct - - nullableOptionalStruct - - nullableList - - optionalList - - nullableOptionalList - NestedStruct: - - a - - b - - c - NestedStructList: - - a - - b - - c - - d - - e - - f - - g - DoubleNestedStructList: - - a - TestListStructOctet: - - member1 - - member2 - OTASoftwareUpdateRequestor: - ProviderLocation: - - providerNodeID - - endpoint - - fabricIndex - BasicInformation: - CapabilityMinimaStruct: - - caseSessionsPerFabric - - subscriptionsPerFabric - Descriptor: - DeviceTypeStruct: - - deviceType - AccessControl: - AccessControlEntryStruct: - - privilege - - authMode - - subjects - - targets - - fabricIndex - AccessControlExtensionStruct: - - data - - fabricIndex - SoftwareDiagnostics: - ThreadMetricsStruct: - - id - - name - - stackFreeCurrent - - stackFreeMinimum - - stackSize - GeneralDiagnostics: - NetworkInterface: - - name - - isOperational - - offPremiseServicesReachableIPv4 - - offPremiseServicesReachableIPv6 - - hardwareAddress - - iPv4Addresses - - iPv6Addresses - - type - ModeSelect: - SemanticTagStruct: - - mfgCode - - value - OperationalCredentials: - FabricDescriptorStruct: - - rootPublicKey - - vendorID - - fabricID - - nodeID - - label - - fabricIndex - # Values that are actually deprecated, but we effectively - # introduced them in this release. - - vendorId - - fabricId - - nodeId - DoorLock: - CredentialStruct: - - credentialType - - credentialIndex - MediaPlayback: - PlaybackPositionStruct: - - updatedAt - - position - TargetNavigator: - TargetInfoStruct: - - identifier - - name - MediaInput: - InputInfoStruct: - - index - - inputType - - name - - descriptionString - AudioOutput: - OutputInfoStruct: - - index - - outputType - - name - Channel: - ChannelInfoStruct: - - majorNumber - - minorNumber - - name - - callSign - - affiliateCallSign - LineupInfoStruct: - - operatorName - - lineupName - - postalCode - - lineupInfoType - ContentLauncher: - DimensionStruct: - - width - - height - - metric - AdditionalInfoStruct: - - name - - value - ParameterStruct: - - type - - value - - externalIDList - ContentSearchStruct: - - parameterList - StyleInformationStruct: - - imageURL - - color - - size - # Member that is actually deprecated, but we effectively - # introduced it in this release. - - imageUrl - BrandingInformationStruct: - - providerName - - background - - logo - - progressBar - - splash - - waterMark - ApplicationLauncher: - ApplicationStruct: - - catalogVendorID - - applicationID - # Values that are actually deprecated, but we effectively - # introduced them in this release. - - catalogVendorId - - applicationId - ApplicationEPStruct: - - application - - endpoint - ApplicationBasic: - ApplicationStruct: - - catalogVendorID - - applicationID - # Values that are actually deprecated, but we effectively - # introduced them in this release. - - catalogVendorId - - applicationId - Scenes: - AttributeValuePair: - - attributeID - ExtensionFieldSet: - - clusterID - events: - OTASoftwareUpdateRequestor: - - StateTransition - - VersionApplied - - DownloadError - UnitTesting: - - TestEvent - - TestFabricScopedEvent - BasicInformation: - - StartUp - - ShutDown - - Leave - - ReachableChanged - PowerSource: - - WiredFaultChange - - BatFaultChange - - BatChargeFaultChange - BridgedDeviceBasicInformation: - - StartUp - - ShutDown - - Leave - - ReachableChanged - event fields: - Switch: - MultiPressComplete: - - previousPosition - UnitTesting: - TestEvent: - - arg1 - - arg2 - - arg3 - - arg4 - - arg5 - - arg6 - TestFabricScopedEvent: - - fabricIndex - OTASoftwareUpdateRequestor: - StateTransition: - - previousState - - newState - - reason - - targetSoftwareVersion - VersionApplied: - - softwareVersion - - productID - DownloadError: - - softwareVersion - - bytesDownloaded - - progressPercent - - platformCode - BasicInformation: - StartUp: - - softwareVersion - Leave: - - fabricIndex - ReachableChanged: - - reachableNewValue - PowerSource: - WiredFaultChange: - - current - - previous - BatFaultChange: - - current - - previous - BatChargeFaultChange: - - current - - previous - BridgedDeviceBasicInformation: - StartUp: - - softwareVersion - ReachableChanged: - - reachableNewValue - enums: - OTASoftwareUpdateProvider: - - OTAApplyUpdateAction - - OTADownloadProtocol - - OTAQueryStatus - OTASoftwareUpdateRequestor: - - OTAAnnouncementReason - - OTAChangeReasonEnum - - OTAUpdateStateEnum - UnitTesting: - - SimpleEnum - AccessControl: - - AccessControlEntryPrivilegeEnum - - AccessControlEntryAuthModeEnum - ThreadNetworkDiagnostics: - - ConnectionStatusEnum - EthernetNetworkDiagnostics: - - PHYRateEnum - GeneralDiagnostics: - - HardwareFaultEnum - - RadioFaultEnum - - BootReasonEnum - - NetworkFaultEnum - OperationalCredentials: - - NodeOperationalCertStatusEnum - - CertificateChainTypeEnum - DoorLock: - - AlarmCodeEnum - - CredentialRuleEnum - - CredentialTypeEnum - - DataOperationTypeEnum - - DoorStateEnum - - LockDataTypeEnum - - LockOperationTypeEnum - - OperationErrorEnum - - OperatingModeEnum - - OperationSourceEnum - enum values: - OTASoftwareUpdateProvider: - OTAApplyUpdateAction: - - Proceed - - AwaitNextAction - - Discontinue - OTADownloadProtocol: - - BDXSynchronous - - BDXAsynchronous - - HTTPS - - VendorSpecific - OTAQueryStatus: - - UpdateAvailable - - Busy - - NotAvailable - - DownloadProtocolNotSupported - OTASoftwareUpdateRequestor: - OTAAnnouncementReason: - - SimpleAnnouncement - - UpdateAvailable - - UrgentUpdateAvailable - OTAChangeReasonEnum: - - Unknown - - Success - - Failure - - TimeOut - - DelayByProvider - OTAUpdateStateEnum: - - Unknown - - Idle - - Querying - - DelayedOnQuery - - Downloading - - Applying - - DelayedOnApply - - RollingBack - - DelayedOnUserConsent - UnitTesting: - SimpleEnum: - - Unspecified - - ValueA - - ValueB - - ValueC - GeneralCommissioning: - # CommissioningErrorEnum was originally just named - # CommissioningError, but we generate the same API - # for both of those names, so the name can just change - # here. - CommissioningErrorEnum: - - OK - AccessControl: - AccessControlEntryPrivilegeEnum: - - View - - ProxyView - - Operate - - Manage - - Administer - AccessControlEntryAuthModeEnum: - - PASE - - CASE - - Group - PowerSource: - BatChargeLevelEnum: - - OK - BatChargeFaultEnum: - - Unspecified - PowerSourceStatusEnum: - - Unspecified - ThreadNetworkDiagnostics: - ConnectionStatusEnum: - - Connected - - NotConnected - WiFiNetworkDiagnostics: - WiFiVersionType: - - A - - B - - G - - N - - Ac - - Ax - EthernetNetworkDiagnostics: - PHYRateEnum: - - Rate10M - - Rate100M - - Rate1G - - Rate25G - - Rate5G - - Rate10G - - Rate40G - - Rate100G - - Rate200G - - Rate400G - GeneralDiagnostics: - HardwareFaultEnum: - - Unspecified - - Radio - - Sensor - - ResettableOverTemp - - NonResettableOverTemp - - PowerSource - - VisualDisplayFault - - AudioOutputFault - - UserInterfaceFault - - NonVolatileMemoryError - - TamperDetected - RadioFaultEnum: - - Unspecified - - WiFiFault - - CellularFault - - ThreadFault - - NFCFault - - BLEFault - - EthernetFault - BootReasonEnum: - - Unspecified - - PowerOnReboot - - BrownOutReset - - SoftwareWatchdogReset - - HardwareWatchdogReset - - SoftwareUpdateCompleted - - SoftwareReset - NetworkFaultEnum: - - Unspecified - - HardwareFailure - - NetworkJammed - - ConnectionFailed - OperationalCredentials: - NodeOperationalCertStatusEnum: - - OK - - InvalidPublicKey - - InvalidNodeOpId - - InvalidNOC - - MissingCsr - - TableFull - - InvalidAdminSubject - - FabricConflict - - LabelConflict - - InvalidFabricIndex - CertificateChainTypeEnum: - - DACCertificate - - PAICertificate - DoorLock: - AlarmCodeEnum: - - LockJammed - - LockFactoryReset - - LockRadioPowerCycled - - WrongCodeEntryLimit - - FrontEsceutcheonRemoved - - DoorForcedOpen - - DoorAjar - - ForcedUser - CredentialRuleEnum: - - Single - - Dual - - Tri - CredentialTypeEnum: - - ProgrammingPIN - - PIN - - RFID - - Fingerprint - - FingerVein - - Face - DataOperationTypeEnum: - - Add - - Clear - - Modify - DoorStateEnum: - - DoorOpen - - DoorClosed - - DoorJammed - - DoorForcedOpen - - DoorUnspecifiedError - - DoorAjar - LockDataTypeEnum: - - Unspecified - - ProgrammingCode - - UserIndex - - WeekDaySchedule - - YearDaySchedule - - HolidaySchedule - - PIN - - RFID - - Fingerprint - LockOperationTypeEnum: - - Lock - - Unlock - - NonAccessUserEvent - - ForcedUserEvent - OperationErrorEnum: - - Unspecified - - InvalidCredential - - DisabledUserDenied - - Restricted - - InsufficientBattery - OperatingModeEnum: - - Normal - - Vacation - - Privacy - - NoRemoteLockUnlock - - Passage - OperationSourceEnum: - - Unspecified - - Manual - - ProprietaryRemote - - Keypad - - Auto - - Button - - Schedule - - Remote - - RFID - - Biometric - UserTypeEnum: - - UnrestrictedUser - - ProgrammingUser - - ForcedUser - - DisposableUser - - ExpiringUser - - ScheduleRestrictedUser - - RemoteOnlyUser - MediaInput: - InputTypeEnum: - - HDMI - - SCART - - USB - AudioOutput: - OutputTypeEnum: - - HDMI - - BT - Channel: - LineupInfoTypeEnum: - - MSO - ContentLauncher: - MetricTypeEnum: - - Pixels - - Percentage - ParameterEnum: - - Video - Thermostat: - # SystemModeEnum was originally named ThermostatSystemMode, but we - # generate the same API for the names with/without "Enum" at the - # end and the cluster name present/absent at the beginning, so the - # name can just change here. - SystemModeEnum: - - EmergencyHeat - - Dry - - Sleep - SetpointAdjustMode: - - Heat - - Cool - - Both - bitmaps: - UnitTesting: - - Bitmap8MaskMap - - Bitmap16MaskMap - - Bitmap32MaskMap - - Bitmap64MaskMap - - SimpleBitmap - LevelControl: - - LevelControlOptions - DoorLock: - - DaysMaskMap - PumpConfigurationAndControl: - - PumpFeature - WiFiNetworkDiagnostics: - # Feature was originally named WiFiNetworkDiagnosticsFeature, but - # we generate the same API for both of those names, so the name - # can just change here. - - Feature - EthernetNetworkDiagnostics: - # Feature was originally named EthernetNetworkDiagnosticsFeature, but - # we generate the same API for both of those names, so the name - # can just change here. - - Feature - bitmap values: - UnitTesting: - Bitmap8MaskMap: - - MaskVal1 - - MaskVal2 - - MaskVal3 - - MaskVal4 - Bitmap16MaskMap: - - MaskVal1 - - MaskVal2 - - MaskVal3 - - MaskVal4 - Bitmap32MaskMap: - - MaskVal1 - - MaskVal2 - - MaskVal3 - - MaskVal4 - Bitmap64MaskMap: - - MaskVal1 - - MaskVal2 - - MaskVal3 - - MaskVal4 - SimpleBitmap: - - ValueA - - ValueB - - ValueC - LevelControl: - LevelControlOptions: - - ExecuteIfOff - - CoupleColorTempToLevel - NetworkCommissioning: - WiFiSecurity: - - WEP - - WPAPersonal - - WPA2Personal - - WPA3Personal - PressureMeasurement: - PressureFeature: - - Extended - DoorLock: - DaysMaskMap: - - Sunday - - Monday - - Tuesday - - Wednesday - - Thursday - - Friday - - Saturday - # Feature was originally named DoorLockFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - PINCredential - - RFIDCredential - - WeekDayAccessSchedules - - CredentialsOverTheAirAccess - - User - - Notification - - YearDayAccessSchedules - PumpConfigurationAndControl: - PumpFeature: - - ConstantPressure - - CompensatedPressure - - ConstantFlow - - ConstantSpeed - - ConstantTemperature - - Automatic - - Local - Thermostat: - # Feature was originally named ThermostatFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - ScheduleConfiguration - - AutoMode - DayOfWeek: - - Away - ModeForSequence: - - HeatSetpointPresent - - CoolSetpointPresent - WiFiNetworkDiagnostics: - # Feature was originally named WiFiNetworkDiagnosticsFeature, but - # we generate the same API for both of those names, so the name - # can just change here. - Feature: - - PacketCounts - - ErrorCounts - EthernetNetworkDiagnostics: - # Feature was originally named EthernetNetworkDiagnosticsFeature, but - # we generate the same API for both of those names, so the name - # can just change here. - Feature: - - PacketCounts - - ErrorCounts - deprecated: - clusters: - - OtaSoftwareUpdateProvider - - OtaSoftwareUpdateRequestor - - TestCluster - - WakeOnLan - - Basic - attributes: - Descriptor: - - DeviceList - AccessControl: - - Acl - BallastConfiguration: - - IntrinsicBalanceFactor - OccupancySensing: - - PirOccupiedToUnoccupiedDelay - - PirUnoccupiedToOccupiedDelay - - PirUnoccupiedToOccupiedThreshold - ThreadNetworkDiagnostics: - - NeighborTableList - - RouteTableList - WiFiNetworkDiagnostics: - - Bssid - - Rssi - GeneralDiagnostics: - - BootReasons - commands: - ContentLauncher: - - LaunchResponse - MediaPlayback: - - StopPlayback - command fields: - Groups: - AddGroup: - - groupId - AddGroupIfIdentifying: - - groupId - AddGroupResponse: - - groupId - RemoveGroup: - - groupId - RemoveGroupResponse: - - groupId - ViewGroup: - - groupId - ViewGroupResponse: - - groupId - OnOff: - OffWithEffect: - - effectId - DiagnosticLogs: - RetrieveLogsResponse: - - content - - timeStamp - AdministratorCommissioning: - OpenCommissioningWindow: - - pakeVerifier - OperationalCredentials: - AttestationResponse: - - signature - AddTrustedRootCertificate: - - rootCertificate - DoorLock: - SetUser: - - userUniqueId - GetUserResponse: - - userUniqueId - ColorControl: - MoveToColorTemperature: - - colorTemperature - OTASoftwareUpdateProvider: - QueryImage: - - vendorId - - productId - OTASoftwareUpdateRequestor: - AnnounceOTAProvider: - - providerNodeId - - vendorId - Scenes: - AddScene: - - groupId - - sceneId - ViewScene: - - groupId - - sceneId - RemoveScene: - - groupId - - sceneId - RemoveAllScenes: - - groupId - StoreScene: - - groupId - - sceneId - RecallScene: - - groupId - - sceneId - GetSceneMembership: - - groupId - EnhancedAddScene: - - groupId - - sceneId - EnhancedViewScene: - - groupId - - sceneId - CopyScene: - - groupIdFrom - - sceneIdFrom - - groupIdTo - - sceneIdTo - AddSceneResponse: - - groupId - - sceneId - ViewSceneResponse: - - groupId - - sceneId - RemoveSceneResponse: - - groupId - - sceneId - RemoveAllScenesResponse: - - groupId - StoreSceneResponse: - - groupId - - sceneId - GetSceneMembershipResponse: - - groupId - EnhancedAddSceneResponse: - - groupId - - sceneId - EnhancedViewSceneResponse: - - groupId - - sceneId - CopySceneResponse: - - groupIdFrom - - sceneIdFrom - structs: - Descriptor: - - DeviceType - AccessControl: - - AccessControlEntry - - ExtensionEntry - PowerSource: - - WiredFaultChangeType - - BatFaultChangeType - - BatChargeFaultChangeType - SoftwareDiagnostics: - - ThreadMetrics - GeneralDiagnostics: - - NetworkInterfaceType - ModeSelect: - - SemanticTag - OperationalCredentials: - - FabricDescriptor - DoorLock: - - DlCredential - MediaPlayback: - - PlaybackPosition - TargetNavigator: - - TargetInfo - MediaInput: - - InputInfo - AudioOutput: - - OutputInfo - Channel: - - ChannelInfo - - LineupInfo - ContentLauncher: - - Dimension - - AdditionalInfo - - Parameter - - ContentSearch - - StyleInformation - - BrandingInformation - ApplicationLauncher: - - Application - - ApplicationEP - ApplicationBasic: - - ApplicationBasicApplication - struct fields: - Descriptor: - DeviceTypeStruct: - - type - OperationalCredentials: - FabricDescriptorStruct: - - vendorId - - fabricId - - nodeId - ContentLauncher: - StyleInformationStruct: - - imageUrl - ApplicationLauncher: - ApplicationStruct: - - catalogVendorId - - applicationId - ApplicationBasic: - ApplicationStruct: - - catalogVendorId - - applicationId - Scenes: - AttributeValuePair: - - attributeId - ExtensionFieldSet: - - clusterId - event fields: - Switch: - MultiPressComplete: - - newPosition - enums: - AccessControl: - - Privilege - - AuthMode - ThreadNetworkDiagnostics: - - ThreadConnectionStatus - EthernetNetworkDiagnostics: - - PHYRateType - GeneralDiagnostics: - - HardwareFaultType - - RadioFaultType - - BootReasonType - - NetworkFaultType - OperationalCredentials: - - OperationalCertStatus - DoorLock: - - DlAlarmCode - - DlCredentialRule - - DlCredentialType - - DlDataOperationType - - DlDoorState - - DlLockDataType - - DlLockOperationType - - DlOperationError - - DlOperatingMode - - DlOperationSource - - DlUserStatus - - DlUserType - # The enums after this come from the draft/types/door-lock.xml, not the - # door lock cluster XML - # - # DoorLockUserStatus is not marked deprecated here because the - # UserStatusEnum from the spec ends up with the same enum name - # (MTRDoorLockUserStatus) but is missing one of the values - # compared to DoorLockUserStatus. So we have to keep - # DoorLockUserStatus for now and just deprecate its one extra name. - - DoorLockUserStatus - - DoorLockUserType - - DoorLockDayOfWeek - - DoorLockSetPinOrIdStatus - - DoorLockOperationEventCode - - DoorLockProgrammingEventCode - enum values: - GeneralCommissioning: - # CommissioningErrorEnum was originally just named - # CommissioningError, but we generate the same API - # for both of those names, so the name can just change - # here. - CommissioningErrorEnum: - - Ok - PowerSource: - BatChargeLevelEnum: - - Ok - BatChargeFaultEnum: - - Unspecfied - PowerSourceStatusEnum: - - Unspecfied - WiFiNetworkDiagnostics: - WiFiVersionType: - - 80211a - - 80211b - - 80211g - - 80211n - - 80211ac - - 80211ax - DoorLock: - UserStatusEnum: - - NotSupported - UserTypeEnum: - - NotSupported - - Unrestricted - - MasterUser - MediaInput: - InputTypeEnum: - - Hdmi - - Scart - - Usb - AudioOutput: - OutputTypeEnum: - - Hdmi - - Bt - Channel: - LineupInfoTypeEnum: - - Mso - ContentLauncher: - MetricTypeEnum: - - PIXELS - - PERCENTAGE - Thermostat: - # SystemModeEnum was originally named ThermostatSystemMode, but we - # generate the same API for the names with/without "Enum" at the - # end and the cluster name present/absent at the beginning, so the - # name can just change here. - SystemModeEnum: - - EmergencyHeating - SetpointAdjustMode: - - HeatSetpoint - - CoolSetpoint - - HeatAndCoolSetpoints - bitmaps: - DoorLock: - - DlDaysMaskMap - bitmap values: - NetworkCommissioning: - WiFiSecurity: - - WepPersonal - - WpaPersonal - - Wpa2Personal - - Wpa3Personal - PressureMeasurement: - PressureFeature: - - EXT - DoorLock: - # Feature was originally named DoorLockFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - PINCredentials - - RFIDCredentials - - WeekDaySchedules - - CredentialsOTA - - UsersManagement - - Notifications - - YearDaySchedules - Thermostat: - # Feature was originally named ThermostatFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - Schedule - - Automode - DayOfWeek: - - AwayOrVacation - ModeForSequence: - - HeatSetpointFieldPresent - - CoolSetpointFieldPresent - apis: - - Timed Invoke for server to client commands - - Deprecated global attribute names - removed: - commands: - BasicInformation: - - MfgSpecificPing - command fields: - # Cases where the cluster/command got renamed and the fields got - # renamed, so the old command name never had the new fields. - OtaSoftwareUpdateProvider: - QueryImage: - - vendorID - - productID - enums: - # DoorLockUserStatus (non-spec) and UserStatusEnum (from the spec) end - # up with the same enum name (MTRDoorLockUserStatus), so just remove - # the non-spec one. - DoorLock: - - DoorLockUserStatus - - DoorLockUserType - enum values: - EthernetNetworkDiagnostics: - # Both the enum and the values got renamed, so don't output the - # old values with the new enum name. - PHYRateEnum: - - 10M - - 100M - - 1000M - - 25G - - 5G - - 10G - - 40G - - 100G - - 200G - - 400G - OperationalCredentials: - # Both the enum and the value got renamed, so don't output the - # old value with the new enum name. - NodeOperationalCertStatusEnum: - - SUCCESS - DoorLock: - # Both the enum and the values got renamed, so don't output the - # old value with the new enum name. - CredentialRuleEnum: - - Double - renames: - clusters: - UnitTesting: TestCluster - BasicInformation: Basic - OTASoftwareUpdateProvider: OtaSoftwareUpdateProvider - OTASoftwareUpdateRequestor: OtaSoftwareUpdateRequestor - WakeOnLAN: WakeOnLan - BridgedDeviceBasicInformation: BridgedDeviceBasic - attributes: - Descriptor: - DeviceTypeList: DeviceList - AccessControl: - ACL: Acl - BallastConfiguration: - IntrinsicBallastFactor: IntrinsicBalanceFactor - OccupancySensing: - PIROccupiedToUnoccupiedDelay: PirOccupiedToUnoccupiedDelay - PIRUnoccupiedToOccupiedDelay: PirUnoccupiedToOccupiedDelay - PIRUnoccupiedToOccupiedThreshold: PirUnoccupiedToOccupiedThreshold - OTASoftwareUpdateRequestor: - DefaultOTAProviders: DefaultOtaProviders - ThreadNetworkDiagnostics: - NeighborTable: NeighborTableList - RouteTable: RouteTableList - WiFiNetworkDiagnostics: - BSSID: Bssid - RSSI: Rssi - GeneralDiagnostics: - BootReason: BootReasons - commands: - OTASoftwareUpdateRequestor: - AnnounceOTAProvider: AnnounceOtaProvider - ContentLauncher: - LauncherResponse: LaunchResponse - MediaPlayback: - Stop: StopPlayback - command fields: - OTASoftwareUpdateProvider: - QueryImage: - vendorID: vendorId - productID: productId - OTASoftwareUpdateRequestor: - AnnounceOTAProvider: - providerNodeID: providerNodeId - vendorID: vendorId - Groups: - AddGroup: - groupID: groupId - AddGroupIfIdentifying: - groupID: groupId - AddGroupResponse: - groupID: groupId - RemoveGroup: - groupID: groupId - RemoveGroupResponse: - groupID: groupId - ViewGroup: - groupID: groupId - ViewGroupResponse: - groupID: groupId - OnOff: - OffWithEffect: - effectIdentifier: effectId - DiagnosticLogs: - RetrieveLogsResponse: - logContent: content - utcTimeStamp: timeStamp - AdministratorCommissioning: - OpenCommissioningWindow: - pakePasscodeVerifier: pakeVerifier - OperationalCredentials: - AttestationResponse: - attestationSignature: signature - AddTrustedRootCertificate: - rootCACertificate: rootCertificate - DoorLock: - SetUser: - userUniqueID: userUniqueId - GetUserResponse: - userUniqueID: userUniqueId - ColorControl: - MoveToColorTemperature: - colorTemperatureMireds: colorTemperature - Scenes: - AddScene: - groupID: groupId - sceneID: sceneId - ViewScene: - groupID: groupId - sceneID: sceneId - RemoveScene: - groupID: groupId - sceneID: sceneId - RemoveAllScenes: - groupID: groupId - StoreScene: - groupID: groupId - sceneID: sceneId - RecallScene: - groupID: groupId - sceneID: sceneId - GetSceneMembership: - groupID: groupId - EnhancedAddScene: - groupID: groupId - sceneID: sceneId - EnhancedViewScene: - groupID: groupId - sceneID: sceneId - CopyScene: - groupIdentifierFrom: groupIdFrom - sceneIdentifierFrom: sceneIdFrom - groupIdentifierTo: groupIdTo - sceneIdentifierTo: sceneIdTo - AddSceneResponse: - groupID: groupId - sceneID: sceneId - ViewSceneResponse: - groupID: groupId - sceneID: sceneId - RemoveSceneResponse: - groupID: groupId - sceneID: sceneId - RemoveAllScenesResponse: - groupID: groupId - StoreSceneResponse: - groupID: groupId - sceneID: sceneId - GetSceneMembershipResponse: - groupID: groupId - EnhancedAddSceneResponse: - groupID: groupId - sceneID: sceneId - EnhancedViewSceneResponse: - groupID: groupId - sceneID: sceneId - CopySceneResponse: - groupIdentifierFrom: groupIdFrom - sceneIdentifierFrom: sceneIdFrom - structs: - AccessControl: - AccessControlEntryStruct: AccessControlEntry - AccessControlExtensionStruct: ExtensionEntry - SoftwareDiagnostics: - ThreadMetricsStruct: ThreadMetrics - GeneralDiagnostics: - NetworkInterface: NetworkInterfaceType - ModeSelect: - SemanticTagStruct: SemanticTag - OperationalCredentials: - FabricDescriptorStruct: FabricDescriptor - DoorLock: - CredentialStruct: DlCredential - MediaPlayback: - PlaybackPositionStruct: PlaybackPosition - TargetNavigator: - TargetInfoStruct: TargetInfo - MediaInput: - InputInfoStruct: InputInfo - AudioOutput: - OutputInfoStruct: OutputInfo - Channel: - ChannelInfoStruct: ChannelInfo - LineupInfoStruct: LineupInfo - ContentLauncher: - DimensionStruct: Dimension - AdditionalInfoStruct: AdditionalInfo - ParameterStruct: Parameter - ContentSearchStruct: ContentSearch - StyleInformationStruct: StyleInformation - BrandingInformationStruct: BrandingInformation - ApplicationLauncher: - ApplicationStruct: Application - ApplicationEPStruct: ApplicationEP - ApplicationBasic: - ApplicationStruct: ApplicationBasicApplication - struct fields: - Descriptor: - DeviceTypeStruct: - deviceType: type - OperationalCredentials: - FabricDescriptorStruct: - vendorID: vendorId - fabricID: fabricId - nodeID: nodeId - ContentLauncher: - StyleInformationStruct: - imageURL: imageUrl - ApplicationLauncher: - ApplicationStruct: - catalogVendorID: catalogVendorId - applicationID: applicationId - ApplicationBasic: - ApplicationStruct: - catalogVendorID: catalogVendorId - applicationID: applicationId - Scenes: - AttributeValuePair: - attributeID: attributeId - ExtensionFieldSet: - clusterID: clusterId - event fields: - Switch: - MultiPressComplete: - previousPosition: newPosition - enums: - AccessControl: - AccessControlEntryPrivilegeEnum: Privilege - AccessControlEntryAuthModeEnum: AuthMode - ThreadNetworkDiagnostics: - ConnectionStatusEnum: ThreadConnectionStatus - EthernetNetworkDiagnostics: - PHYRateEnum: PHYRateType - GeneralDiagnostics: - HardwareFaultEnum: HardwareFaultType - RadioFaultEnum: RadioFaultType - BootReasonEnum: BootReasonType - NetworkFaultEnum: NetworkFaultType - OperationalCredentials: - NodeOperationalCertStatusEnum: OperationalCertStatus - DoorLock: - AlarmCodeEnum: DlAlarmCode - CredentialRuleEnum: DlCredentialRule - CredentialTypeEnum: DlCredentialType - DataOperationTypeEnum: DlDataOperationType - DoorStateEnum: DlDoorState - LockDataTypeEnum: DlLockDataType - LockOperationTypeEnum: DlLockOperationType - OperationErrorEnum: DlOperationError - OperatingModeEnum: DlOperatingMode - OperationSourceEnum: DlOperationSource - UserStatusEnum: DlUserStatus - UserTypeEnum: DlUserType - enum values: - GeneralCommissioning: - # CommissioningErrorEnum was originally just named - # CommissioningError, but we generate the same API - # for both of those names, so the name can just change - # here. - CommissioningErrorEnum: - OK: Ok - PowerSource: - BatChargeLevelEnum: - OK: Ok - BatChargeFaultEnum: - Unspecified: Unspecfied - PowerSourceStatusEnum: - Unspecified: Unspecfied - WiFiNetworkDiagnostics: - WiFiVersionType: - A: 80211a - B: 80211b - G: 80211g - N: 80211n - Ac: 80211ac - Ax: 80211ax - EthernetNetworkDiagnostics: - PHYRateEnum: - Rate10M: 10M - Rate100M: 100M - Rate1G: 1000M - Rate25G: 25G - Rate5G: 5G - Rate10G: 10G - Rate40G: 40G - Rate100G: 100G - Rate200G: 200G - Rate400G: 400G - PHYRateType: - Rate10M: 10M - Rate100M: 100M - Rate1G: 1000M - Rate25G: 25G - Rate5G: 5G - Rate10G: 10G - Rate40G: 40G - Rate100G: 100G - Rate200G: 200G - Rate400G: 400G - OperationalCredentials: - NodeOperationalCertStatusEnum: - OK: SUCCESS - OperationalCertStatus: - OK: SUCCESS - DoorLock: - CredentialRuleEnum: - Dual: Double - UserTypeEnum: - UnrestrictedUser: Unrestricted - ProgrammingUser: MasterUser - MediaInput: - InputTypeEnum: - HDMI: Hdmi - SCART: Scart - USB: Usb - AudioOutput: - OutputTypeEnum: - HDMI: Hdmi - BT: Bt - Channel: - LineupInfoTypeEnum: - MSO: Mso - ContentLauncher: - MetricTypeEnum: - Pixels: PIXELS - Percentage: PERCENTAGE - Thermostat: - # SystemModeEnum was originally named ThermostatSystemMode, but we - # generate the same API for the names with/without "Enum" at the - # end and the cluster name present/absent at the beginning, so the - # name can just change here. - SystemModeEnum: - EmergencyHeat: EmergencyHeating - SetpointAdjustMode: - Heat: HeatSetpoint - Cool: CoolSetpoint - Both: HeatAndCoolSetpoints - bitmaps: - DoorLock: - DaysMaskMap: DlDaysMaskMap - bitmap values: - NetworkCommissioning: - WiFiSecurity: - WEP: WepPersonal - WPAPersonal: WpaPersonal - WPA2Personal: Wpa2Personal - WPA3Personal: Wpa3Personal - PressureMeasurement: - PressureFeature: - Extended: EXT - DoorLock: - # Feature was originally named DoorLockFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - PINCredential: PINCredentials - RFIDCredential: RFIDCredentials - WeekDayAccessSchedules: WeekDaySchedules - CredentialsOverTheAirAccess: CredentialsOTA - User: UsersManagement - Notification: Notifications - YearDayAccessSchedules: YearDaySchedules - Thermostat: - # Feature was originally named ThermostatFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - ScheduleConfiguration: Schedule - AutoMode: Automode - DayOfWeek: - Away: AwayOrVacation - ModeForSequence: - HeatSetpointPresent: HeatSetpointFieldPresent - CoolSetpointPresent: CoolSetpointFieldPresent - -- release: "First after major API revamp" - versions: - iOS: "16.5" - macOS: "13.4" - watchOS: "9.5" - tvOS: "16.5" - introduced: - ids: - attributes: - TimeSynchronization: - - DSTOffset - command fields: - DiagnosticLogs: - RetrieveLogsRequest: - # Not really usable in earlier releases: wrong type. - - transferFileDesignator - structs: - TimeSynchronization: - - DSTOffsetStruct - - TimeZoneStruct - struct fields: - TimeSynchronization: - DSTOffsetStruct: - - offset - - validStarting - - validUntil - TimeZoneStruct: - - offset - - validAt - - name - enums: - DiagnosticLogs: - - IntentEnum - - StatusEnum - - TransferProtocolEnum - OccupancySensing: - - OccupancySensorTypeEnum - WiFiNetworkDiagnostics: - - ConnectionStatusEnum - - WiFiVersionEnum - PumpConfigurationAndControl: - - ControlModeEnum - - OperationModeEnum - PowerSource: - - BatCommonDesignationEnum - - BatApprovedChemistryEnum - enum values: - DoorLock: - LockDataTypeEnum: - - FingerVein - - Face - DiagnosticLogs: - IntentEnum: - - EndUserSupport - - NetworkDiag - - CrashLogs - StatusEnum: - - Success - - Exhausted - - NoLogs - - Busy - - Denied - TransferProtocolEnum: - - ResponsePayload - - BDX - OccupancySensing: - OccupancySensorTypeEnum: - - PIR - - Ultrasonic - - PIRAndUltrasonic - - PhysicalContact - WiFiNetworkDiagnostics: - ConnectionStatusEnum: - - Connected - - NotConnected - WiFiVersionEnum: - - A - - B - - G - - N - - Ac - - Ax - PumpConfigurationAndControl: - ControlModeEnum: - - ConstantSpeed - - ConstantPressure - - ProportionalPressure - - ConstantFlow - - ConstantTemperature - - Automatic - OperationModeEnum: - - Normal - - Minimum - - Maximum - - Local - PowerSource: - WiredFaultEnum: - - Unspecified - BatFaultEnum: - - Unspecified - BatCommonDesignationEnum: - - Unspecified - - AAA - - AA - - C - - D - - 4v5 - - 6v0 - - 9v0 - - 12AA - - AAAA - - A - - B - - F - - N - - No6 - - SubC - - A23 - - A27 - - BA5800 - - Duplex - - 4SR44 - - "523" - - "531" - - 15v0 - - 22v5 - - 30v0 - - 45v0 - - 67v5 - - J - - CR123A - - CR2 - - 2CR5 - - CRP2 - - CRV3 - - SR41 - - SR43 - - SR44 - - SR45 - - SR48 - - SR54 - - SR55 - - SR57 - - SR58 - - SR59 - - SR60 - - SR63 - - SR64 - - SR65 - - SR66 - - SR67 - - SR68 - - SR69 - - SR516 - - SR731 - - SR712 - - LR932 - - A5 - - A10 - - A13 - - A312 - - A675 - - AC41E - - "10180" - - "10280" - - "10440" - - "14250" - - "14430" - - "14500" - - "14650" - - "15270" - - "16340" - - RCR123A - - "17500" - - "17670" - - "18350" - - "18500" - - "18650" - - "19670" - - "25500" - - "26650" - - "32600" - BatApprovedChemistryEnum: - - Unspecified - - Alkaline - - LithiumCarbonFluoride - - LithiumChromiumOxide - - LithiumCopperOxide - - LithiumIronDisulfide - - LithiumManganeseDioxide - - LithiumThionylChloride - - Magnesium - - MercuryOxide - - NickelOxyhydride - - SilverOxide - - ZincAir - - ZincCarbon - - ZincChloride - - ZincManganeseDioxide - - LeadAcid - - LithiumCobaltOxide - - LithiumIon - - LithiumIonPolymer - - LithiumIronPhosphate - - LithiumSulfur - - LithiumTitanate - - NickelCadmium - - NickelHydrogen - - NickelIron - - NickelMetalHydride - - NickelZinc - - SilverZinc - - SodiumIon - - SodiumSulfur - - ZincBromide - - ZincCerium - bitmaps: - OccupancySensing: - - OccupancyBitmap - - OccupancySensorTypeBitmap - PumpConfigurationAndControl: - - PumpStatusBitmap - bitmap values: - OccupancySensing: - OccupancyBitmap: - - Occupied - OccupancySensorTypeBitmap: - - PIR - - Ultrasonic - - PhysicalContact - PumpConfigurationAndControl: - PumpFeature: - - LocalOperation - PumpStatusBitmap: - - DeviceFault - - Supplyfault - - SpeedLow - - SpeedHigh - - LocalOverride - - Running - - RemotePressure - - RemoteFlow - - RemoteTemperature - deprecated: - attributes: - TimeSynchronization: - - DstOffset - structs: - TimeSynchronization: - - DstOffsetType - - TimeZoneType - enums: - DiagnosticLogs: - - LogsIntent - - LogsStatus - - LogsTransferProtocol - WiFiNetworkDiagnostics: - - WiFiConnectionStatus - - WiFiVersionType - PumpConfigurationAndControl: - - PumpControlMode - - PumpOperationMode - enum values: - PowerSource: - WiredFaultEnum: - - Unspecfied - BatFaultEnum: - - Unspecfied - bitmaps: - PumpConfigurationAndControl: - - PumpStatus - bitmap values: - PumpConfigurationAndControl: - PumpFeature: - - Local - renames: - attributes: - TimeSynchronization: - DSTOffset: DstOffset - structs: - TimeSynchronization: - DSTOffsetStruct: DstOffsetType - TimeZoneStruct: TimeZoneType - enums: - DiagnosticLogs: - IntentEnum: LogsIntent - StatusEnum: LogsStatus - TransferProtocolEnum: LogsTransferProtocol - WiFiNetworkDiagnostics: - ConnectionStatusEnum: WiFiConnectionStatus - WiFiVersionEnum: WiFiVersionType - PumpConfigurationAndControl: - ControlModeEnum: PumpControlMode - OperationModeEnum: PumpOperationMode - enum values: - PowerSource: - WiredFaultEnum: - Unspecified: Unspecfied - BatFaultEnum: - Unspecified: Unspecfied - bitmaps: - PumpConfigurationAndControl: - PumpStatusBitmap: PumpStatus - bitmap values: - PumpConfigurationAndControl: - PumpFeature: - LocalOperation: Local - -- release: "Fall 2023" - versions: - iOS: "17.0" - macOS: "14.0" - watchOS: "10.0" - tvOS: "17.0" - introduced: - attributes: - BasicInformation: - - ProductAppearance - BridgedDeviceBasicInformation: - - ProductAppearance - structs: - AccessControl: - - AccessControlTargetStruct - BasicInformation: - - ProductAppearanceStruct - BridgedDeviceBasicInformation: - - ProductAppearanceStruct - NetworkCommissioning: - - WiFiInterfaceScanResultStruct - - ThreadInterfaceScanResultStruct - - NetworkInfoStruct - ThreadNetworkDiagnostics: - - NeighborTableStruct - - RouteTableStruct - struct fields: - AccessControl: - AccessControlTargetStruct: - - cluster - - endpoint - - deviceType - BasicInformation: - ProductAppearanceStruct: - - finish - - primaryColor - BridgedDeviceBasicInformation: - ProductAppearanceStruct: - - finish - - primaryColor - NetworkCommissioning: - WiFiInterfaceScanResultStruct: - - security - - ssid - - bssid - - channel - - wiFiBand - - rssi - ThreadInterfaceScanResultStruct: - - panId - - extendedPanId - - networkName - - channel - - version - - extendedAddress - - rssi - - lqi - NetworkInfoStruct: - - networkID - - connected - ThreadNetworkDiagnostics: - NeighborTableStruct: - - extAddress - - age - - rloc16 - - linkFrameCounter - - mleFrameCounter - - lqi - - averageRssi - - lastRssi - - frameErrorRate - - messageErrorRate - - rxOnWhenIdle - - fullThreadDevice - - fullNetworkData - - isChild - RouteTableStruct: - - extAddress - - rloc16 - - routerId - - nextHop - - pathCost - - lqiIn - - lqiOut - - age - - allocated - - linkEstablished - enums: - BasicInformation: - - ColorEnum - - ProductFinishEnum - BridgedDeviceBasicInformation: - - ColorEnum - - ProductFinishEnum - FanControl: - - FanModeEnum - - FanModeSequenceEnum - enum values: - BasicInformation: - ColorEnum: - - Black - - Navy - - Green - - Teal - - Maroon - - Purple - - Olive - - Gray - - Blue - - Lime - - Aqua - - Red - - Fuchsia - - Yellow - - White - - Nickel - - Chrome - - Brass - - Copper - - Silver - - Gold - ProductFinishEnum: - - Matte - - Satin - - Polished - - Rugged - - Fabric - - Other - BridgedDeviceBasicInformation: - ColorEnum: - - Black - - Navy - - Green - - Teal - - Maroon - - Purple - - Olive - - Gray - - Blue - - Lime - - Aqua - - Red - - Fuchsia - - Yellow - - White - - Nickel - - Chrome - - Brass - - Copper - - Silver - - Gold - ProductFinishEnum: - - Matte - - Satin - - Polished - - Rugged - - Fabric - - Other - FanControl: - FanModeEnum: - - Off - - Low - - Medium - - High - - On - - Auto - - Smart - FanModeSequenceEnum: - - OffLowMedHigh - - OffLowHigh - - OffLowMedHighAuto - - OffLowHighAuto - - OffOnAuto - - OffOn - NetworkCommissioning: - # WiFiBandEnum was originally just named WiFiBand, but we generate - # the same API for both of those names, so the name can just - # change here. - WiFiBandEnum: - - 1G - WiFiNetworkDiagnostics: - WiFiVersionEnum: - - Ah - Identify: - IdentifyTypeEnum: - - LightOutput - - VisibleIndicator - bitmaps: - Groups: - - Feature - - NameSupportBitmap - NetworkCommissioning: - - WiFiSecurityBitmap - PressureMeasurement: - - Feature - PumpConfigurationAndControl: - - Feature - Scenes: - - Feature - FanControl: - - RockBitmap - - WindBitmap - bitmap values: - FanControl: - RockBitmap: - - RockLeftRight - - RockUpDown - - RockRound - WindBitmap: - - SleepWind - - NaturalWind - Groups: - Feature: - - GroupNames - NameSupportBitmap: - - GroupNames - ModeSelect: - Feature: - - OnOff - NetworkCommissioning: - WiFiSecurityBitmap: - - Unencrypted - - WEP - - WPAPersonal - - WPA2Personal - - WPA3Personal - PressureMeasurement: - Feature: - - Extended - PumpConfigurationAndControl: - Feature: - - ConstantPressure - - CompensatedPressure - - ConstantFlow - - ConstantSpeed - - ConstantTemperature - - Automatic - - LocalOperation - Scenes: - Feature: - - SceneNames - Thermostat: - Feature: - - LocalTemperatureNotExposed - ids: - attributes: - TimeSynchronization: - - TrustedTimeSource - - DefaultNTP - - NTPServerAvailable - deprecated: - clusters: - # We apparently forgot to deprecate BridgedDeviceBasic when we - # introduced BridgedDeviceBasicInformation. - - BridgedDeviceBasic - enum values: - Identify: - IdentifyTypeEnum: - - VisibleLight - - VisibleLED - structs: - AccessControl: - - Target - NetworkCommissioning: - - WiFiInterfaceScanResult - - ThreadInterfaceScanResult - - NetworkInfo - ThreadNetworkDiagnostics: - - NeighborTable - - RouteTable - enums: - FanControl: - - FanModeType - - FanModeSequenceType - bitmaps: - Groups: - - GroupClusterFeature - NetworkCommissioning: - - WiFiSecurity - PressureMeasurement: - - PressureFeature - PumpConfigurationAndControl: - - PumpFeature - FanControl: - - RockSupportMask - - WindSupportMask - bitmap values: - ModeSelect: - Feature: - - DEPONOFF - renames: - attributes: - TimeSynchronization: - TrustedTimeSource: TrustedTimeNodeId - DefaultNTP: DefaultNtp - NTPServerAvailable: NtpServerPort - commands: - TimeSynchronization: - SetUTCTime: SetUtcTime - structs: - AccessControl: - AccessControlTargetStruct: Target - NetworkCommissioning: - WiFiInterfaceScanResultStruct: WiFiInterfaceScanResult - ThreadInterfaceScanResultStruct: ThreadInterfaceScanResult - NetworkInfoStruct: NetworkInfo - ThreadNetworkDiagnostics: - NeighborTableStruct: NeighborTable - RouteTableStruct: RouteTable - enums: - FanControl: - FanModeEnum: FanModeType - FanModeSequenceEnum: FanModeSequenceType - enum values: - TimeSynchronization: - TimeSourceEnum: - NonMatterSNTP: NonFabricSntp - NonMatterNTP: NonFabricNtp - MatterSNTP: FabricSntp - MatterNTP: FabricNtp - MixedNTP: MixedNtp - NonMatterSNTPNTS: NonFabricSntpNts - NonMatterNTPNTS: NonFabricNtpNts - MatterSNTPNTS: FabricSntpNts - MatterNTPNTS: FabricNtpNts - MixedNTPNTS: MixedNtpNts - PTP: Ptp - GNSS: Gnss - Identify: - IdentifyTypeEnum: - LightOutput: VisibleLight - VisibleIndicator: VisibleLED - bitmaps: - Groups: - Feature: GroupClusterFeature - NetworkCommissioning: - WiFiSecurityBitmap: WiFiSecurity - PressureMeasurement: - Feature: PressureFeature - PumpConfigurationAndControl: - Feature: PumpFeature - FanControl: - RockBitmap: RockSupportMask - WindBitmap: WindSupportMask - bitmap values: - ModeSelect: - Feature: - OnOff: DEPONOFF - swiftUnavailable: - bitmap values: - NetworkCommissioning: - WiFiSecurity: - # The bitmap got renamed to WiFiSecurityBitmap, so now both - # the Wpa* and WPA* names on WiFiSecurity are deprecated. - # They get mapped to Swift with identical names, which leads - # to the names being ambiguous. Mark the "Wpa*" as - # unavailable to Swift to work around this. - - WpaPersonal - - Wpa2Personal - - Wpa3Personal - provisional: - clusters: - ## Not ready at cutoff - - AirQuality - # Replaceable Monitoring clusters - - HEPAFilterMonitoring - - ActivatedCarbonFilterMonitoring - # Concentration Measurement clusters - - CarbonDioxideConcentrationMeasurement - - CarbonMonoxideConcentrationMeasurement - - FormaldehydeConcentrationMeasurement - - NitrogenDioxideConcentrationMeasurement - - OzoneConcentrationMeasurement - - PM10ConcentrationMeasurement - - PM1ConcentrationMeasurement - - PM25ConcentrationMeasurement - - RadonConcentrationMeasurement - - TotalVolatileOrganicCompoundsConcentrationMeasurement - - RefrigeratorAlarm - - TemperatureControl - - SmokeCOAlarm - ## Not ready to be public API yet. - - ICDManagement - - LaundryWasherMode - - RefrigeratorAndTemperatureControlledCabinetMode - - DishwasherMode - - LaundryWasherControls - - DishwasherAlarm - - SampleMEI - attributes: - Scenes: - # New scenes bits not stable yet. - - SceneTableSize - FanControl: - # New Fan Control bits not stable yet. - - AirflowDirection - RVCCleanMode: - # People are trying to deprecate this one - - OnMode - RVCRunMode: - # People are trying to deprecate this one - - OnMode - commands: - FanControl: - # Not stable yet - - Step - DoorLock: - # Not stable yet - - UnboltDoor - RVCOperationalState: - # Disallowed in the spec, but present in our XML? - - Start - - Stop - enums: - FanControl: - # Not stable yet. - - StepDirectionEnum - - AirflowDirectionEnum - enum values: - DoorLock: - # Not stable yet - DlLockState: - - Unlatched - DlLockType: - - Eurocylinder - LockOperationTypeEnum: - - Unlatch - TimeSynchronization: - TimeSourceEnum: - - NonMatterSNTP - - NonMatterNTP - - MatterSNTP - - MatterNTP - - MixedNTP - - NonMatterSNTPNTS - - NonMatterNTPNTS - - MatterSNTPNTS - - MatterNTPNTS - - MixedNTPNTS - - PTP - - GNSS - bitmap values: - DoorLock: - # Not stable yet - # Feature was originally named DoorLockFeature, but we generate the - # same API for both of those names, so the name can just change - # here. - Feature: - - Unbolt - FanControl: - # Not stable yet - Feature: - - Step - - AirflowDirection - RVCRunMode: - Feature: - # People are trying to deprecate this one - - OnOff - RVCCleanMode: - Feature: - # People are trying to deprecate this one - - OnOff - global attributes: - - EventList - # Once we actually unmark TimeSynchronization as provisional, all these bits except EventList should go away too, and we should instead - # mark things as introduced/deprecated as needed. The "ids" entries should go away, in particular. - ids: - attributes: - TimeSynchronization: - - TimeZoneListMaxSize - - DSTOffsetListMaxSize - - SupportsDNSResolve - # Because we are special-casing ids for TimeSynchronization - # above, we need to explicitly mark the EventList id - # provisional. - - EventList - PulseWidthModulation: - # Because we are special-casing ids for PulseWidthModulation - # above, we need to explicitly mark the EventList id - # provisional. - - EventList - commands: - TimeSynchronization: - - SetUTCTime - - SetTrustedTimeSource - - SetTimeZone - - SetTimeZoneResponse - - SetDSTOffset - - SetDefaultNTP - events: - TimeSynchronization: - - DSTTableEmpty - - DSTStatus - - TimeZoneStatus - - TimeFailure - - MissingTrustedTimeSource - -- release: "Fall 2023 #2" - versions: - iOS: "17.1" - macOS: "14.1" - watchOS: "10.1" - tvOS: "17.1" - introduced: - bitmaps: - TimeFormatLocalization: - - Feature - bitmap values: - OnOff: - Feature: - - DeadFront - TimeFormatLocalization: - Feature: - - CalendarFormat - provisional: - attributes: - Descriptor: - - TagList - structs: - # New things, not quite finalized. - Descriptor: - - SemanticTagStruct - struct fields: - # New things, not quite finalized. - Descriptor: - SemanticTagStruct: - - mfgCode - - namespaceID - - tag - - label - bitmaps: - # CacheAndSync is provisional in the spec. - GroupKeyManagement: - - Feature - # New things, not quite finalized. - Descriptor: - - Feature - bitmap values: - # New things, not quite finalized. - Descriptor: - Feature: - - TagList - # CacheAndSync is provisional in the spec. - GroupKeyManagement: - Feature: - - CacheAndSync - # Scenes are generally provisional for now. - Scenes: - Feature: - - Explicit - - TableSize - - FabricScenes - removed: - clusters: - # Clusters that really should just not be exposed, even if they're in our XML. - - FaultInjection - # Clusters that are not going to end up shipping in their current form, - # so we should not be exposing the bits we expose now. - - ProxyConfiguration - - ProxyDiscovery - - ProxyValid - -- release: "Fall 2023 #3" - versions: - iOS: "17.2" - macOS: "14.2" - watchOS: "10.2" - tvOS: "17.2" - introduced: - command payloads: - TimeSynchronization: - - SetUTCTime - command fields: - TimeSynchronization: - SetUTCTime: - - utcTime - - granularity - - timeSource - enums: - OTASoftwareUpdateProvider: - - StatusEnum - - ApplyUpdateActionEnum - - DownloadProtocolEnum - OTASoftwareUpdateRequestor: - - AnnouncementReasonEnum - - UpdateStateEnum - - ChangeReasonEnum - enum values: - OTASoftwareUpdateProvider: - StatusEnum: - - UpdateAvailable - - Busy - - NotAvailable - - DownloadProtocolNotSupported - ApplyUpdateActionEnum: - - Proceed - - AwaitNextAction - - Discontinue - DownloadProtocolEnum: - - BDXSynchronous - - BDXAsynchronous - - HTTPS - - VendorSpecific - OTASoftwareUpdateRequestor: - AnnouncementReasonEnum: - - SimpleAnnouncement - - UpdateAvailable - - UrgentUpdateAvailable - UpdateStateEnum: - - Unknown - - Idle - - Querying - - DelayedOnQuery - - Downloading - - Applying - - DelayedOnApply - - RollingBack - - DelayedOnUserConsent - ChangeReasonEnum: - - Unknown - - Success - - Failure - - TimeOut - - DelayByProvider - OnOff: - DelayedAllOffEffectVariantEnum: - - DelayedOffFastFade - - DelayedOffSlowFade - DyingLightEffectVariantEnum: - - DyingLightFadeOff - StartUpOnOffEnum: - - Toggle - bitmaps: - OnOff: - - OnOffControlBitmap - bitmap values: - OnOff: - Feature: - - DeadFrontBehavior - OnOffControlBitmap: - - AcceptOnlyWhenOn - deprecated: - enums: - OTASoftwareUpdateProvider: - - OTAQueryStatus - - OTAApplyUpdateAction - - OTADownloadProtocol - OTASoftwareUpdateRequestor: - - OTAAnnouncementReason - - OTAUpdateStateEnum - - OTAChangeReasonEnum - enum values: - OnOff: - DelayedAllOffEffectVariantEnum: - - FadeToOffIn0p8Seconds - - 50PercentDimDownIn0p8SecondsThenFadeToOffIn12Seconds - DyingLightEffectVariantEnum: - - 20PercenterDimUpIn0p5SecondsThenFadeToOffIn1Second - StartUpOnOffEnum: - - TogglePreviousOnOff - bitmaps: - OnOff: - - OnOffControl - bitmap values: - OnOff: - Feature: - - DeadFront - provisional: - bitmaps: - BarrierControl: - - BarrierControlCapabilities - - BarrierControlSafetyStatus - BallastConfiguration: - # The BallastConfiguration cluster is provisional for now, but not marked that way. - - BallastStatusBitmap - - LampAlarmModeBitmap - attributes: - GeneralDiagnostics: - # Not in the spec yet. - - AverageWearCount - # New things, not quite finalized. - renames: - enums: - OTASoftwareUpdateProvider: - StatusEnum: OTAQueryStatus - ApplyUpdateActionEnum: OTAApplyUpdateAction - DownloadProtocolEnum: OTADownloadProtocol - OTASoftwareUpdateRequestor: - AnnouncementReasonEnum: OTAAnnouncementReason - UpdateStateEnum: OTAUpdateStateEnum - ChangeReasonEnum: OTAChangeReasonEnum - enum values: - OnOff: - DelayedAllOffEffectVariantEnum: - DelayedOffFastFade: FadeToOffIn0p8Seconds - DelayedOffSlowFade: 50PercentDimDownIn0p8SecondsThenFadeToOffIn12Seconds - DyingLightEffectVariantEnum: - DyingLightFadeOff: 20PercenterDimUpIn0p5SecondsThenFadeToOffIn1Second - StartUpOnOffEnum: - Toggle: TogglePreviousOnOff - bitmaps: - OnOff: - OnOffControlBitmap: OnOffControl - bitmap values: - OnOff: - Feature: - DeadFrontBehavior: DeadFront - -- release: "Early 2024" - versions: - iOS: "17.4" - macOS: "14.4" - watchOS: "10.4" - tvOS: "17.4" - introduced: - clusters: - - RVCRunMode - - RVCCleanMode - - RVCOperationalState - - OperationalState - attributes: - RVCRunMode: - - SupportedModes - - CurrentMode - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - RVCCleanMode: - - SupportedModes - - CurrentMode - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - RVCOperationalState: - - PhaseList - - CurrentPhase - - CountdownTime - - OperationalStateList - - OperationalState - - OperationalError - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - OperationalState: - - PhaseList - - CurrentPhase - - CountdownTime - - OperationalStateList - - OperationalState - - OperationalError - - GeneratedCommandList - - AcceptedCommandList - - AttributeList - - FeatureMap - - ClusterRevision - PowerSource: - - EndpointList - commands: - RVCRunMode: - - ChangeToMode - - ChangeToModeResponse - RVCCleanMode: - - ChangeToMode - - ChangeToModeResponse - RVCOperationalState: - - Pause - - Resume - - OperationalCommandResponse - OperationalState: - - Start - - Stop - - Pause - - Resume - - OperationalCommandResponse - command fields: - RVCRunMode: - ChangeToMode: - - newMode - ChangeToModeResponse: - - status - - statusText - RVCCleanMode: - ChangeToMode: - - newMode - ChangeToModeResponse: - - status - - statusText - RVCOperationalState: - OperationalCommandResponse: - - commandResponseState - OperationalState: - OperationalCommandResponse: - - commandResponseState - structs: - RVCOperationalState: - - OperationalStateStruct - - ErrorStateStruct - RVCRunMode: - - ModeTagStruct - - ModeOptionStruct - RVCCleanMode: - - ModeTagStruct - - ModeOptionStruct - OperationalState: - - OperationalStateStruct - - ErrorStateStruct - Thermostat: - - WeeklyScheduleTransitionStruct - struct fields: - RVCOperationalState: - OperationalStateStruct: - - operationalStateID - - operationalStateLabel - ErrorStateStruct: - - errorStateID - - errorStateLabel - - errorStateDetails - RVCRunMode: - ModeTagStruct: - - mfgCode - - value - ModeOptionStruct: - - label - - mode - - modeTags - RVCCleanMode: - ModeTagStruct: - - mfgCode - - value - ModeOptionStruct: - - label - - mode - - modeTags - OperationalState: - OperationalStateStruct: - - operationalStateID - - operationalStateLabel - ErrorStateStruct: - - errorStateID - - errorStateLabel - - errorStateDetails - Thermostat: - WeeklyScheduleTransitionStruct: - - transitionTime - - heatSetpoint - - coolSetpoint - events: - RVCOperationalState: - - OperationalError - - OperationCompletion - OperationalState: - - OperationalError - - OperationCompletion - event fields: - WiFiNetworkDiagnostics: - AssociationFailure: - - associationFailureCause - RVCOperationalState: - OperationalError: - - errorState - OperationCompletion: - - completionErrorCode - - totalOperationalTime - - pausedTime - OperationalState: - OperationalError: - - errorState - OperationCompletion: - - completionErrorCode - - totalOperationalTime - - pausedTime - enums: - ContentLauncher: - - StatusEnum - KeypadInput: - - CECKeyCodeEnum - ThermostatUserInterfaceConfiguration: - - KeypadLockoutEnum - - ScheduleProgrammingVisibilityEnum - - TemperatureDisplayModeEnum - RVCOperationalState: - - OperationalStateEnum - - ErrorStateEnum - RVCRunMode: - - ModeTag - - StatusCode - RVCCleanMode: - - ModeTag - - StatusCode - OperationalState: - - OperationalStateEnum - - ErrorStateEnum - Thermostat: - - ControlSequenceOfOperationEnum - - SetpointRaiseLowerModeEnum - enum values: - ContentLauncher: - StatusEnum: - - Success - - URLNotAvailable - - AuthFailed - FanControl: - FanModeSequenceEnum: - - OffHighAuto - - OffHigh - KeypadInput: - CECKeyCodeEnum: - - Select - - Up - - Down - - Left - - Right - - RightUp - - RightDown - - LeftUp - - LeftDown - - RootMenu - - SetupMenu - - ContentsMenu - - FavoriteMenu - - Exit - - MediaTopMenu - - MediaContextSensitiveMenu - - NumberEntryMode - - Number11 - - Number12 - - Number0OrNumber10 - - Numbers1 - - Numbers2 - - Numbers3 - - Numbers4 - - Numbers5 - - Numbers6 - - Numbers7 - - Numbers8 - - Numbers9 - - Dot - - Enter - - Clear - - NextFavorite - - ChannelUp - - ChannelDown - - PreviousChannel - - SoundSelect - - InputSelect - - DisplayInformation - - Help - - PageUp - - PageDown - - Power - - VolumeUp - - VolumeDown - - Mute - - Play - - Stop - - Pause - - Record - - Rewind - - FastForward - - Eject - - Forward - - Backward - - StopRecord - - PauseRecord - - Reserved - - Angle - - SubPicture - - VideoOnDemand - - ElectronicProgramGuide - - TimerProgramming - - InitialConfiguration - - SelectBroadcastType - - SelectSoundPresentation - - PlayFunction - - PausePlayFunction - - RecordFunction - - PauseRecordFunction - - StopFunction - - MuteFunction - - RestoreVolumeFunction - - TuneFunction - - SelectMediaFunction - - SelectAvInputFunction - - SelectAudioInputFunction - - PowerToggleFunction - - PowerOffFunction - - PowerOnFunction - - F1Blue - - F2Red - - F3Green - - F4Yellow - - F5 - - Data - ThermostatUserInterfaceConfiguration: - KeypadLockoutEnum: - - NoLockout - - Lockout1 - - Lockout2 - - Lockout3 - - Lockout4 - - Lockout5 - ScheduleProgrammingVisibilityEnum: - - ScheduleProgrammingPermitted - - ScheduleProgrammingDenied - TemperatureDisplayModeEnum: - - Celsius - - Fahrenheit - RVCOperationalState: - OperationalStateEnum: - - SeekingCharger - - Charging - - Docked - ErrorStateEnum: - - FailedToFindChargingDock - - Stuck - - DustBinMissing - - DustBinFull - - WaterTankEmpty - - WaterTankMissing - - WaterTankLidOpen - - MopCleaningPadMissing - RVCRunMode: - ModeTag: - - Idle - - Cleaning - StatusCode: - - Stuck - - DustBinMissing - - DustBinFull - - WaterTankEmpty - - WaterTankMissing - - WaterTankLidOpen - - MopCleaningPadMissing - - BatteryLow - RVCCleanMode: - ModeTag: - - DeepClean - - Vacuum - - Mop - StatusCode: - - CleaningInProgress - OperationalState: - OperationalStateEnum: - - Stopped - - Running - - Paused - - Error - ErrorStateEnum: - - NoError - - UnableToStartOrResume - - UnableToCompleteOperation - - CommandInvalidInState - Thermostat: - ControlSequenceOfOperationEnum: - - CoolingOnly - - CoolingWithReheat - - HeatingOnly - - HeatingWithReheat - - CoolingAndHeating - - CoolingAndHeatingWithReheat - SetpointRaiseLowerModeEnum: - - Heat - - Cool - - Both - bitmaps: - Scenes: - - CopyModeBitmap - AdministratorCommissioning: - - Feature - ContentLauncher: - - SupportedProtocolsBitmap - LevelControl: - - OptionsBitmap - RVCRunMode: - - Feature - RVCCleanMode: - - Feature - Thermostat: - - ScheduleDayOfWeekBitmap - - ScheduleModeBitmap - bitmap values: - PumpConfigurationAndControl: - PumpStatusBitmap: - - SupplyFault - Scenes: - CopyModeBitmap: - - CopyAllScenes - SoftwareDiagnostics: - Feature: - - Watermarks - AdministratorCommissioning: - Feature: - - Basic - ContentLauncher: - SupportedProtocolsBitmap: - - DASH - - HLS - LevelControl: - OptionsBitmap: - - ExecuteIfOff - - CoupleColorTempToLevel - Thermostat: - ScheduleDayOfWeekBitmap: - - Sunday - - Monday - - Tuesday - - Wednesday - - Thursday - - Friday - - Saturday - - Away - ScheduleModeBitmap: - - HeatSetpointPresent - - CoolSetpointPresent - deprecated: - structs: - Thermostat: - - ThermostatScheduleTransition - event fields: - WiFiNetworkDiagnostics: - AssociationFailure: - - associationFailure - enums: - ContentLauncher: - - ContentLaunchStatusEnum - KeypadInput: - - CecKeyCode - Thermostat: - - ThermostatControlSequence - - SetpointAdjustMode - enum values: - FanControl: - FanModeSequenceEnum: - - OffOnAuto - - OffOn - bitmaps: - Scenes: - - ScenesCopyMode - ContentLauncher: - - SupportedStreamingProtocol - LevelControl: - - LevelControlOptions - Thermostat: - - DayOfWeek - - ModeForSequence - bitmap values: - PumpConfigurationAndControl: - PumpStatusBitmap: - - Supplyfault - SoftwareDiagnostics: - Feature: - - WaterMarks - provisional: - clusters: - # Targeting Spring 2024 Matter release - - MicrowaveOvenControl - - MicrowaveOvenMode - - DemandResponseLoadControl - - BooleanStateConfiguration - - ValveConfigurationAndControl - - Timer - - OvenMode - - LaundryDryerControls - - EnergyEVSE - - OvenCavityOperationalState - - ContentControl - - ContentAppObserver - - DeviceEnergyManagement - - ElectricalEnergyMeasurement - - EnergyPreference - - ScenesManagement - attributes: - NetworkCommissioning: - # Targeting Spring 2024 Matter release - - SupportedWiFiBands - - SupportedThreadFeatures - - ThreadVersion - WakeOnLAN: - # Targeting Spring 2024 Matter release - - LinkLocalAddress - BasicInformation: - # Targeting Spring 2024 Matter release - - SpecificationVersion - - MaxPathsPerInvoke - Scenes: - # Targeting Spring 2024 Matter release - - FabricSceneInfo - MediaPlayback: - # Targeting Spring 2024 Matter release - - ActiveAudioTrack - - AvailableAudioTracks - - ActiveTextTrack - - AvailableTextTracks - commands: - GeneralDiagnostics: - # Targeting Spring 2024 Matter release - - TimeSnapshot - - TimeSnapshotResponse - NetworkCommissioning: - # Targeting Spring 2024 Matter release - - QueryIdentity - - QueryIdentityResponse - Channel: - # Targeting Spring 2024 Matter release - - GetProgramGuide - - ProgramGuideResponse - - RecordProgram - - CancelRecordProgram - MediaPlayback: - # Targeting Spring 2024 Matter release - - ActivateAudioTrack - - ActivateTextTrack - - DeactivateTextTrack - UnitTesting: - # Ideally none of UnitTesting would be exposed as public API, but - # for now just start doing that for new additions to it. - - TestBatchHelperResponse - - TestBatchHelperRequest - - TestSecondBatchHelperRequest - command fields: - NetworkCommissioning: - # Targeting Spring 2024 Matter release - AddOrUpdateWiFiNetwork: - - networkIdentity - - clientIdentifier - - possessionNonce - NetworkConfigResponse: - - clientIdentity - - possessionSignature - QueryIdentity: - - keyIdentifier - - possessionNonce - QueryIdentityResponse: - - identity - - possessionSignature - MediaPlayback: - # Targeting Spring 2024 Matter release - Rewind: - - audioAdvanceUnmuted - FastForward: - - audioAdvanceUnmuted - ContentLauncher: - # Targeting Spring 2024 Matter release - LaunchContent: - - playbackPreferences - - useCurrentContext - AccountLogin: - # Targeting Spring 2024 Matter release - Login: - - node - Logout: - - node - structs: - Scenes: - # Targeting Spring 2024 Matter release - - SceneInfoStruct - Channel: - # Targeting Spring 2024 Matter release - - ProgramStruct - - SeriesInfoStruct - - ProgramCategoryStruct - - ProgramCastStruct - - PageTokenStruct - - ChannelPagingStruct - - AdditionalInfoStruct - MediaPlayback: - # Targeting Spring 2024 Matter release - - TrackStruct - - TrackAttributesStruct - ContentLauncher: - # Targeting Spring 2024 Matter release - - PlaybackPreferencesStruct - - TrackPreferenceStruct - struct fields: - NetworkCommissioning: - # Targeting Spring 2024 Matter release - NetworkInfoStruct: - - networkIdentifier - - clientIdentifier - Channel: - # Targeting Spring 2024 Matter release - ChannelInfoStruct: - - identifier - - type - events: - MediaPlayback: - # Targeting Spring 2024 Matter release - - StateChanged - AccountLogin: - # Targeting Spring 2024 Matter release - - LoggedOut - TargetNavigator: - # Targeting Spring 2024 Matter release - - TargetUpdated - enums: - Thermostat: - # Targeting Spring 2024 Matter release - - StartOfWeekEnum - - TemperatureSetpointHoldEnum - - ACCapacityFormatEnum - - ACCompressorTypeEnum - - ACLouverPositionEnum - - ACRefrigerantTypeEnum - - ACTypeEnum - - SetpointChangeSourceEnum - Channel: - # Targeting Spring 2024 Matter release - - ChannelTypeEnum - MediaPlayback: - # Targeting Spring 2024 Matter release - - CharacteristicEnum - ContentLauncher: - # Targeting Spring 2024 Matter release - - CharacteristicEnum - enum values: - ContentLauncher: - # Targeting Spring 2024 Matter release - ParameterEnum: - - Season - - Episode - - Any - StatusEnum: - - TextTrackNotAvailable - - AudioTrackNotAvailable - TimeFormatLocalization: - CalendarTypeEnum: - - UseActiveLocale - HourFormatEnum: - - UseActiveLocale - bitmaps: - NetworkCommissioning: - # Targeting Spring 2024 Matter release - - ThreadCapabilitiesBitmap - Scenes: - # Targeting Spring 2024 Matter release - - NameSupportBitmap - Thermostat: - # Targeting Spring 2024 Matter release - - ACErrorCodeBitmap - - HVACSystemTypeBitmap - - ProgrammingOperationModeBitmap - - RelayStateBitmap - - RemoteSensingBitmap - Channel: - # Targeting Spring 2024 Matter release - - RecordingFlagBitmap - bitmap values: - OnOff: - Feature: - # Targeting Spring 2024 Matter release - - OffOnly - NetworkCommissioning: - # Targeting Spring 2024 Matter release - Feature: - - PerDeviceCredentials - WiFiSecurityBitmap: - - WPA3MatterPDC - Channel: - # Targeting Spring 2024 Matter release - Feature: - - ElectronicGuide - - RecordProgram - MediaPlayback: - # Targeting Spring 2024 Matter release - Feature: - - TextTracks - - AudioTracks - - AudioAdvance - ContentLauncher: - # Targeting Spring 2024 Matter release - SupportedProtocolsBitmap: - - WebRTC - Feature: - - AdvancedSeek - - TextTracks - - AudioTracks - renames: - structs: - Thermostat: - WeeklyScheduleTransitionStruct: ThermostatScheduleTransition - event fields: - WiFiNetworkDiagnostics: - AssociationFailure: - associationFailureCause: associationFailure - enums: - ContentLauncher: - StatusEnum: ContentLaunchStatusEnum - KeypadInput: - CECKeyCodeEnum: CecKeyCode - Thermostat: - ControlSequenceOfOperationEnum: ThermostatControlSequence - SetpointRaiseLowerModeEnum: SetpointAdjustMode - enum values: - ContentLauncher: - # The URLNotAvailable value got renamed at the same time - # as the enum. Record the rename here so that the old - # value name is generated for the old enum name. - ContentLaunchStatusEnum: - URLNotAvailable: UrlNotAvailable - FanControl: - FanModeSequenceEnum: - OffHighAuto: OffOnAuto - OffHigh: OffOn - # FanModeSequenceType is the old name of - # FanModeSequenceEnum; we need this rename annotation - # here so we don't lose the old values under that old - # name. - FanModeSequenceType: - OffHighAuto: OffOnAuto - OffHigh: OffOn - bitmaps: - Scenes: - CopyModeBitmap: ScenesCopyMode - ContentLauncher: - SupportedProtocolsBitmap: SupportedStreamingProtocol - LevelControl: - OptionsBitmap: LevelControlOptions - Thermostat: - ScheduleDayOfWeekBitmap: DayOfWeek - ScheduleModeBitmap: ModeForSequence - bitmap values: - PumpConfigurationAndControl: - PumpStatusBitmap: - SupplyFault: Supplyfault - SoftwareDiagnostics: - Feature: - Watermarks: WaterMarks - removed: - clusters: - # Should never have been exposed in the shape it was in, and now is - # getting renamed and getting a new cluster id, so just removing it - # seems like the most sensible thing. - - Scenes - enum values: - ContentLauncher: - # The URLNotAvailable value got renamed at the same time - # as the enum. The old enum name never had the new value name. - ContentLaunchStatusEnum: - - URLNotAvailable - -- release: "Future" - versions: "future" - provisional: - clusters: - # Targeting Spring 2024 Matter release - - EnergyEVSEMode - - DeviceEnergyManagementMode - - Messages - attributes: - DoorLock: - # Aliro is not ready yet. - - AliroReaderVerificationKey - - AliroReaderGroupIdentifier - - AliroReaderGroupSubIdentifier - - AliroExpeditedTransactionSupportedProtocolVersions - - AliroGroupResolvingKey - - AliroSupportedBLEUWBProtocolVersions - - AliroBLEAdvertisingVersion - - NumberOfAliroCredentialIssuerKeysSupported - - NumberOfAliroEndpointKeysSupported - ICDManagement: - # Targeting Spring 2024 Matter release - - OperatingMode - Thermostat: - # Targeting Spring 2024 Matter release - - PresetTypes - - ScheduleTypes - - NumberOfPresets - - NumberOfSchedules - - NumberOfScheduleTransitions - - NumberOfScheduleTransitionPerDay - - ActivePresetHandle - - Presets - - Schedules - - PresetsSchedulesEditable - - TemperatureSetpointHoldPolicy - - SetpointHoldExpiryTimestamp - - QueuedPreset - - ActiveScheduleHandle - UnitTesting: - # Ideally none of UnitTesting would be exposed as public API, but - # for now just start doing that for new additions to it. - - MeiInt8u - commands: - DoorLock: - # Aliro is not ready yet. - - SetAliroReaderConfig - - ClearAliroReaderConfig - Thermostat: - # Targeting Spring 2024 Matter release - - SetActiveScheduleRequest - - SetActivePresetRequest - - StartPresetsSchedulesEditRequest - - CancelPresetsSchedulesEditRequest - - CommitPresetsSchedulesRequest - - CancelSetActivePresetRequest - - SetTemperatureSetpointHoldPolicy - RVCOperationalState: - # Targeting Spring 2024 Matter release - - GoHome - UnitTesting: - # Ideally none of UnitTesting would be exposed as public API, but - # for now just start doing that for new additions to it. - - TestDifferentVendorMeiRequest - - TestDifferentVendorMeiResponse - structs: - Thermostat: - # Targeting Spring 2024 Matter release - - ScheduleTransitionStruct - - ScheduleStruct - - PresetStruct - - PresetTypeStruct - - ScheduleTypeStruct - - QueuedPresetStruct - events: - UnitTesting: - # Ideally none of UnitTesting would be exposed as public API, but - # for now just start doing that for new additions to it. - - TestDifferentVendorMeiEvent - enums: - Thermostat: - # Targeting Spring 2024 Matter release - - PresetScenarioEnum - enum values: - DoorLock: - CredentialTypeEnum: - # Aliro is not ready yet. - - AliroCredentialIssuerKey - - AliroEvictableEndpointKey - - AliroNonEvictableEndpointKey - LockDataTypeEnum: - # Aliro is not ready yet. - - AliroCredentialIssuerKey - - AliroEvictableEndpointKey - - AliroNonEvictableEndpointKey - OperationSourceEnum: - # Aliro is not ready yet. - - Aliro - RVCRunMode: - ModeTag: - # Targeting Spring 2024 Matter release - - Mapping - bitmaps: - Thermostat: - # Targeting Spring 2024 Matter release - - PresetTypeFeaturesBitmap - - ScheduleTypeFeaturesBitmap - - TemperatureSetpointHoldPolicyBitmap - bitmap values: - DoorLock: - Feature: - # Aliro is not ready yet. - - AliroProvisioning - - AliroBLEUWB - Thermostat: - Feature: - # Targeting Spring 2024 Matter release - - QueuedPresetsSupported - - Setpoints - - Presets - - MatterScheduleConfiguration diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/config-data.yaml b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/config-data.yaml index b45974c3596d0a..3db5f649040ae3 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/config-data.yaml +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/config-data.yaml @@ -30,7 +30,3 @@ MatterCastingClusters: - On/Off - Target Navigator - Wake on LAN - -# The commands currently implemented for Matter Casting in MCCommandObjects.h/mm. We will ZAP generate this file in the next PR. -MatterCastingImplementedCommands: - - LaunchURL diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/command_response_type.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/command_response_type.zapt new file mode 100644 index 00000000000000..25f7b42fe20c2b --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/command_response_type.zapt @@ -0,0 +1,5 @@ +{{#if command.hasSpecificResponse}} +MC{{asUpperCamelCase command.parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase command.responseName preserveAcronyms=true}}Params +{{else}} +MCNullObjectType +{{/if}} \ No newline at end of file diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/decode_value.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/decode_value.zapt index 2900ce04a0561d..36cc8a98b1a4d1 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/decode_value.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/decode_value.zapt @@ -30,9 +30,7 @@ {{#if_is_struct type}} {{target}} = [{{asObjectiveCClass type cluster forceNotList=true structTypePrefix="MC"}} new]; {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} {{>decode_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth) }} - {{/if}} {{/zcl_struct_items_by_struct_and_cluster_name}} {{else}} {{#if_is_strongly_typed_chip_enum type}} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/encode_value.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/encode_value.zapt new file mode 100644 index 00000000000000..6ee95bfddacfa1 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/encode_value.zapt @@ -0,0 +1,62 @@ +{{#if isOptional}} + if ({{source}} != nil) { + auto & definedValue_{{depth}} = {{target}}.Emplace(); + {{>encode_value target=(concat "definedValue_" depth) source=source cluster=cluster errorCode=errorCode depth=(incrementDepth depth) isOptional=false}} + } +{{else if isNullable}} + if ({{source}} == nil) { + {{target}}.SetNull(); + } else { + auto & nonNullValue_{{depth}} = {{target}}.SetNonNull(); + {{>encode_value target=(concat "nonNullValue_" depth) source=source cluster=cluster errorCode=errorCode depth=(incrementDepth depth) isNullable=false}} + } +{{else if isArray}} + {{! TODO: This is not great, with its fallible allocation and + whatnot. Maybe we should just switch to encoding our ObjC types + directly to TLV... We need the listFreer thing because we want + our allocation to live long enough, and if it's scoped to where + we are right now it may not (e.g. for a nullable list we're + inside an "else" block here). }} + { + using ListType_{{depth}} = std::remove_reference_t; + using ListMemberType_{{depth}} = ListMemberTypeGetter::Type; + if ({{source}}.count != 0) { + auto * listHolder_{{depth}} = new ListHolder({{source}}.count); + if (listHolder_{{depth}} == nullptr || listHolder_{{depth}}->mList == nullptr) { + {{errorCode}} + } + listFreer.add(listHolder_{{depth}}); + for (size_t i_{{depth}} = 0; i_{{depth}} < {{source}}.count; ++i_{{depth}}) { + if ( ! [{{source}}[i_{{depth}}] isKindOfClass: [{{asObjectiveCClass type cluster forceNotList=true structTypePrefix="MC"}} class]] ) { + // Wrong kind of value. + {{errorCode}} + } + auto element_{{depth}} = ({{asObjectiveCClass type cluster forceNotList=true structTypePrefix="MC"}} *){{source}}[i_{{depth}}]; + {{>encode_value target=(concat "listHolder_" depth "->mList[i_" depth "]") source=(concat "element_" depth) cluster=cluster errorCode=errorCode depth=(incrementDepth depth) isArray=false}} + } + {{target}} = ListType_{{depth}}(listHolder_{{depth}}->mList, {{source}}.count); + } else { + {{target}} = ListType_{{depth}}(); + } + } +{{else if (isOctetString type)}} + {{target}} = AsByteSpan({{source}}); +{{else if (isCharString type)}} + {{target}} = AsCharSpan({{source}}); +{{else}} + {{#if_is_struct type}} + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + {{>encode_value target=(concat ../target "." (asLowerCamelCase label)) source=(concat ../source "." (asStructPropertyName label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth)}} + {{/zcl_struct_items_by_struct_and_cluster_name}} + {{else}} + {{#if_is_strongly_typed_chip_enum type}} + {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); + {{else}} + {{#if_is_strongly_typed_bitmap type}} + {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); + {{else}} + {{target}} = {{source}}.{{asObjectiveCNumberType source type true}}Value; + {{/if_is_strongly_typed_bitmap}} + {{/if_is_strongly_typed_chip_enum}} + {{/if_is_struct}} +{{/if}} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/init_struct_member.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/init_struct_member.zapt new file mode 100644 index 00000000000000..001cac7231e12a --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/init_struct_member.zapt @@ -0,0 +1,19 @@ +{{#*inline "memberName"}}_{{asStructPropertyName label}}{{/inline}} +{{#if isOptional}} +{{>memberName}} = nil; +{{else if isNullable}} +{{>memberName}} = nil; +{{else if isArray}} + {{>memberName}} = [NSArray array]; +{{else if (isOctetString type)}} + {{>memberName}} = [NSData data]; +{{else if (isCharString type)}} + {{>memberName}} = @""; +{{else}} + {{! Our memberName inline partial won't work inside the async if_is_struct }} + {{#if_is_struct type}} + _{{asStructPropertyName label}} = [{{asObjectiveCClass type cluster structTypePrefix="MC"}} new]; + {{else}} + _{{asStructPropertyName label}} = @(0); + {{/if_is_struct}} +{{/if}} \ No newline at end of file diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/renamed_struct_field_impl.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/renamed_struct_field_impl.zapt new file mode 100644 index 00000000000000..0b2650a91fb672 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/renamed_struct_field_impl.zapt @@ -0,0 +1,9 @@ +- (void)set{{asUpperCamelCase oldName}}:({{asObjectiveCType type cluster structTypePrefix="MC"}}){{asStructPropertyName oldName}} +{ + self.{{asStructPropertyName newName}} = {{asStructPropertyName oldName}}; +} + +- ({{asObjectiveCType type cluster structTypePrefix="MC"}}){{asGetterName oldName}} +{ + return self.{{asStructPropertyName newName}}; +} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/struct_field_decl.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/struct_field_decl.zapt new file mode 100644 index 00000000000000..19fa66c2623844 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/struct_field_decl.zapt @@ -0,0 +1,3 @@ +{{! Override the getter name because some of our properties start with things + like "new" or "init" }} +@property (nonatomic, copy{{#unless (isStrEqual (asGetterName label) (asStructPropertyName label))}}, getter={{asGetterName label}}{{/unless}}) {{asObjectiveCType type cluster structTypePrefix="MC"}} {{asStructPropertyName label}} {{! Caller provides availability~}} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/templates.json b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/templates.json index 881ac388a1be83..5eedab0c5ef5b8 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/templates.json +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/templates.json @@ -1,5 +1,5 @@ { - "name": "Framework templates", + "name": "tv-casting-app darwin templates", "version": "chip-v1", "helpers": [ "partials/helper.js", @@ -11,7 +11,6 @@ "darwin/Framework/CHIP/templates/helper.js" ], "resources": { - "availability-data": "availability.yaml", "config-data": "config-data.yaml" }, "override": "../../../../../../src/app/zap-templates/common/override.js", @@ -20,31 +19,71 @@ "name": "header", "path": "../../../../../../src/app/zap-templates/partials/header.zapt" }, + { + "name": "command_response_type", + "path": "partials/command_response_type.zapt" + }, { "name": "decode_value", "path": "partials/decode_value.zapt" + }, + { + "name": "encode_value", + "path": "partials/encode_value.zapt" + }, + { + "name": "init_struct_member", + "path": "partials/init_struct_member.zapt" + }, + { + "name": "renamed_struct_field_impl", + "path": "partials/renamed_struct_field_impl.zapt" + }, + { + "name": "struct_field_decl", + "path": "partials/struct_field_decl.zapt" } ], "templates": [ { "path": "MCAttributeObjects.zapt", - "name": "Objc ZCL asynchronous API Internal Header", + "name": "Objc MC attribute objects header", "output": "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h" }, { "path": "MCAttributeObjects-src.zapt", - "name": "Objc ZCL asynchronous API Internal Header", + "name": "Objc MC attribute objects", "output": "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.mm" }, { "path": "MCClusterObjects.zapt", - "name": "Objc ZCL asynchronous API Internal Header", + "name": "Objc MC cluster objects header", "output": "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h" }, { "path": "MCClusterObjects-src.zapt", - "name": "Objc ZCL asynchronous API Internal Header", + "name": "Objc MC cluster objects", "output": "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.mm" + }, + { + "path": "MCCommandObjects.zapt", + "name": "Objc MC command objects header", + "output": "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h" + }, + { + "path": "MCCommandObjects-src.zapt", + "name": "Objc MC command objects", + "output": "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.mm" + }, + { + "path": "MCCommandPayloads.zapt", + "name": "Objc reflections of MC command payloads header", + "output": "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h" + }, + { + "path": "MCCommandPayloads-src.zapt", + "name": "Objc reflections of MC command payloads", + "output": "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm" } ] } diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h index 81184fe023ffcb..d11580a6e82bc3 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h @@ -17,7 +17,7 @@ // THIS FILE IS GENERATED BY ZAP -#import "MCStructsObjc.h" +#import "MCInteractionModelStructs.h" #import "../MCAttribute.h" #import diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.mm index e5191ee0bbaba7..fc563f52649d95 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.mm @@ -68,7 +68,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::OnOff::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithBool:_cppValue]; @@ -115,7 +114,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::GlobalSceneControl::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithBool:_cppValue]; @@ -162,7 +160,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::OnTime::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -209,7 +206,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::OffWaitTime::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -256,7 +252,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::StartUpOnOff::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -307,7 +302,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -369,7 +363,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -431,7 +424,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -493,7 +485,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -555,7 +546,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -602,7 +592,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -651,7 +640,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::CurrentLevel::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -702,7 +690,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::RemainingTime::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -749,7 +736,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::MinLevel::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedChar:_cppValue]; @@ -796,7 +782,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::MaxLevel::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedChar:_cppValue]; @@ -843,7 +828,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::CurrentFrequency::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -890,7 +874,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::MinFrequency::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -937,7 +920,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::MaxFrequency::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -984,7 +966,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::Options::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedChar:_cppValue.Raw()]; @@ -1031,7 +1012,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::OnOffTransitionTime::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -1078,7 +1058,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::OnLevel::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -1129,7 +1108,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::OnTransitionTime::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -1180,7 +1158,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::OffTransitionTime::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -1231,7 +1208,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::DefaultMoveRate::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -1282,7 +1258,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::StartUpCurrentLevel::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -1333,7 +1308,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -1395,7 +1369,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -1457,7 +1430,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -1519,7 +1491,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -1581,7 +1552,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -1628,7 +1598,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -1677,7 +1646,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::WakeOnLan::Attributes::MACAddress::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSString * _Nonnull value; value = AsString(_cppValue); @@ -1729,7 +1697,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::WakeOnLan::Attributes::LinkLocalAddress::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSData * _Nonnull value; value = AsData(_cppValue); @@ -1776,7 +1743,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::WakeOnLan::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -1838,7 +1804,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::WakeOnLan::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -1900,7 +1865,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::WakeOnLan::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -1962,7 +1926,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::WakeOnLan::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -2024,7 +1987,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::WakeOnLan::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -2071,7 +2033,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::WakeOnLan::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -2120,7 +2081,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::TargetNavigator::Attributes::TargetList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -2189,7 +2149,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::TargetNavigator::Attributes::CurrentTarget::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedChar:_cppValue]; @@ -2236,7 +2195,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::TargetNavigator::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -2298,7 +2256,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::TargetNavigator::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -2360,7 +2317,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::TargetNavigator::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -2422,7 +2378,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::TargetNavigator::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -2484,7 +2439,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::TargetNavigator::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -2531,7 +2485,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::TargetNavigator::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -2580,7 +2533,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::CurrentState::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedChar:chip::to_underlying(_cppValue)]; @@ -2627,7 +2579,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::StartTime::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -2678,7 +2629,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::Duration::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -2729,7 +2679,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::SampledPosition::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; MCMediaPlaybackClusterPlaybackPositionStruct * _Nullable value; if (_cppValue.IsNull()) { @@ -2786,7 +2735,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithFloat:_cppValue]; @@ -2833,7 +2781,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -2884,7 +2831,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -2935,7 +2881,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::ActiveAudioTrack::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; MCMediaPlaybackClusterTrackStruct * _Nullable value; if (_cppValue.IsNull()) { @@ -3017,7 +2962,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::AvailableAudioTracks::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nullable value; if (_cppValue.IsNull()) { @@ -3114,7 +3058,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::ActiveTextTrack::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; MCMediaPlaybackClusterTrackStruct * _Nullable value; if (_cppValue.IsNull()) { @@ -3196,7 +3139,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::AvailableTextTracks::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nullable value; if (_cppValue.IsNull()) { @@ -3293,7 +3235,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -3355,7 +3296,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -3417,7 +3357,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -3479,7 +3418,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -3541,7 +3479,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -3588,7 +3525,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -3637,7 +3573,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::KeypadInput::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -3699,7 +3634,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::KeypadInput::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -3761,7 +3695,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::KeypadInput::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -3823,7 +3756,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::KeypadInput::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -3885,7 +3817,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::KeypadInput::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -3932,7 +3863,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::KeypadInput::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -3981,7 +3911,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ContentLauncher::Attributes::AcceptHeader::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4048,7 +3977,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue.Raw()]; @@ -4095,7 +4023,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ContentLauncher::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4157,7 +4084,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ContentLauncher::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4219,7 +4145,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ContentLauncher::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4281,7 +4206,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ContentLauncher::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4343,7 +4267,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ContentLauncher::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -4390,7 +4313,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ContentLauncher::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -4439,7 +4361,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationLauncher::Attributes::CatalogList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4501,7 +4422,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationLauncher::Attributes::CurrentApp::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; MCApplicationLauncherClusterApplicationEPStruct * _Nullable value; if (_cppValue.IsNull()) { @@ -4565,7 +4485,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationLauncher::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4627,7 +4546,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationLauncher::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4689,7 +4607,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationLauncher::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4751,7 +4668,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationLauncher::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4813,7 +4729,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationLauncher::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -4860,7 +4775,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationLauncher::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -4909,7 +4823,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSString * _Nonnull value; value = AsString(_cppValue); @@ -4961,7 +4874,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::VendorID::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:chip::to_underlying(_cppValue)]; @@ -5008,7 +4920,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSString * _Nonnull value; value = AsString(_cppValue); @@ -5060,7 +4971,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::ProductID::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -5107,7 +5017,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::Application::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; MCApplicationBasicClusterApplicationStruct * _Nonnull value; value = [MCApplicationBasicClusterApplicationStruct new]; @@ -5161,7 +5070,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::Status::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedChar:chip::to_underlying(_cppValue)]; @@ -5208,7 +5116,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSString * _Nonnull value; value = AsString(_cppValue); @@ -5260,7 +5167,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::AllowedVendorList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -5322,7 +5228,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -5384,7 +5289,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -5446,7 +5350,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -5508,7 +5411,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -5570,7 +5472,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -5617,7 +5518,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h index 683de5283682cd..12a3d8d3bf59af 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h @@ -18,8 +18,8 @@ // THIS FILE IS GENERATED BY ZAP #import "../MCCluster.h" -#import "../MCCommandObjects.h" #import "MCAttributeObjects.h" +#import "MCCommandObjects.h" #import #ifndef MCClusterObjects_h @@ -31,6 +31,36 @@ // OnOff cluster commands: +/** + * @brief Returns non-nil pointer to MCOnOffClusterOffCommand if supported, nil otherwise. + */ +- (MCOnOffClusterOffCommand * _Nullable)offCommand; + +/** + * @brief Returns non-nil pointer to MCOnOffClusterOnCommand if supported, nil otherwise. + */ +- (MCOnOffClusterOnCommand * _Nullable)onCommand; + +/** + * @brief Returns non-nil pointer to MCOnOffClusterToggleCommand if supported, nil otherwise. + */ +- (MCOnOffClusterToggleCommand * _Nullable)toggleCommand; + +/** + * @brief Returns non-nil pointer to MCOnOffClusterOffWithEffectCommand if supported, nil otherwise. + */ +- (MCOnOffClusterOffWithEffectCommand * _Nullable)offWithEffectCommand; + +/** + * @brief Returns non-nil pointer to MCOnOffClusterOnWithRecallGlobalSceneCommand if supported, nil otherwise. + */ +- (MCOnOffClusterOnWithRecallGlobalSceneCommand * _Nullable)onWithRecallGlobalSceneCommand; + +/** + * @brief Returns non-nil pointer to MCOnOffClusterOnWithTimedOffCommand if supported, nil otherwise. + */ +- (MCOnOffClusterOnWithTimedOffCommand * _Nullable)onWithTimedOffCommand; + // OnOff cluster attributes: /** @@ -95,6 +125,51 @@ // LevelControl cluster commands: +/** + * @brief Returns non-nil pointer to MCLevelControlClusterMoveToLevelCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterMoveToLevelCommand * _Nullable)moveToLevelCommand; + +/** + * @brief Returns non-nil pointer to MCLevelControlClusterMoveCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterMoveCommand * _Nullable)moveCommand; + +/** + * @brief Returns non-nil pointer to MCLevelControlClusterStepCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterStepCommand * _Nullable)stepCommand; + +/** + * @brief Returns non-nil pointer to MCLevelControlClusterStopCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterStopCommand * _Nullable)stopCommand; + +/** + * @brief Returns non-nil pointer to MCLevelControlClusterMoveToLevelWithOnOffCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterMoveToLevelWithOnOffCommand * _Nullable)moveToLevelWithOnOffCommand; + +/** + * @brief Returns non-nil pointer to MCLevelControlClusterMoveWithOnOffCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterMoveWithOnOffCommand * _Nullable)moveWithOnOffCommand; + +/** + * @brief Returns non-nil pointer to MCLevelControlClusterStepWithOnOffCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterStepWithOnOffCommand * _Nullable)stepWithOnOffCommand; + +/** + * @brief Returns non-nil pointer to MCLevelControlClusterStopWithOnOffCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterStopWithOnOffCommand * _Nullable)stopWithOnOffCommand; + +/** + * @brief Returns non-nil pointer to MCLevelControlClusterMoveToClosestFrequencyCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterMoveToClosestFrequencyCommand * _Nullable)moveToClosestFrequencyCommand; + // LevelControl cluster attributes: /** @@ -253,6 +328,11 @@ // TargetNavigator cluster commands: +/** + * @brief Returns non-nil pointer to MCTargetNavigatorClusterNavigateTargetCommand if supported, nil otherwise. + */ +- (MCTargetNavigatorClusterNavigateTargetCommand * _Nullable)navigateTargetCommand; + // TargetNavigator cluster attributes: /** @@ -302,6 +382,76 @@ // MediaPlayback cluster commands: +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterPlayCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterPlayCommand * _Nullable)playCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterPauseCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterPauseCommand * _Nullable)pauseCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterStopCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterStopCommand * _Nullable)stopCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterStartOverCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterStartOverCommand * _Nullable)startOverCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterPreviousCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterPreviousCommand * _Nullable)previousCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterNextCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterNextCommand * _Nullable)nextCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterRewindCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterRewindCommand * _Nullable)rewindCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterFastForwardCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterFastForwardCommand * _Nullable)fastForwardCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterSkipForwardCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterSkipForwardCommand * _Nullable)skipForwardCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterSkipBackwardCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterSkipBackwardCommand * _Nullable)skipBackwardCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterSeekCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterSeekCommand * _Nullable)seekCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterActivateAudioTrackCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterActivateAudioTrackCommand * _Nullable)activateAudioTrackCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterActivateTextTrackCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterActivateTextTrackCommand * _Nullable)activateTextTrackCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterDeactivateTextTrackCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterDeactivateTextTrackCommand * _Nullable)deactivateTextTrackCommand; + // MediaPlayback cluster attributes: /** @@ -396,6 +546,11 @@ // KeypadInput cluster commands: +/** + * @brief Returns non-nil pointer to MCKeypadInputClusterSendKeyCommand if supported, nil otherwise. + */ +- (MCKeypadInputClusterSendKeyCommand * _Nullable)sendKeyCommand; + // KeypadInput cluster attributes: /** @@ -435,6 +590,11 @@ // ContentLauncher cluster commands: +/** + * @brief Returns non-nil pointer to MCContentLauncherClusterLaunchContentCommand if supported, nil otherwise. + */ +- (MCContentLauncherClusterLaunchContentCommand * _Nullable)launchContentCommand; + /** * @brief Returns non-nil pointer to MCContentLauncherClusterLaunchURLCommand if supported, nil otherwise. */ @@ -489,6 +649,21 @@ // ApplicationLauncher cluster commands: +/** + * @brief Returns non-nil pointer to MCApplicationLauncherClusterLaunchAppCommand if supported, nil otherwise. + */ +- (MCApplicationLauncherClusterLaunchAppCommand * _Nullable)launchAppCommand; + +/** + * @brief Returns non-nil pointer to MCApplicationLauncherClusterStopAppCommand if supported, nil otherwise. + */ +- (MCApplicationLauncherClusterStopAppCommand * _Nullable)stopAppCommand; + +/** + * @brief Returns non-nil pointer to MCApplicationLauncherClusterHideAppCommand if supported, nil otherwise. + */ +- (MCApplicationLauncherClusterHideAppCommand * _Nullable)hideAppCommand; + // ApplicationLauncher cluster attributes: /** diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.mm index c7fb3697d67885..8c51871a2c985b 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.mm @@ -35,6 +35,42 @@ @implementation MCOnOffCluster // OnOff cluster commands: +- (id)offCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::OnOff::Commands::Off::Id); + return cppCommand != nil ? [[MCOnOffClusterOffCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)onCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::OnOff::Commands::On::Id); + return cppCommand != nil ? [[MCOnOffClusterOnCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)toggleCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::OnOff::Commands::Toggle::Id); + return cppCommand != nil ? [[MCOnOffClusterToggleCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)offWithEffectCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::OnOff::Commands::OffWithEffect::Id); + return cppCommand != nil ? [[MCOnOffClusterOffWithEffectCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)onWithRecallGlobalSceneCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Id); + return cppCommand != nil ? [[MCOnOffClusterOnWithRecallGlobalSceneCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)onWithTimedOffCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Id); + return cppCommand != nil ? [[MCOnOffClusterOnWithTimedOffCommand alloc] initWithCppCommand:cppCommand] : nil; +} + // OnOff cluster attributes: - (id)onOffAttribute @@ -110,6 +146,60 @@ @implementation MCLevelControlCluster // LevelControl cluster commands: +- (id)moveToLevelCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::MoveToLevel::Id); + return cppCommand != nil ? [[MCLevelControlClusterMoveToLevelCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)moveCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::Move::Id); + return cppCommand != nil ? [[MCLevelControlClusterMoveCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)stepCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::Step::Id); + return cppCommand != nil ? [[MCLevelControlClusterStepCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)stopCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::Stop::Id); + return cppCommand != nil ? [[MCLevelControlClusterStopCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)moveToLevelWithOnOffCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Id); + return cppCommand != nil ? [[MCLevelControlClusterMoveToLevelWithOnOffCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)moveWithOnOffCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::Id); + return cppCommand != nil ? [[MCLevelControlClusterMoveWithOnOffCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)stepWithOnOffCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Id); + return cppCommand != nil ? [[MCLevelControlClusterStepWithOnOffCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)stopWithOnOffCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::StopWithOnOff::Id); + return cppCommand != nil ? [[MCLevelControlClusterStopWithOnOffCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)moveToClosestFrequencyCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::MoveToClosestFrequency::Id); + return cppCommand != nil ? [[MCLevelControlClusterMoveToClosestFrequencyCommand alloc] initWithCppCommand:cppCommand] : nil; +} + // LevelControl cluster attributes: - (id)currentLevelAttribute @@ -296,6 +386,12 @@ @implementation MCTargetNavigatorCluster // TargetNavigator cluster commands: +- (id)navigateTargetCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Id); + return cppCommand != nil ? [[MCTargetNavigatorClusterNavigateTargetCommand alloc] initWithCppCommand:cppCommand] : nil; +} + // TargetNavigator cluster attributes: - (id)targetListAttribute @@ -353,6 +449,90 @@ @implementation MCMediaPlaybackCluster // MediaPlayback cluster commands: +- (id)playCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::Play::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterPlayCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)pauseCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::Pause::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterPauseCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)stopCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::Stop::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterStopCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)startOverCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::StartOver::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterStartOverCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)previousCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::Previous::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterPreviousCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)nextCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::Next::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterNextCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)rewindCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::Rewind::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterRewindCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)fastForwardCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::FastForward::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterFastForwardCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)skipForwardCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::SkipForward::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterSkipForwardCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)skipBackwardCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::SkipBackward::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterSkipBackwardCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)seekCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::Seek::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterSeekCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)activateAudioTrackCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::ActivateAudioTrack::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterActivateAudioTrackCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)activateTextTrackCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::ActivateTextTrack::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterActivateTextTrackCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)deactivateTextTrackCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::DeactivateTextTrack::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterDeactivateTextTrackCommand alloc] initWithCppCommand:cppCommand] : nil; +} + // MediaPlayback cluster attributes: - (id)currentStateAttribute @@ -464,6 +644,12 @@ @implementation MCKeypadInputCluster // KeypadInput cluster commands: +- (id)sendKeyCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::KeypadInput::Commands::SendKey::Id); + return cppCommand != nil ? [[MCKeypadInputClusterSendKeyCommand alloc] initWithCppCommand:cppCommand] : nil; +} + // KeypadInput cluster attributes: - (id)generatedCommandListAttribute @@ -509,6 +695,12 @@ @implementation MCContentLauncherCluster // ContentLauncher cluster commands: +- (id)launchContentCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Id); + return cppCommand != nil ? [[MCContentLauncherClusterLaunchContentCommand alloc] initWithCppCommand:cppCommand] : nil; +} + - (id)launchURLCommand { void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Id); @@ -572,6 +764,24 @@ @implementation MCApplicationLauncherCluster // ApplicationLauncher cluster commands: +- (id)launchAppCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Id); + return cppCommand != nil ? [[MCApplicationLauncherClusterLaunchAppCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)stopAppCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Id); + return cppCommand != nil ? [[MCApplicationLauncherClusterStopAppCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)hideAppCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Id); + return cppCommand != nil ? [[MCApplicationLauncherClusterHideAppCommand alloc] initWithCppCommand:cppCommand] : nil; +} + // ApplicationLauncher cluster attributes: - (id)catalogListAttribute diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h new file mode 100644 index 00000000000000..4ca2694a3a6ba6 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h @@ -0,0 +1,156 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// THIS FILE IS GENERATED BY ZAP + +#import "../MCCommand.h" +#import "MCCommandPayloads.h" +#import + +#ifndef MCCommandObjects_h +#define MCCommandObjects_h + +@interface MCNullObjectType : NSObject +@end + +// OnOff cluster: + +@interface MCOnOffClusterOffCommand : MCCommand +@end + +@interface MCOnOffClusterOnCommand : MCCommand +@end + +@interface MCOnOffClusterToggleCommand : MCCommand +@end + +@interface MCOnOffClusterOffWithEffectCommand : MCCommand +@end + +@interface MCOnOffClusterOnWithRecallGlobalSceneCommand : MCCommand +@end + +@interface MCOnOffClusterOnWithTimedOffCommand : MCCommand +@end + +// LevelControl cluster: + +@interface MCLevelControlClusterMoveToLevelCommand : MCCommand +@end + +@interface MCLevelControlClusterMoveCommand : MCCommand +@end + +@interface MCLevelControlClusterStepCommand : MCCommand +@end + +@interface MCLevelControlClusterStopCommand : MCCommand +@end + +@interface MCLevelControlClusterMoveToLevelWithOnOffCommand : MCCommand +@end + +@interface MCLevelControlClusterMoveWithOnOffCommand : MCCommand +@end + +@interface MCLevelControlClusterStepWithOnOffCommand : MCCommand +@end + +@interface MCLevelControlClusterStopWithOnOffCommand : MCCommand +@end + +@interface MCLevelControlClusterMoveToClosestFrequencyCommand : MCCommand +@end + +// WakeOnLan cluster: + +// TargetNavigator cluster: + +@interface MCTargetNavigatorClusterNavigateTargetCommand : MCCommand +@end + +// MediaPlayback cluster: + +@interface MCMediaPlaybackClusterPlayCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterPauseCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterStopCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterStartOverCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterPreviousCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterNextCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterRewindCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterFastForwardCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterSkipForwardCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterSkipBackwardCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterSeekCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterActivateAudioTrackCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterActivateTextTrackCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterDeactivateTextTrackCommand : MCCommand +@end + +// KeypadInput cluster: + +@interface MCKeypadInputClusterSendKeyCommand : MCCommand +@end + +// ContentLauncher cluster: + +@interface MCContentLauncherClusterLaunchContentCommand : MCCommand +@end + +@interface MCContentLauncherClusterLaunchURLCommand : MCCommand +@end + +// ApplicationLauncher cluster: + +@interface MCApplicationLauncherClusterLaunchAppCommand : MCCommand +@end + +@interface MCApplicationLauncherClusterStopAppCommand : MCCommand +@end + +@interface MCApplicationLauncherClusterHideAppCommand : MCCommand +@end + +// ApplicationBasic cluster: + +#endif /* MCCommandObjects_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.mm new file mode 100644 index 00000000000000..7c259ca8b49817 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.mm @@ -0,0 +1,1928 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// THIS FILE IS GENERATED BY ZAP + +#import "MCCommandObjects.h" +#import "MCCommandPayloads.h" +#import "MCCommandPayloads_internal.h" + +#import "../MCCastingApp.h" +#import "../MCCommand_Internal.h" +#import "../MCErrorUtils.h" + +#include "core/Command.h" +#include + +#import + +@implementation MCNullObjectType +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + return CHIP_NO_ERROR; +} +@end + +// OnOff cluster: + +@implementation MCOnOffClusterOffCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCOnOffClusterOffParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterOffCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCOnOffClusterOnCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCOnOffClusterOnParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterOnCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCOnOffClusterToggleCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCOnOffClusterToggleParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterToggleCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCOnOffClusterOffWithEffectCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCOnOffClusterOffWithEffectParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterOffWithEffectCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCOnOffClusterOnWithRecallGlobalSceneCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCOnOffClusterOnWithRecallGlobalSceneParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterOnWithRecallGlobalSceneCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCOnOffClusterOnWithTimedOffCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCOnOffClusterOnWithTimedOffParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterOnWithTimedOffCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +// LevelControl cluster: + +@implementation MCLevelControlClusterMoveToLevelCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterMoveToLevelParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterMoveToLevelCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCLevelControlClusterMoveCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterMoveParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterMoveCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCLevelControlClusterStepCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterStepParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterStepCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCLevelControlClusterStopCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterStopParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterStopCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCLevelControlClusterMoveToLevelWithOnOffCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterMoveToLevelWithOnOffParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterMoveToLevelWithOnOffCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCLevelControlClusterMoveWithOnOffCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterMoveWithOnOffParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterMoveWithOnOffCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCLevelControlClusterStepWithOnOffCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterStepWithOnOffParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterStepWithOnOffCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCLevelControlClusterStopWithOnOffCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterStopWithOnOffParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterStopWithOnOffCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCLevelControlClusterMoveToClosestFrequencyCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterMoveToClosestFrequencyParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterMoveToClosestFrequencyCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +// WakeOnLan cluster: + +// TargetNavigator cluster: + +@implementation MCTargetNavigatorClusterNavigateTargetCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCTargetNavigatorClusterNavigateTargetParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCTargetNavigatorClusterNavigateTargetResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCTargetNavigatorClusterNavigateTargetResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCTargetNavigatorClusterNavigateTargetCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +// MediaPlayback cluster: + +@implementation MCMediaPlaybackClusterPlayCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterPlayParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterPlayCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterPauseCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterPauseParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterPauseCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterStopCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterStopParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterStopCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterStartOverCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterStartOverParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterStartOverCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterPreviousCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterPreviousParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterPreviousCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterNextCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterNextParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterNextCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterRewindCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterRewindParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterRewindCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterFastForwardCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterFastForwardParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterFastForwardCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterSkipForwardCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterSkipForwardParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterSkipForwardCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterSkipBackwardCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterSkipBackwardParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterSkipBackwardCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterSeekCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterSeekParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterSeekCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterActivateAudioTrackCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterActivateAudioTrackParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterActivateAudioTrackCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterActivateTextTrackCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterActivateTextTrackParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterActivateTextTrackCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterDeactivateTextTrackCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterDeactivateTextTrackParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterDeactivateTextTrackCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +// KeypadInput cluster: + +@implementation MCKeypadInputClusterSendKeyCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCKeypadInputClusterSendKeyParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCKeypadInputClusterSendKeyResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCKeypadInputClusterSendKeyResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCKeypadInputClusterSendKeyCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +// ContentLauncher cluster: + +@implementation MCContentLauncherClusterLaunchContentCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCContentLauncherClusterLaunchContentParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCContentLauncherClusterLauncherResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCContentLauncherClusterLauncherResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCContentLauncherClusterLaunchContentCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCContentLauncherClusterLaunchURLCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCContentLauncherClusterLaunchURLParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCContentLauncherClusterLauncherResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCContentLauncherClusterLauncherResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCContentLauncherClusterLaunchURLCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +// ApplicationLauncher cluster: + +@implementation MCApplicationLauncherClusterLaunchAppCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCApplicationLauncherClusterLaunchAppParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCApplicationLauncherClusterLauncherResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCApplicationLauncherClusterLauncherResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCApplicationLauncherClusterLaunchAppCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCApplicationLauncherClusterStopAppCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCApplicationLauncherClusterStopAppParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCApplicationLauncherClusterLauncherResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCApplicationLauncherClusterLauncherResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCApplicationLauncherClusterStopAppCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCApplicationLauncherClusterHideAppCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCApplicationLauncherClusterHideAppParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCApplicationLauncherClusterLauncherResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + objCResponse = [[MCApplicationLauncherClusterLauncherResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:cppResponse]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCApplicationLauncherClusterHideAppCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +// ApplicationBasic cluster: diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h new file mode 100644 index 00000000000000..367bfc35906575 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h @@ -0,0 +1,236 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// THIS FILE IS GENERATED BY ZAP + +#import "MCInteractionModelStructs.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface MCAbstractPayload : NSObject +@end + +// OnOff cluster: + +@interface MCOnOffClusterOffParams : MCAbstractPayload +@end + +@interface MCOnOffClusterOnParams : MCAbstractPayload +@end + +@interface MCOnOffClusterToggleParams : MCAbstractPayload +@end + +@interface MCOnOffClusterOffWithEffectParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull effectIdentifier; +@property (nonatomic, copy) NSNumber * _Nonnull effectVariant; +@end + +@interface MCOnOffClusterOnWithRecallGlobalSceneParams : MCAbstractPayload +@end + +@interface MCOnOffClusterOnWithTimedOffParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull onOffControl; +@property (nonatomic, copy) NSNumber * _Nonnull onTime; +@property (nonatomic, copy) NSNumber * _Nonnull offWaitTime; +@end + +// LevelControl cluster: + +@interface MCLevelControlClusterMoveToLevelParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull level; +@property (nonatomic, copy) NSNumber * _Nullable transitionTime; +@property (nonatomic, copy) NSNumber * _Nonnull optionsMask; +@property (nonatomic, copy) NSNumber * _Nonnull optionsOverride; +@end + +@interface MCLevelControlClusterMoveParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull moveMode; +@property (nonatomic, copy) NSNumber * _Nullable rate; +@property (nonatomic, copy) NSNumber * _Nonnull optionsMask; +@property (nonatomic, copy) NSNumber * _Nonnull optionsOverride; +@end + +@interface MCLevelControlClusterStepParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull stepMode; +@property (nonatomic, copy) NSNumber * _Nonnull stepSize; +@property (nonatomic, copy) NSNumber * _Nullable transitionTime; +@property (nonatomic, copy) NSNumber * _Nonnull optionsMask; +@property (nonatomic, copy) NSNumber * _Nonnull optionsOverride; +@end + +@interface MCLevelControlClusterStopParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull optionsMask; +@property (nonatomic, copy) NSNumber * _Nonnull optionsOverride; +@end + +@interface MCLevelControlClusterMoveToLevelWithOnOffParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull level; +@property (nonatomic, copy) NSNumber * _Nullable transitionTime; +@property (nonatomic, copy) NSNumber * _Nonnull optionsMask; +@property (nonatomic, copy) NSNumber * _Nonnull optionsOverride; +@end + +@interface MCLevelControlClusterMoveWithOnOffParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull moveMode; +@property (nonatomic, copy) NSNumber * _Nullable rate; +@property (nonatomic, copy) NSNumber * _Nonnull optionsMask; +@property (nonatomic, copy) NSNumber * _Nonnull optionsOverride; +@end + +@interface MCLevelControlClusterStepWithOnOffParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull stepMode; +@property (nonatomic, copy) NSNumber * _Nonnull stepSize; +@property (nonatomic, copy) NSNumber * _Nullable transitionTime; +@property (nonatomic, copy) NSNumber * _Nonnull optionsMask; +@property (nonatomic, copy) NSNumber * _Nonnull optionsOverride; +@end + +@interface MCLevelControlClusterStopWithOnOffParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull optionsMask; +@property (nonatomic, copy) NSNumber * _Nonnull optionsOverride; +@end + +@interface MCLevelControlClusterMoveToClosestFrequencyParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull frequency; +@end + +// WakeOnLan cluster: + +// TargetNavigator cluster: + +@interface MCTargetNavigatorClusterNavigateTargetParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull target; +@property (nonatomic, copy) NSString * _Nullable data; +@end + +@interface MCTargetNavigatorClusterNavigateTargetResponseParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull status; +@property (nonatomic, copy) NSString * _Nullable data; +@end + +// MediaPlayback cluster: + +@interface MCMediaPlaybackClusterPlayParams : MCAbstractPayload +@end + +@interface MCMediaPlaybackClusterPauseParams : MCAbstractPayload +@end + +@interface MCMediaPlaybackClusterStopParams : MCAbstractPayload +@end + +@interface MCMediaPlaybackClusterStartOverParams : MCAbstractPayload +@end + +@interface MCMediaPlaybackClusterPreviousParams : MCAbstractPayload +@end + +@interface MCMediaPlaybackClusterNextParams : MCAbstractPayload +@end + +@interface MCMediaPlaybackClusterRewindParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nullable audioAdvanceUnmuted; +@end + +@interface MCMediaPlaybackClusterFastForwardParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nullable audioAdvanceUnmuted; +@end + +@interface MCMediaPlaybackClusterSkipForwardParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull deltaPositionMilliseconds; +@end + +@interface MCMediaPlaybackClusterSkipBackwardParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull deltaPositionMilliseconds; +@end + +@interface MCMediaPlaybackClusterPlaybackResponseParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull status; +@property (nonatomic, copy) NSString * _Nullable data; +@end + +@interface MCMediaPlaybackClusterSeekParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull position; +@end + +@interface MCMediaPlaybackClusterActivateAudioTrackParams : MCAbstractPayload +@property (nonatomic, copy) NSString * _Nonnull trackID; +@property (nonatomic, copy) NSNumber * _Nonnull audioOutputIndex; +@end + +@interface MCMediaPlaybackClusterActivateTextTrackParams : MCAbstractPayload +@property (nonatomic, copy) NSString * _Nonnull trackID; +@end + +@interface MCMediaPlaybackClusterDeactivateTextTrackParams : MCAbstractPayload +@end + +// KeypadInput cluster: + +@interface MCKeypadInputClusterSendKeyParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull keyCode; +@end + +@interface MCKeypadInputClusterSendKeyResponseParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull status; +@end + +// ContentLauncher cluster: + +@interface MCContentLauncherClusterLaunchContentParams : MCAbstractPayload +@property (nonatomic, copy) MCContentLauncherClusterContentSearchStruct * _Nonnull search; +@property (nonatomic, copy) NSNumber * _Nonnull autoPlay; +@property (nonatomic, copy) NSString * _Nullable data; +@property (nonatomic, copy) MCContentLauncherClusterPlaybackPreferencesStruct * _Nullable playbackPreferences; +@property (nonatomic, copy) NSNumber * _Nullable useCurrentContext; +@end + +@interface MCContentLauncherClusterLaunchURLParams : MCAbstractPayload +@property (nonatomic, copy) NSString * _Nonnull contentURL; +@property (nonatomic, copy) NSString * _Nullable displayString; +@property (nonatomic, copy) MCContentLauncherClusterBrandingInformationStruct * _Nullable brandingInformation; +@end + +@interface MCContentLauncherClusterLauncherResponseParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull status; +@property (nonatomic, copy) NSString * _Nullable data; +@end + +// ApplicationLauncher cluster: + +@interface MCApplicationLauncherClusterLaunchAppParams : MCAbstractPayload +@property (nonatomic, copy) MCApplicationLauncherClusterApplicationStruct * _Nullable application; +@property (nonatomic, copy) NSData * _Nullable data; +@end + +@interface MCApplicationLauncherClusterStopAppParams : MCAbstractPayload +@property (nonatomic, copy) MCApplicationLauncherClusterApplicationStruct * _Nullable application; +@end + +@interface MCApplicationLauncherClusterHideAppParams : MCAbstractPayload +@property (nonatomic, copy) MCApplicationLauncherClusterApplicationStruct * _Nullable application; +@end + +@interface MCApplicationLauncherClusterLauncherResponseParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull status; +@property (nonatomic, copy) NSData * _Nullable data; +@end + +// ApplicationBasic cluster: + +NS_ASSUME_NONNULL_END diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm new file mode 100644 index 00000000000000..fe0676d2f05af7 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm @@ -0,0 +1,2292 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// THIS FILE IS GENERATED BY ZAP + +#import "MCCommandPayloads_Internal.h" + +#import "../MCAttribute_Internal.h" +#import "../MCCastingApp.h" +#import "../MCErrorUtils.h" +#import "../NSDataSpanConversion.h" +#import "../NSStringSpanConversion.h" + +#include +#include + +NS_ASSUME_NONNULL_BEGIN + +@implementation MCAbstractPayload +- (std::any)getCppRequestFromObjCRequest +{ + return nil; +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + return CHIP_NO_ERROR; +} + +- (nonnull id)copyWithZone:(nullable NSZone *)zone +{ + auto other = [[MCAbstractPayload alloc] init]; + + return other; +} +@end + +// OnOff cluster: + +@implementation MCOnOffClusterOffParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCOnOffClusterOffParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::OnOff::Commands::Off::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCOnOffClusterOnParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCOnOffClusterOnParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::OnOff::Commands::On::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCOnOffClusterToggleParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCOnOffClusterToggleParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::OnOff::Commands::Toggle::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCOnOffClusterOffWithEffectParams +- (instancetype)init +{ + if (self = [super init]) { + + _effectIdentifier = @(0); + + _effectVariant = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCOnOffClusterOffWithEffectParams alloc] init]; + + other.effectIdentifier = self.effectIdentifier; + other.effectVariant = self.effectVariant; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: effectIdentifier:%@; effectVariant:%@; >", NSStringFromClass([self class]), _effectIdentifier, _effectVariant]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::OnOff::Commands::OffWithEffect::Type cppStruct; + ListFreer listFreer; + { + cppStruct.effectIdentifier = static_cast>(self.effectIdentifier.unsignedCharValue); + } + { + cppStruct.effectVariant = self.effectVariant.unsignedCharValue; + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCOnOffClusterOnWithRecallGlobalSceneParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCOnOffClusterOnWithRecallGlobalSceneParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCOnOffClusterOnWithTimedOffParams +- (instancetype)init +{ + if (self = [super init]) { + + _onOffControl = @(0); + + _onTime = @(0); + + _offWaitTime = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCOnOffClusterOnWithTimedOffParams alloc] init]; + + other.onOffControl = self.onOffControl; + other.onTime = self.onTime; + other.offWaitTime = self.offWaitTime; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: onOffControl:%@; onTime:%@; offWaitTime:%@; >", NSStringFromClass([self class]), _onOffControl, _onTime, _offWaitTime]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type cppStruct; + ListFreer listFreer; + { + cppStruct.onOffControl = static_cast>(self.onOffControl.unsignedCharValue); + } + { + cppStruct.onTime = self.onTime.unsignedShortValue; + } + { + cppStruct.offWaitTime = self.offWaitTime.unsignedShortValue; + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +// LevelControl cluster: + +@implementation MCLevelControlClusterMoveToLevelParams +- (instancetype)init +{ + if (self = [super init]) { + + _level = @(0); + + _transitionTime = nil; + + _optionsMask = @(0); + + _optionsOverride = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterMoveToLevelParams alloc] init]; + + other.level = self.level; + other.transitionTime = self.transitionTime; + other.optionsMask = self.optionsMask; + other.optionsOverride = self.optionsOverride; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: level:%@; transitionTime:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _level, _transitionTime, _optionsMask, _optionsOverride]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type cppStruct; + ListFreer listFreer; + { + cppStruct.level = self.level.unsignedCharValue; + } + { + if (self.transitionTime == nil) { + cppStruct.transitionTime.SetNull(); + } else { + auto & nonNullValue_0 = cppStruct.transitionTime.SetNonNull(); + nonNullValue_0 = self.transitionTime.unsignedShortValue; + } + } + { + cppStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); + } + { + cppStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCLevelControlClusterMoveParams +- (instancetype)init +{ + if (self = [super init]) { + + _moveMode = @(0); + + _rate = nil; + + _optionsMask = @(0); + + _optionsOverride = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterMoveParams alloc] init]; + + other.moveMode = self.moveMode; + other.rate = self.rate; + other.optionsMask = self.optionsMask; + other.optionsOverride = self.optionsOverride; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: moveMode:%@; rate:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _moveMode, _rate, _optionsMask, _optionsOverride]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::Move::Type cppStruct; + ListFreer listFreer; + { + cppStruct.moveMode = static_cast>(self.moveMode.unsignedCharValue); + } + { + if (self.rate == nil) { + cppStruct.rate.SetNull(); + } else { + auto & nonNullValue_0 = cppStruct.rate.SetNonNull(); + nonNullValue_0 = self.rate.unsignedCharValue; + } + } + { + cppStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); + } + { + cppStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCLevelControlClusterStepParams +- (instancetype)init +{ + if (self = [super init]) { + + _stepMode = @(0); + + _stepSize = @(0); + + _transitionTime = nil; + + _optionsMask = @(0); + + _optionsOverride = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterStepParams alloc] init]; + + other.stepMode = self.stepMode; + other.stepSize = self.stepSize; + other.transitionTime = self.transitionTime; + other.optionsMask = self.optionsMask; + other.optionsOverride = self.optionsOverride; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: stepMode:%@; stepSize:%@; transitionTime:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _stepMode, _stepSize, _transitionTime, _optionsMask, _optionsOverride]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::Step::Type cppStruct; + ListFreer listFreer; + { + cppStruct.stepMode = static_cast>(self.stepMode.unsignedCharValue); + } + { + cppStruct.stepSize = self.stepSize.unsignedCharValue; + } + { + if (self.transitionTime == nil) { + cppStruct.transitionTime.SetNull(); + } else { + auto & nonNullValue_0 = cppStruct.transitionTime.SetNonNull(); + nonNullValue_0 = self.transitionTime.unsignedShortValue; + } + } + { + cppStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); + } + { + cppStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCLevelControlClusterStopParams +- (instancetype)init +{ + if (self = [super init]) { + + _optionsMask = @(0); + + _optionsOverride = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterStopParams alloc] init]; + + other.optionsMask = self.optionsMask; + other.optionsOverride = self.optionsOverride; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _optionsMask, _optionsOverride]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::Stop::Type cppStruct; + ListFreer listFreer; + { + cppStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); + } + { + cppStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCLevelControlClusterMoveToLevelWithOnOffParams +- (instancetype)init +{ + if (self = [super init]) { + + _level = @(0); + + _transitionTime = nil; + + _optionsMask = @(0); + + _optionsOverride = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; + + other.level = self.level; + other.transitionTime = self.transitionTime; + other.optionsMask = self.optionsMask; + other.optionsOverride = self.optionsOverride; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: level:%@; transitionTime:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _level, _transitionTime, _optionsMask, _optionsOverride]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Type cppStruct; + ListFreer listFreer; + { + cppStruct.level = self.level.unsignedCharValue; + } + { + if (self.transitionTime == nil) { + cppStruct.transitionTime.SetNull(); + } else { + auto & nonNullValue_0 = cppStruct.transitionTime.SetNonNull(); + nonNullValue_0 = self.transitionTime.unsignedShortValue; + } + } + { + cppStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); + } + { + cppStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCLevelControlClusterMoveWithOnOffParams +- (instancetype)init +{ + if (self = [super init]) { + + _moveMode = @(0); + + _rate = nil; + + _optionsMask = @(0); + + _optionsOverride = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterMoveWithOnOffParams alloc] init]; + + other.moveMode = self.moveMode; + other.rate = self.rate; + other.optionsMask = self.optionsMask; + other.optionsOverride = self.optionsOverride; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: moveMode:%@; rate:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _moveMode, _rate, _optionsMask, _optionsOverride]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::Type cppStruct; + ListFreer listFreer; + { + cppStruct.moveMode = static_cast>(self.moveMode.unsignedCharValue); + } + { + if (self.rate == nil) { + cppStruct.rate.SetNull(); + } else { + auto & nonNullValue_0 = cppStruct.rate.SetNonNull(); + nonNullValue_0 = self.rate.unsignedCharValue; + } + } + { + cppStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); + } + { + cppStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCLevelControlClusterStepWithOnOffParams +- (instancetype)init +{ + if (self = [super init]) { + + _stepMode = @(0); + + _stepSize = @(0); + + _transitionTime = nil; + + _optionsMask = @(0); + + _optionsOverride = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterStepWithOnOffParams alloc] init]; + + other.stepMode = self.stepMode; + other.stepSize = self.stepSize; + other.transitionTime = self.transitionTime; + other.optionsMask = self.optionsMask; + other.optionsOverride = self.optionsOverride; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: stepMode:%@; stepSize:%@; transitionTime:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _stepMode, _stepSize, _transitionTime, _optionsMask, _optionsOverride]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Type cppStruct; + ListFreer listFreer; + { + cppStruct.stepMode = static_cast>(self.stepMode.unsignedCharValue); + } + { + cppStruct.stepSize = self.stepSize.unsignedCharValue; + } + { + if (self.transitionTime == nil) { + cppStruct.transitionTime.SetNull(); + } else { + auto & nonNullValue_0 = cppStruct.transitionTime.SetNonNull(); + nonNullValue_0 = self.transitionTime.unsignedShortValue; + } + } + { + cppStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); + } + { + cppStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCLevelControlClusterStopWithOnOffParams +- (instancetype)init +{ + if (self = [super init]) { + + _optionsMask = @(0); + + _optionsOverride = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterStopWithOnOffParams alloc] init]; + + other.optionsMask = self.optionsMask; + other.optionsOverride = self.optionsOverride; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _optionsMask, _optionsOverride]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::StopWithOnOff::Type cppStruct; + ListFreer listFreer; + { + cppStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); + } + { + cppStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCLevelControlClusterMoveToClosestFrequencyParams +- (instancetype)init +{ + if (self = [super init]) { + + _frequency = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterMoveToClosestFrequencyParams alloc] init]; + + other.frequency = self.frequency; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: frequency:%@; >", NSStringFromClass([self class]), _frequency]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::MoveToClosestFrequency::Type cppStruct; + ListFreer listFreer; + { + cppStruct.frequency = self.frequency.unsignedShortValue; + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +// WakeOnLan cluster: + +// TargetNavigator cluster: + +@implementation MCTargetNavigatorClusterNavigateTargetParams +- (instancetype)init +{ + if (self = [super init]) { + + _target = @(0); + + _data = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCTargetNavigatorClusterNavigateTargetParams alloc] init]; + + other.target = self.target; + other.data = self.data; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: target:%@; data:%@; >", NSStringFromClass([self class]), _target, _data]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Type cppStruct; + ListFreer listFreer; + { + cppStruct.target = self.target.unsignedCharValue; + } + { + if (self.data != nil) { + auto & definedValue_0 = cppStruct.data.Emplace(); + definedValue_0 = AsCharSpan(self.data); + } + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCTargetNavigatorClusterNavigateTargetResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _status = @(0); + + _data = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCTargetNavigatorClusterNavigateTargetResponseParams alloc] init]; + + other.status = self.status; + other.data = self.data; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, _data]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + // Default implementation + return CHIP_NO_ERROR; +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppResponse +{ + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType cppDecodableStruct = *responseSharedPtr; + + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)]; + } + { + if (cppDecodableStruct.data.HasValue()) { + self.data = AsString(cppDecodableStruct.data.Value()); + if (self.data == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + self.data = nil; + } + } + return CHIP_NO_ERROR; +} +@end + +// MediaPlayback cluster: + +@implementation MCMediaPlaybackClusterPlayParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterPlayParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::Play::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterPauseParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterPauseParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::Pause::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterStopParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterStopParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::Stop::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterStartOverParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterStartOverParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::StartOver::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterPreviousParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterPreviousParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::Previous::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterNextParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterNextParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::Next::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterRewindParams +- (instancetype)init +{ + if (self = [super init]) { + + _audioAdvanceUnmuted = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterRewindParams alloc] init]; + + other.audioAdvanceUnmuted = self.audioAdvanceUnmuted; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: audioAdvanceUnmuted:%@; >", NSStringFromClass([self class]), _audioAdvanceUnmuted]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::Rewind::Type cppStruct; + ListFreer listFreer; + { + if (self.audioAdvanceUnmuted != nil) { + auto & definedValue_0 = cppStruct.audioAdvanceUnmuted.Emplace(); + definedValue_0 = self.audioAdvanceUnmuted.boolValue; + } + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterFastForwardParams +- (instancetype)init +{ + if (self = [super init]) { + + _audioAdvanceUnmuted = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterFastForwardParams alloc] init]; + + other.audioAdvanceUnmuted = self.audioAdvanceUnmuted; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: audioAdvanceUnmuted:%@; >", NSStringFromClass([self class]), _audioAdvanceUnmuted]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::FastForward::Type cppStruct; + ListFreer listFreer; + { + if (self.audioAdvanceUnmuted != nil) { + auto & definedValue_0 = cppStruct.audioAdvanceUnmuted.Emplace(); + definedValue_0 = self.audioAdvanceUnmuted.boolValue; + } + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterSkipForwardParams +- (instancetype)init +{ + if (self = [super init]) { + + _deltaPositionMilliseconds = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterSkipForwardParams alloc] init]; + + other.deltaPositionMilliseconds = self.deltaPositionMilliseconds; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: deltaPositionMilliseconds:%@; >", NSStringFromClass([self class]), _deltaPositionMilliseconds]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::SkipForward::Type cppStruct; + ListFreer listFreer; + { + cppStruct.deltaPositionMilliseconds = self.deltaPositionMilliseconds.unsignedLongLongValue; + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterSkipBackwardParams +- (instancetype)init +{ + if (self = [super init]) { + + _deltaPositionMilliseconds = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterSkipBackwardParams alloc] init]; + + other.deltaPositionMilliseconds = self.deltaPositionMilliseconds; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: deltaPositionMilliseconds:%@; >", NSStringFromClass([self class]), _deltaPositionMilliseconds]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::SkipBackward::Type cppStruct; + ListFreer listFreer; + { + cppStruct.deltaPositionMilliseconds = self.deltaPositionMilliseconds.unsignedLongLongValue; + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterPlaybackResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _status = @(0); + + _data = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterPlaybackResponseParams alloc] init]; + + other.status = self.status; + other.data = self.data; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, _data]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + // Default implementation + return CHIP_NO_ERROR; +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppResponse +{ + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType cppDecodableStruct = *responseSharedPtr; + + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)]; + } + { + if (cppDecodableStruct.data.HasValue()) { + self.data = AsString(cppDecodableStruct.data.Value()); + if (self.data == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + self.data = nil; + } + } + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterSeekParams +- (instancetype)init +{ + if (self = [super init]) { + + _position = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterSeekParams alloc] init]; + + other.position = self.position; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: position:%@; >", NSStringFromClass([self class]), _position]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::Seek::Type cppStruct; + ListFreer listFreer; + { + cppStruct.position = self.position.unsignedLongLongValue; + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterActivateAudioTrackParams +- (instancetype)init +{ + if (self = [super init]) { + + _trackID = @""; + + _audioOutputIndex = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterActivateAudioTrackParams alloc] init]; + + other.trackID = self.trackID; + other.audioOutputIndex = self.audioOutputIndex; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: trackID:%@; audioOutputIndex:%@; >", NSStringFromClass([self class]), _trackID, _audioOutputIndex]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::ActivateAudioTrack::Type cppStruct; + ListFreer listFreer; + { + cppStruct.trackID = AsCharSpan(self.trackID); + } + { + cppStruct.audioOutputIndex = self.audioOutputIndex.unsignedCharValue; + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterActivateTextTrackParams +- (instancetype)init +{ + if (self = [super init]) { + + _trackID = @""; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterActivateTextTrackParams alloc] init]; + + other.trackID = self.trackID; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: trackID:%@; >", NSStringFromClass([self class]), _trackID]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::ActivateTextTrack::Type cppStruct; + ListFreer listFreer; + { + cppStruct.trackID = AsCharSpan(self.trackID); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterDeactivateTextTrackParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterDeactivateTextTrackParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::DeactivateTextTrack::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +// KeypadInput cluster: + +@implementation MCKeypadInputClusterSendKeyParams +- (instancetype)init +{ + if (self = [super init]) { + + _keyCode = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCKeypadInputClusterSendKeyParams alloc] init]; + + other.keyCode = self.keyCode; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: keyCode:%@; >", NSStringFromClass([self class]), _keyCode]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::KeypadInput::Commands::SendKey::Type cppStruct; + ListFreer listFreer; + { + cppStruct.keyCode = static_cast>(self.keyCode.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCKeypadInputClusterSendKeyResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _status = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCKeypadInputClusterSendKeyResponseParams alloc] init]; + + other.status = self.status; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; >", NSStringFromClass([self class]), _status]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + // Default implementation + return CHIP_NO_ERROR; +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppResponse +{ + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType cppDecodableStruct = *responseSharedPtr; + + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)]; + } + return CHIP_NO_ERROR; +} +@end + +// ContentLauncher cluster: + +@implementation MCContentLauncherClusterLaunchContentParams +- (instancetype)init +{ + if (self = [super init]) { + + _search = [MCContentLauncherClusterContentSearchStruct new]; + + _autoPlay = @(0); + + _data = nil; + + _playbackPreferences = nil; + + _useCurrentContext = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCContentLauncherClusterLaunchContentParams alloc] init]; + + other.search = self.search; + other.autoPlay = self.autoPlay; + other.data = self.data; + other.playbackPreferences = self.playbackPreferences; + other.useCurrentContext = self.useCurrentContext; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: search:%@; autoPlay:%@; data:%@; playbackPreferences:%@; useCurrentContext:%@; >", NSStringFromClass([self class]), _search, _autoPlay, _data, _playbackPreferences, _useCurrentContext]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type cppStruct; + ListFreer listFreer; + { + { + using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (self.search.parameterList.count != 0) { + auto * listHolder_1 = new ListHolder(self.search.parameterList.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < self.search.parameterList.count; ++i_1) { + if (![self.search.parameterList[i_1] isKindOfClass:[MCContentLauncherClusterParameterStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (MCContentLauncherClusterParameterStruct *) self.search.parameterList[i_1]; + listHolder_1->mList[i_1].type = static_castmList[i_1].type)>>(element_1.type.unsignedCharValue); + listHolder_1->mList[i_1].value = AsCharSpan(element_1.value); + if (element_1.externalIDList != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].externalIDList.Emplace(); + { + using ListType_4 = std::remove_reference_t; + using ListMemberType_4 = ListMemberTypeGetter::Type; + if (element_1.externalIDList.count != 0) { + auto * listHolder_4 = new ListHolder(element_1.externalIDList.count); + if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_4); + for (size_t i_4 = 0; i_4 < element_1.externalIDList.count; ++i_4) { + if (![element_1.externalIDList[i_4] isKindOfClass:[MCContentLauncherClusterAdditionalInfoStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_4 = (MCContentLauncherClusterAdditionalInfoStruct *) element_1.externalIDList[i_4]; + listHolder_4->mList[i_4].name = AsCharSpan(element_4.name); + listHolder_4->mList[i_4].value = AsCharSpan(element_4.value); + } + definedValue_3 = ListType_4(listHolder_4->mList, element_1.externalIDList.count); + } else { + definedValue_3 = ListType_4(); + } + } + } + } + cppStruct.search.parameterList = ListType_1(listHolder_1->mList, self.search.parameterList.count); + } else { + cppStruct.search.parameterList = ListType_1(); + } + } + } + { + cppStruct.autoPlay = self.autoPlay.boolValue; + } + { + if (self.data != nil) { + auto & definedValue_0 = cppStruct.data.Emplace(); + definedValue_0 = AsCharSpan(self.data); + } + } + { + if (self.playbackPreferences != nil) { + auto & definedValue_0 = cppStruct.playbackPreferences.Emplace(); + definedValue_0.playbackPosition = self.playbackPreferences.playbackPosition.unsignedLongLongValue; + definedValue_0.textTrack.languageCode = AsCharSpan(self.playbackPreferences.textTrack.languageCode); + if (self.playbackPreferences.textTrack.characteristics != nil) { + auto & definedValue_3 = definedValue_0.textTrack.characteristics.Emplace(); + { + using ListType_4 = std::remove_reference_t; + using ListMemberType_4 = ListMemberTypeGetter::Type; + if (self.playbackPreferences.textTrack.characteristics.count != 0) { + auto * listHolder_4 = new ListHolder(self.playbackPreferences.textTrack.characteristics.count); + if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_4); + for (size_t i_4 = 0; i_4 < self.playbackPreferences.textTrack.characteristics.count; ++i_4) { + if (![self.playbackPreferences.textTrack.characteristics[i_4] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_4 = (NSNumber *) self.playbackPreferences.textTrack.characteristics[i_4]; + listHolder_4->mList[i_4] = static_castmList[i_4])>>(element_4.unsignedCharValue); + } + definedValue_3 = ListType_4(listHolder_4->mList, self.playbackPreferences.textTrack.characteristics.count); + } else { + definedValue_3 = ListType_4(); + } + } + } + definedValue_0.textTrack.audioOutputIndex = self.playbackPreferences.textTrack.audioOutputIndex.unsignedCharValue; + if (self.playbackPreferences.audioTracks != nil) { + auto & definedValue_2 = definedValue_0.audioTracks.Emplace(); + { + using ListType_3 = std::remove_reference_t; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (self.playbackPreferences.audioTracks.count != 0) { + auto * listHolder_3 = new ListHolder(self.playbackPreferences.audioTracks.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < self.playbackPreferences.audioTracks.count; ++i_3) { + if (![self.playbackPreferences.audioTracks[i_3] isKindOfClass:[MCContentLauncherClusterTrackPreferenceStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_3 = (MCContentLauncherClusterTrackPreferenceStruct *) self.playbackPreferences.audioTracks[i_3]; + listHolder_3->mList[i_3].languageCode = AsCharSpan(element_3.languageCode); + if (element_3.characteristics != nil) { + auto & definedValue_5 = listHolder_3->mList[i_3].characteristics.Emplace(); + { + using ListType_6 = std::remove_reference_t; + using ListMemberType_6 = ListMemberTypeGetter::Type; + if (element_3.characteristics.count != 0) { + auto * listHolder_6 = new ListHolder(element_3.characteristics.count); + if (listHolder_6 == nullptr || listHolder_6->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_6); + for (size_t i_6 = 0; i_6 < element_3.characteristics.count; ++i_6) { + if (![element_3.characteristics[i_6] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_6 = (NSNumber *) element_3.characteristics[i_6]; + listHolder_6->mList[i_6] = static_castmList[i_6])>>(element_6.unsignedCharValue); + } + definedValue_5 = ListType_6(listHolder_6->mList, element_3.characteristics.count); + } else { + definedValue_5 = ListType_6(); + } + } + } + listHolder_3->mList[i_3].audioOutputIndex = element_3.audioOutputIndex.unsignedCharValue; + } + definedValue_2 = ListType_3(listHolder_3->mList, self.playbackPreferences.audioTracks.count); + } else { + definedValue_2 = ListType_3(); + } + } + } + } + } + { + if (self.useCurrentContext != nil) { + auto & definedValue_0 = cppStruct.useCurrentContext.Emplace(); + definedValue_0 = self.useCurrentContext.boolValue; + } + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCContentLauncherClusterLaunchURLParams +- (instancetype)init +{ + if (self = [super init]) { + + _contentURL = @""; + + _displayString = nil; + + _brandingInformation = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCContentLauncherClusterLaunchURLParams alloc] init]; + + other.contentURL = self.contentURL; + other.displayString = self.displayString; + other.brandingInformation = self.brandingInformation; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: contentURL:%@; displayString:%@; brandingInformation:%@; >", NSStringFromClass([self class]), _contentURL, _displayString, _brandingInformation]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type cppStruct; + ListFreer listFreer; + { + cppStruct.contentURL = AsCharSpan(self.contentURL); + } + { + if (self.displayString != nil) { + auto & definedValue_0 = cppStruct.displayString.Emplace(); + definedValue_0 = AsCharSpan(self.displayString); + } + } + { + if (self.brandingInformation != nil) { + auto & definedValue_0 = cppStruct.brandingInformation.Emplace(); + definedValue_0.providerName = AsCharSpan(self.brandingInformation.providerName); + if (self.brandingInformation.background != nil) { + auto & definedValue_2 = definedValue_0.background.Emplace(); + if (self.brandingInformation.background.imageURL != nil) { + auto & definedValue_4 = definedValue_2.imageURL.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.background.imageURL); + } + if (self.brandingInformation.background.color != nil) { + auto & definedValue_4 = definedValue_2.color.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.background.color); + } + if (self.brandingInformation.background.size != nil) { + auto & definedValue_4 = definedValue_2.size.Emplace(); + definedValue_4.width = self.brandingInformation.background.size.width.doubleValue; + definedValue_4.height = self.brandingInformation.background.size.height.doubleValue; + definedValue_4.metric = static_cast>(self.brandingInformation.background.size.metric.unsignedCharValue); + } + } + if (self.brandingInformation.logo != nil) { + auto & definedValue_2 = definedValue_0.logo.Emplace(); + if (self.brandingInformation.logo.imageURL != nil) { + auto & definedValue_4 = definedValue_2.imageURL.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.logo.imageURL); + } + if (self.brandingInformation.logo.color != nil) { + auto & definedValue_4 = definedValue_2.color.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.logo.color); + } + if (self.brandingInformation.logo.size != nil) { + auto & definedValue_4 = definedValue_2.size.Emplace(); + definedValue_4.width = self.brandingInformation.logo.size.width.doubleValue; + definedValue_4.height = self.brandingInformation.logo.size.height.doubleValue; + definedValue_4.metric = static_cast>(self.brandingInformation.logo.size.metric.unsignedCharValue); + } + } + if (self.brandingInformation.progressBar != nil) { + auto & definedValue_2 = definedValue_0.progressBar.Emplace(); + if (self.brandingInformation.progressBar.imageURL != nil) { + auto & definedValue_4 = definedValue_2.imageURL.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.progressBar.imageURL); + } + if (self.brandingInformation.progressBar.color != nil) { + auto & definedValue_4 = definedValue_2.color.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.progressBar.color); + } + if (self.brandingInformation.progressBar.size != nil) { + auto & definedValue_4 = definedValue_2.size.Emplace(); + definedValue_4.width = self.brandingInformation.progressBar.size.width.doubleValue; + definedValue_4.height = self.brandingInformation.progressBar.size.height.doubleValue; + definedValue_4.metric = static_cast>(self.brandingInformation.progressBar.size.metric.unsignedCharValue); + } + } + if (self.brandingInformation.splash != nil) { + auto & definedValue_2 = definedValue_0.splash.Emplace(); + if (self.brandingInformation.splash.imageURL != nil) { + auto & definedValue_4 = definedValue_2.imageURL.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.splash.imageURL); + } + if (self.brandingInformation.splash.color != nil) { + auto & definedValue_4 = definedValue_2.color.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.splash.color); + } + if (self.brandingInformation.splash.size != nil) { + auto & definedValue_4 = definedValue_2.size.Emplace(); + definedValue_4.width = self.brandingInformation.splash.size.width.doubleValue; + definedValue_4.height = self.brandingInformation.splash.size.height.doubleValue; + definedValue_4.metric = static_cast>(self.brandingInformation.splash.size.metric.unsignedCharValue); + } + } + if (self.brandingInformation.waterMark != nil) { + auto & definedValue_2 = definedValue_0.waterMark.Emplace(); + if (self.brandingInformation.waterMark.imageURL != nil) { + auto & definedValue_4 = definedValue_2.imageURL.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.waterMark.imageURL); + } + if (self.brandingInformation.waterMark.color != nil) { + auto & definedValue_4 = definedValue_2.color.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.waterMark.color); + } + if (self.brandingInformation.waterMark.size != nil) { + auto & definedValue_4 = definedValue_2.size.Emplace(); + definedValue_4.width = self.brandingInformation.waterMark.size.width.doubleValue; + definedValue_4.height = self.brandingInformation.waterMark.size.height.doubleValue; + definedValue_4.metric = static_cast>(self.brandingInformation.waterMark.size.metric.unsignedCharValue); + } + } + } + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCContentLauncherClusterLauncherResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _status = @(0); + + _data = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCContentLauncherClusterLauncherResponseParams alloc] init]; + + other.status = self.status; + other.data = self.data; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, _data]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + // Default implementation + return CHIP_NO_ERROR; +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppResponse +{ + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType cppDecodableStruct = *responseSharedPtr; + + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)]; + } + { + if (cppDecodableStruct.data.HasValue()) { + self.data = AsString(cppDecodableStruct.data.Value()); + if (self.data == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + self.data = nil; + } + } + return CHIP_NO_ERROR; +} +@end + +// ApplicationLauncher cluster: + +@implementation MCApplicationLauncherClusterLaunchAppParams +- (instancetype)init +{ + if (self = [super init]) { + + _application = nil; + + _data = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCApplicationLauncherClusterLaunchAppParams alloc] init]; + + other.application = self.application; + other.data = self.data; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: application:%@; data:%@; >", NSStringFromClass([self class]), _application, [_data base64EncodedStringWithOptions:0]]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type cppStruct; + ListFreer listFreer; + { + if (self.application != nil) { + auto & definedValue_0 = cppStruct.application.Emplace(); + definedValue_0.catalogVendorID = self.application.catalogVendorID.unsignedShortValue; + definedValue_0.applicationID = AsCharSpan(self.application.applicationID); + } + } + { + if (self.data != nil) { + auto & definedValue_0 = cppStruct.data.Emplace(); + definedValue_0 = AsByteSpan(self.data); + } + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCApplicationLauncherClusterStopAppParams +- (instancetype)init +{ + if (self = [super init]) { + + _application = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCApplicationLauncherClusterStopAppParams alloc] init]; + + other.application = self.application; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: application:%@; >", NSStringFromClass([self class]), _application]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type cppStruct; + ListFreer listFreer; + { + if (self.application != nil) { + auto & definedValue_0 = cppStruct.application.Emplace(); + definedValue_0.catalogVendorID = self.application.catalogVendorID.unsignedShortValue; + definedValue_0.applicationID = AsCharSpan(self.application.applicationID); + } + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCApplicationLauncherClusterHideAppParams +- (instancetype)init +{ + if (self = [super init]) { + + _application = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCApplicationLauncherClusterHideAppParams alloc] init]; + + other.application = self.application; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: application:%@; >", NSStringFromClass([self class]), _application]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type cppStruct; + ListFreer listFreer; + { + if (self.application != nil) { + auto & definedValue_0 = cppStruct.application.Emplace(); + definedValue_0.catalogVendorID = self.application.catalogVendorID.unsignedShortValue; + definedValue_0.applicationID = AsCharSpan(self.application.applicationID); + } + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCApplicationLauncherClusterLauncherResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _status = @(0); + + _data = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCApplicationLauncherClusterLauncherResponseParams alloc] init]; + + other.status = self.status; + other.data = self.data; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, [_data base64EncodedStringWithOptions:0]]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + // Default implementation + return CHIP_NO_ERROR; +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppResponse +{ + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType cppDecodableStruct = *responseSharedPtr; + + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)]; + } + { + if (cppDecodableStruct.data.HasValue()) { + self.data = AsData(cppDecodableStruct.data.Value()); + } else { + self.data = nil; + } + } + return CHIP_NO_ERROR; +} +@end + +// ApplicationBasic cluster: + +NS_ASSUME_NONNULL_END diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads_Internal.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads_Internal.h new file mode 100644 index 00000000000000..c880c24207b1b4 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads_Internal.h @@ -0,0 +1,33 @@ +/** + * + * Copyright (c) 2020-2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "MCCommandPayloads.h" + +#import "../MCErrorUtils.h" + +#import +#include + +#ifndef MCCommandPayloads_Internal_h +#define MCCommandPayloads_Internal_h + +@interface MCAbstractPayload () +- (std::any)getCppRequestFromObjCRequest; +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct; +@end + +#endif /* MCCommandPayloads_Internal_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCInteractionModelStructs.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCInteractionModelStructs.h new file mode 100644 index 00000000000000..f64e47027bde12 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCInteractionModelStructs.h @@ -0,0 +1,108 @@ +/** + * + * Copyright (c) 2020-2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#ifndef MCStructsObjc_h +#define MCStructsObjc_h + +@interface MCMediaPlaybackClusterPlaybackPositionStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull updatedAt; +@property (nonatomic, copy) NSNumber * _Nullable position; +@end + +@interface MCMediaPlaybackClusterTrackAttributesStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull languageCode; +@property (nonatomic, copy) NSString * _Nullable displayName; +@end + +@interface MCMediaPlaybackClusterTrackStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull id; +@property (nonatomic, copy) MCMediaPlaybackClusterTrackAttributesStruct * _Nullable trackAttributes; +@end + +@interface MCApplicationBasicClusterApplicationStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull catalogVendorID; +@property (nonatomic, copy) NSString * _Nonnull applicationID; +@end + +@interface MCTargetNavigatorClusterTargetInfoStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull identifier; +@property (nonatomic, copy) NSString * _Nonnull name; +@end + +@interface MCApplicationLauncherClusterApplicationStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull catalogVendorID; +@property (nonatomic, copy) NSString * _Nonnull applicationID; +@end + +@interface MCApplicationLauncherClusterApplicationEPStruct : NSObject +@property (nonatomic, copy) MCApplicationLauncherClusterApplicationStruct * _Nonnull application; +@property (nonatomic, copy) NSNumber * _Nullable endpoint; +@end + +@interface MCContentLauncherClusterContentSearchStruct : NSObject +@property (nonatomic, copy) NSArray * _Nonnull parameterList; +@end + +// MTR_PROVISIONALLY_AVAILABLE +@interface MCContentLauncherClusterTrackPreferenceStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull languageCode; // MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nullable characteristics; // MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull audioOutputIndex; // MTR_PROVISIONALLY_AVAILABLE; +@end + +// MTR_PROVISIONALLY_AVAILABLE +@interface MCContentLauncherClusterPlaybackPreferencesStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull playbackPosition; // MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MCContentLauncherClusterTrackPreferenceStruct * _Nonnull textTrack; // MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nullable audioTracks; // MTR_PROVISIONALLY_AVAILABLE; +@end + +@interface MCContentLauncherClusterDimensionStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull width; +@property (nonatomic, copy) NSNumber * _Nonnull height; +@property (nonatomic, copy) NSNumber * _Nonnull metric; +@end + +@interface MCContentLauncherClusterStyleInformationStruct : NSObject +@property (nonatomic, copy) NSString * _Nullable imageURL; +@property (nonatomic, copy) NSString * _Nullable color; +@property (nonatomic, copy) MCContentLauncherClusterDimensionStruct * _Nullable size; +@end + +@interface MCContentLauncherClusterBrandingInformationStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull providerName; +@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable background; +@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable logo; +@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable progressBar; +@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable splash; +@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable waterMark; +@end + +@interface MCContentLauncherClusterParameterStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull type; +@property (nonatomic, copy) NSString * _Nonnull value; +@property (nonatomic, copy) NSArray * _Nullable externalIDList; +@end + +@interface MCContentLauncherClusterAdditionalInfoStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull name; +@property (nonatomic, copy) NSString * _Nonnull value; +@end + +#endif /* MCStructsObjc_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCStructsObjc.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCInteractionModelStructs.mm similarity index 50% rename from examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCStructsObjc.mm rename to examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCInteractionModelStructs.mm index 64ced385e18a05..b847389f232eab 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCStructsObjc.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCInteractionModelStructs.mm @@ -15,7 +15,7 @@ * limitations under the License. */ -#import "MCStructsObjc.h" +#import "MCInteractionModelStructs.h" #import @@ -46,12 +46,6 @@ - (NSString *)description NSString * descriptionString = [NSString stringWithFormat:@"<%@: updatedAt:%@; position:%@; >", NSStringFromClass([self class]), _updatedAt, _position]; return descriptionString; } - -@end - -@implementation MCMediaPlaybackClusterPlaybackPosition : MCMediaPlaybackClusterPlaybackPositionStruct -@dynamic updatedAt; -@dynamic position; @end @implementation MCMediaPlaybackClusterTrackAttributesStruct @@ -81,7 +75,6 @@ - (NSString *)description NSString * descriptionString = [NSString stringWithFormat:@"<%@: languageCode:%@; displayName:%@; >", NSStringFromClass([self class]), _languageCode, _displayName]; return descriptionString; } - @end @implementation MCMediaPlaybackClusterTrackStruct @@ -111,7 +104,6 @@ - (NSString *)description NSString * descriptionString = [NSString stringWithFormat:@"<%@: id:%@; trackAttributes:%@; >", NSStringFromClass([self class]), _id, _trackAttributes]; return descriptionString; } - @end @implementation MCApplicationBasicClusterApplicationStruct @@ -161,10 +153,6 @@ - (NSString * _Nonnull)applicationId { return self.applicationID; } - -@end - -@implementation MCApplicationBasicClusterApplicationBasicApplication : MCApplicationBasicClusterApplicationStruct @end @implementation MCTargetNavigatorClusterTargetInfoStruct @@ -194,12 +182,6 @@ - (NSString *)description NSString * descriptionString = [NSString stringWithFormat:@"<%@: identifier:%@; name:%@; >", NSStringFromClass([self class]), _identifier, _name]; return descriptionString; } - -@end - -@implementation MCTargetNavigatorClusterTargetInfo : MCTargetNavigatorClusterTargetInfoStruct -@dynamic identifier; -@dynamic name; @end @implementation MCApplicationLauncherClusterApplicationStruct @@ -249,10 +231,6 @@ - (NSString * _Nonnull)applicationId { return self.applicationID; } - -@end - -@implementation MCApplicationLauncherClusterApplication : MCApplicationLauncherClusterApplicationStruct @end @implementation MCApplicationLauncherClusterApplicationEPStruct @@ -282,10 +260,270 @@ - (NSString *)description NSString * descriptionString = [NSString stringWithFormat:@"<%@: application:%@; endpoint:%@; >", NSStringFromClass([self class]), _application, _endpoint]; return descriptionString; } +@end + +@implementation MCContentLauncherClusterContentSearchStruct +- (instancetype)init +{ + if (self = [super init]) { + + _parameterList = [NSArray array]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MCContentLauncherClusterContentSearchStruct alloc] init]; + + other.parameterList = self.parameterList; + + return other; +} +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: parameterList:%@; >", NSStringFromClass([self class]), _parameterList]; + return descriptionString; +} @end -@implementation MCApplicationLauncherClusterApplicationEP : MCApplicationLauncherClusterApplicationEPStruct -@dynamic application; -@dynamic endpoint; +@implementation MCContentLauncherClusterTrackPreferenceStruct +- (instancetype)init +{ + if (self = [super init]) { + + _languageCode = @""; + + _characteristics = nil; + + _audioOutputIndex = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MCContentLauncherClusterTrackPreferenceStruct alloc] init]; + + other.languageCode = self.languageCode; + other.characteristics = self.characteristics; + other.audioOutputIndex = self.audioOutputIndex; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: languageCode:%@; characteristics:%@; audioOutputIndex:%@; >", NSStringFromClass([self class]), _languageCode, _characteristics, _audioOutputIndex]; + return descriptionString; +} +@end + +@implementation MCContentLauncherClusterPlaybackPreferencesStruct +- (instancetype)init +{ + if (self = [super init]) { + + _playbackPosition = @(0); + + _textTrack = [MCContentLauncherClusterTrackPreferenceStruct new]; + + _audioTracks = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MCContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + + other.playbackPosition = self.playbackPosition; + other.textTrack = self.textTrack; + other.audioTracks = self.audioTracks; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: playbackPosition:%@; textTrack:%@; audioTracks:%@; >", NSStringFromClass([self class]), _playbackPosition, _textTrack, _audioTracks]; + return descriptionString; +} +@end + +@implementation MCContentLauncherClusterDimensionStruct +- (instancetype)init +{ + if (self = [super init]) { + + _width = @(0); + + _height = @(0); + + _metric = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MCContentLauncherClusterDimensionStruct alloc] init]; + + other.width = self.width; + other.height = self.height; + other.metric = self.metric; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: width:%@; height:%@; metric:%@; >", NSStringFromClass([self class]), _width, _height, _metric]; + return descriptionString; +} +@end + +@implementation MCContentLauncherClusterStyleInformationStruct +- (instancetype)init +{ + if (self = [super init]) { + + _imageURL = nil; + + _color = nil; + + _size = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MCContentLauncherClusterStyleInformationStruct alloc] init]; + + other.imageURL = self.imageURL; + other.color = self.color; + other.size = self.size; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: imageURL:%@; color:%@; size:%@; >", NSStringFromClass([self class]), _imageURL, _color, _size]; + return descriptionString; +} + +- (void)setImageUrl:(NSString * _Nullable)imageUrl +{ + self.imageURL = imageUrl; +} + +- (NSString * _Nullable)imageUrl +{ + return self.imageURL; +} +@end + +@implementation MCContentLauncherClusterBrandingInformationStruct +- (instancetype)init +{ + if (self = [super init]) { + + _providerName = @""; + + _background = nil; + + _logo = nil; + + _progressBar = nil; + + _splash = nil; + + _waterMark = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MCContentLauncherClusterBrandingInformationStruct alloc] init]; + + other.providerName = self.providerName; + other.background = self.background; + other.logo = self.logo; + other.progressBar = self.progressBar; + other.splash = self.splash; + other.waterMark = self.waterMark; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: providerName:%@; background:%@; logo:%@; progressBar:%@; splash:%@; waterMark:%@; >", NSStringFromClass([self class]), _providerName, _background, _logo, _progressBar, _splash, _waterMark]; + return descriptionString; +} +@end + +@implementation MCContentLauncherClusterParameterStruct +- (instancetype)init +{ + if (self = [super init]) { + + _type = @(0); + + _value = @""; + + _externalIDList = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MCContentLauncherClusterParameterStruct alloc] init]; + + other.type = self.type; + other.value = self.value; + other.externalIDList = self.externalIDList; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: type:%@; value:%@; externalIDList:%@; >", NSStringFromClass([self class]), _type, _value, _externalIDList]; + return descriptionString; +} +@end + +@implementation MCContentLauncherClusterAdditionalInfoStruct +- (instancetype)init +{ + if (self = [super init]) { + + _name = @""; + + _value = @""; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MCContentLauncherClusterAdditionalInfoStruct alloc] init]; + + other.name = self.name; + other.value = self.value; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: name:%@; value:%@; >", NSStringFromClass([self class]), _name, _value]; + return descriptionString; +} @end diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCStructsObjc.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCStructsObjc.h deleted file mode 100644 index fa039162149609..00000000000000 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCStructsObjc.h +++ /dev/null @@ -1,58 +0,0 @@ -/** - * - * Copyright (c) 2020-2024 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#ifndef MCStructsObjc_h -#define MCStructsObjc_h - -@interface MCMediaPlaybackClusterPlaybackPositionStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull updatedAt; -@property (nonatomic, copy) NSNumber * _Nullable position; -@end - -@interface MCMediaPlaybackClusterTrackAttributesStruct : NSObject -@property (nonatomic, copy) NSString * _Nonnull languageCode; -@property (nonatomic, copy) NSString * _Nullable displayName; -@end - -@interface MCMediaPlaybackClusterTrackStruct : NSObject -@property (nonatomic, copy) NSString * _Nonnull id; -@property (nonatomic, copy) MCMediaPlaybackClusterTrackAttributesStruct * _Nullable trackAttributes; -@end - -@interface MCApplicationBasicClusterApplicationStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull catalogVendorID; -@property (nonatomic, copy) NSString * _Nonnull applicationID; -@end - -@interface MCTargetNavigatorClusterTargetInfoStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull identifier; -@property (nonatomic, copy) NSString * _Nonnull name; -@end - -@interface MCApplicationLauncherClusterApplicationStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull catalogVendorID; -@property (nonatomic, copy) NSString * _Nonnull applicationID; -@end - -@interface MCApplicationLauncherClusterApplicationEPStruct : NSObject -@property (nonatomic, copy) MCApplicationLauncherClusterApplicationStruct * _Nonnull application; -@property (nonatomic, copy) NSNumber * _Nullable endpoint; -@end - -#endif /* MCStructsObjc_h */ diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCContentLauncherLaunchURLExampleViewModel.swift b/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCContentLauncherLaunchURLExampleViewModel.swift index b74a91a77b7286..302ec886b4e115 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCContentLauncherLaunchURLExampleViewModel.swift +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCContentLauncherLaunchURLExampleViewModel.swift @@ -60,7 +60,7 @@ class MCContentLauncherLaunchURLExampleViewModel: ObservableObject { } // create the LaunchURL request - let request: MCContentLauncherClusterLaunchURLRequest = MCContentLauncherClusterLaunchURLRequest() + let request: MCContentLauncherClusterLaunchURLParams = MCContentLauncherClusterLaunchURLParams() request.contentURL = contentUrl request.displayString = displayString diff --git a/integrations/cloudbuild/build-all.yaml b/integrations/cloudbuild/build-all.yaml index cdefbcf1ddbe15..8a625883594c52 100644 --- a/integrations/cloudbuild/build-all.yaml +++ b/integrations/cloudbuild/build-all.yaml @@ -6,7 +6,7 @@ steps: - "--init" - "--recursive" id: Submodules - - name: "ghcr.io/project-chip/chip-build-vscode:36" + - name: "ghcr.io/project-chip/chip-build-vscode:41" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -21,7 +21,7 @@ steps: path: /pwenv timeout: 900s - - name: "ghcr.io/project-chip/chip-build-vscode:36" + - name: "ghcr.io/project-chip/chip-build-vscode:41" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -85,7 +85,7 @@ steps: --target k32w-shell build --create-archives /workspace/artifacts/ - - name: "ghcr.io/project-chip/chip-build-vscode:36" + - name: "ghcr.io/project-chip/chip-build-vscode:41" env: - PW_ENVIRONMENT_ROOT=/pwenv args: diff --git a/integrations/cloudbuild/chef.yaml b/integrations/cloudbuild/chef.yaml index 8dcf827d7e56aa..ecadd504eda617 100644 --- a/integrations/cloudbuild/chef.yaml +++ b/integrations/cloudbuild/chef.yaml @@ -1,5 +1,5 @@ steps: - - name: "ghcr.io/project-chip/chip-build-vscode:35" + - name: "ghcr.io/project-chip/chip-build-vscode:41" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -12,7 +12,7 @@ steps: path: /pwenv timeout: 2700s - - name: "ghcr.io/project-chip/chip-build-vscode:35" + - name: "ghcr.io/project-chip/chip-build-vscode:41" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -27,7 +27,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:35" + - name: "ghcr.io/project-chip/chip-build-vscode:41" env: - PW_ENVIRONMENT_ROOT=/pwenv args: diff --git a/integrations/cloudbuild/smoke-test.yaml b/integrations/cloudbuild/smoke-test.yaml index 87e22dbbea99d0..2d88ff2dc73da3 100644 --- a/integrations/cloudbuild/smoke-test.yaml +++ b/integrations/cloudbuild/smoke-test.yaml @@ -1,5 +1,5 @@ steps: - - name: "ghcr.io/project-chip/chip-build-vscode:36" + - name: "ghcr.io/project-chip/chip-build-vscode:41" entrypoint: "bash" args: - "-c" @@ -7,7 +7,7 @@ steps: git config --global --add safe.directory "*" git submodule update --init --recursive id: Submodules - - name: "ghcr.io/project-chip/chip-build-vscode:36" + - name: "ghcr.io/project-chip/chip-build-vscode:41" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -22,7 +22,7 @@ steps: path: /pwenv timeout: 900s - - name: "ghcr.io/project-chip/chip-build-vscode:36" + - name: "ghcr.io/project-chip/chip-build-vscode:41" id: ESP32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -43,7 +43,7 @@ steps: volumes: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:36" + - name: "ghcr.io/project-chip/chip-build-vscode:41" id: NRFConnect env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -64,7 +64,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:36" + - name: "ghcr.io/project-chip/chip-build-vscode:41" id: EFR32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -86,7 +86,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:36" + - name: "ghcr.io/project-chip/chip-build-vscode:41" id: Linux env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -139,7 +139,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:36" + - name: "ghcr.io/project-chip/chip-build-vscode:41" id: Android env: - PW_ENVIRONMENT_ROOT=/pwenv diff --git a/integrations/docker/images/base/chip-build/version b/integrations/docker/images/base/chip-build/version index 318ee31de299a4..3e7d598f90dadd 100644 --- a/integrations/docker/images/base/chip-build/version +++ b/integrations/docker/images/base/chip-build/version @@ -1 +1 @@ -41 : [nrfconnect] Update nRF Connect SDK version. +42 : [Ameba] Update Ameba System time diff --git a/integrations/docker/images/stage-2/chip-build-ameba/Dockerfile b/integrations/docker/images/stage-2/chip-build-ameba/Dockerfile index f1d39bb7024d73..08c0cf878392fd 100644 --- a/integrations/docker/images/stage-2/chip-build-ameba/Dockerfile +++ b/integrations/docker/images/stage-2/chip-build-ameba/Dockerfile @@ -4,7 +4,7 @@ LABEL org.opencontainers.image.source https://github.com/project-chip/connectedh # Setup Ameba ARG AMEBA_DIR=/opt/ameba -ARG TAG_NAME=ameba_update_2023_12_15 +ARG TAG_NAME=ameba_update_2024_03_22 RUN set -x \ && apt-get update \ && mkdir ${AMEBA_DIR} \ diff --git a/scripts/setup/bootstrap.sh b/scripts/setup/bootstrap.sh index 1b813216222efe..0a2a898eaf02c5 100644 --- a/scripts/setup/bootstrap.sh +++ b/scripts/setup/bootstrap.sh @@ -21,14 +21,14 @@ _install_additional_pip_requirements() { # figure out additional pip install items while [ $# -gt 0 ]; do case $1 in - -p | --platform) - _SETUP_PLATFORM=$2 - shift # argument - shift # value - ;; - *) - shift - ;; + -p | --platform) + _SETUP_PLATFORM=$2 + shift # argument + shift # value + ;; + *) + shift + ;; esac done @@ -41,7 +41,7 @@ _install_additional_pip_requirements() { for platform in ${_SETUP_PLATFORM}; do # Allow none as an alias of nothing extra installed (like -p none) - if [ "$platform" != "none" ]; then + if [ "$platform" != "none" -a -e "$_CHIP_ROOT/scripts/setup/requirements.$platform.txt" ]; then echo "Installing pip requirements for $platform..." pip install -q \ -r "$_CHIP_ROOT/scripts/setup/requirements.$platform.txt" \ @@ -66,7 +66,7 @@ _bootstrap_or_activate() { local _BOOTSTRAP_NAME="${_BOOTSTRAP_PATH##*/}" local _BOOTSTRAP_DIR="${_BOOTSTRAP_PATH%/*}" # Strip off the 'scripts[/setup]' directory, leaving the root of the repo. - _CHIP_ROOT="$(cd "${_BOOTSTRAP_DIR%/setup}/.." > /dev/null && pwd)" + _CHIP_ROOT="$(cd "${_BOOTSTRAP_DIR%/setup}/.." >/dev/null && pwd)" local _CONFIG_FILE="scripts/setup/environment.json" @@ -75,16 +75,6 @@ _bootstrap_or_activate() { unset PW_CONFIG_FILE fi - if [ ! -f "$_CHIP_ROOT/third_party/pigweed/repo/pw_env_setup/util.sh" ]; then - # Make sure our submodule remotes are correct for this revision. - git submodule sync --recursive - git submodule update --init - elif [ "$_BOOTSTRAP_NAME" = "bootstrap.sh" ]; then - # In this case, only update already checked out submodules. - git submodule sync --recursive - git submodule update - fi - PW_BRANDING_BANNER="$_CHIP_ROOT/scripts/setup/banner.txt" export PW_BRANDING_BANNER @@ -94,6 +84,10 @@ _bootstrap_or_activate() { PW_ROOT="$_CHIP_ROOT/third_party/pigweed/repo" export PW_ROOT + # Update or init the pigweed submodule if necessary. Don't touch any other submodules. + if [ "$_BOOTSTRAP_NAME" = "bootstrap.sh" -a ! -f "$_CHIP_ROOT/third_party/pigweed/repo/pw_env_setup/util.sh" ]; then + git submodule update --init "$_CHIP_ROOT/third_party/pigweed/repo" + fi . "$_CHIP_ROOT/third_party/pigweed/repo/pw_env_setup/util.sh" _chip_bootstrap_banner() { @@ -105,7 +99,7 @@ _bootstrap_or_activate() { local _PW_BANNER_FUNC="_chip_bootstrap_banner" - # Force the Pigweed environment directory to be '.environment' + # Default the Pigweed environment directory to be '.environment' if [ -z "$PW_ENVIRONMENT_ROOT" ]; then export PW_ENVIRONMENT_ROOT="$PW_PROJECT_ROOT/.environment" fi diff --git a/scripts/setup/constraints.txt b/scripts/setup/constraints.txt index 90b80f7588af5b..5d0ca805416433 100644 --- a/scripts/setup/constraints.txt +++ b/scripts/setup/constraints.txt @@ -290,3 +290,10 @@ setuptools==68.0.0 # via # pip-tools # west + +# Manual edits: + +# Higher versions depend on proto-plus, which break +# nanopb code generation (due to name conflict of the 'proto' module) +google-api-core==2.17.0 + diff --git a/scripts/setup/requirements.silabs_docker.txt b/scripts/setup/requirements.silabs.txt similarity index 100% rename from scripts/setup/requirements.silabs_docker.txt rename to scripts/setup/requirements.silabs.txt diff --git a/scripts/tools/zap_regen_yaml_tests.sh b/scripts/tools/zap_regen_yaml_tests.sh deleted file mode 100755 index f572e92be4582c..00000000000000 --- a/scripts/tools/zap_regen_yaml_tests.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# -# -# Copyright (c) 2022 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# -# Description: -# Run this from root of SDK to regenerate only the ZAP needed by chip-tool, -# rather than all of zap like `./scripts/tools/zap_regen_all.py -# - -./scripts/tools/zap_regen_all.py --type tests diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp index c049e34ba0cec2..0e65644eb935be 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -1003,17 +1003,10 @@ void DoorLockServer::setWeekDayScheduleCommandHandler(chip::app::CommandHandler return; } - // appclusters, 5.2.4.14 - spec does not allow setting the schedule for multiple days in the bitmask - int setBitsInDaysMask = 0; - uint8_t rawDaysMask = daysMask.Raw(); - for (size_t i = 0; i < sizeof(rawDaysMask) * 8; ++i) - { - setBitsInDaysMask += rawDaysMask & 0x1; - rawDaysMask = static_cast(rawDaysMask >> 1); - } + uint8_t rawDaysMask = daysMask.Raw(); - // TODO: Check that bits are within range - if (setBitsInDaysMask == 0 || setBitsInDaysMask > 1) + // Check that bits are within range + if ((0 == rawDaysMask) || (rawDaysMask & 0x80)) { ChipLogProgress(Zcl, "[SetWeekDaySchedule] Unable to add schedule - daysMask is out of range " diff --git a/src/app/server/Dnssd.cpp b/src/app/server/Dnssd.cpp index 1ec2fa0b8ffdb4..3df796434e2671 100644 --- a/src/app/server/Dnssd.cpp +++ b/src/app/server/Dnssd.cpp @@ -38,6 +38,11 @@ #include #include +#include + +using namespace chip; +using namespace chip::DeviceLayer; + namespace chip { namespace app { namespace { @@ -165,6 +170,21 @@ void DnssdServer::AddICDKeyToAdvertisement(AdvertisingParams & advParams) } #endif +void DnssdServer::GetPrimaryOrFallbackMACAddress(chip::MutableByteSpan mac) +{ + if (ConfigurationMgr().GetPrimaryMACAddress(mac) != CHIP_NO_ERROR) + { + // Only generate a fallback "MAC" once, so we don't keep constantly changing our host name. + if (std::all_of(std::begin(mFallbackMAC), std::end(mFallbackMAC), [](uint8_t v) { return v == 0; })) + { + ChipLogError(Discovery, "Failed to get primary mac address of device. Generating a random one."); + Crypto::DRBG_get_bytes(mFallbackMAC, sizeof(mFallbackMAC)); + } + VerifyOrDie(mac.size() == sizeof(mFallbackMAC)); // kPrimaryMACAddressLength + memcpy(mac.data(), mFallbackMAC, sizeof(mFallbackMAC)); + } +} + /// Set MDNS operational advertisement CHIP_ERROR DnssdServer::AdvertiseOperational() { @@ -179,11 +199,7 @@ CHIP_ERROR DnssdServer::AdvertiseOperational() uint8_t macBuffer[DeviceLayer::ConfigurationManager::kPrimaryMACAddressLength]; MutableByteSpan mac(macBuffer); - if (chip::DeviceLayer::ConfigurationMgr().GetPrimaryMACAddress(mac) != CHIP_NO_ERROR) - { - ChipLogError(Discovery, "Failed to get primary mac address of device. Generating a random one."); - Crypto::DRBG_get_bytes(macBuffer, sizeof(macBuffer)); - } + GetPrimaryOrFallbackMACAddress(mac); auto advertiseParameters = chip::Dnssd::OperationalAdvertisingParameters() .SetPeerId(fabricInfo.GetPeerId()) @@ -224,11 +240,7 @@ CHIP_ERROR DnssdServer::Advertise(bool commissionableNode, chip::Dnssd::Commissi uint8_t macBuffer[DeviceLayer::ConfigurationManager::kPrimaryMACAddressLength]; MutableByteSpan mac(macBuffer); - if (chip::DeviceLayer::ConfigurationMgr().GetPrimaryMACAddress(mac) != CHIP_NO_ERROR) - { - ChipLogError(Discovery, "Failed to get primary mac address of device. Generating a random one."); - Crypto::DRBG_get_bytes(macBuffer, sizeof(macBuffer)); - } + GetPrimaryOrFallbackMACAddress(mac); advertiseParameters.SetMac(mac); uint16_t value; diff --git a/src/app/server/Dnssd.h b/src/app/server/Dnssd.h index 559cac6a464b2f..e669f4d0860a50 100644 --- a/src/app/server/Dnssd.h +++ b/src/app/server/Dnssd.h @@ -146,6 +146,11 @@ class DLL_EXPORT DnssdServer : public ICDStateObserver /// Set MDNS commissionable node advertisement CHIP_ERROR AdvertiseCommissionableNode(chip::Dnssd::CommissioningMode mode); + // Our randomly-generated fallback "MAC address", in case we don't have a real one. + uint8_t mFallbackMAC[chip::DeviceLayer::ConfigurationManager::kPrimaryMACAddressLength] = { 0 }; + + void GetPrimaryOrFallbackMACAddress(chip::MutableByteSpan mac); + // // Check if we have any valid operational credentials present in the fabric table and return true // if we do. diff --git a/src/app/tests/suites/DL_Schedules.yaml b/src/app/tests/suites/DL_Schedules.yaml index fedc9247daca26..f0c32449c0f3e4 100644 --- a/src/app/tests/suites/DL_Schedules.yaml +++ b/src/app/tests/suites/DL_Schedules.yaml @@ -215,7 +215,7 @@ tests: response: error: INVALID_COMMAND - - label: "Create Week Day schedule for Sunday and Monday" + - label: "Create Week Day schedule with Invalid day" command: "SetWeekDaySchedule" arguments: values: @@ -224,28 +224,7 @@ tests: - name: "UserIndex" value: 1 - name: "DaysMask" - value: 0x3 # (Sunday and Monday) - - name: "StartHour" - value: 15 - - name: "StartMinute" - value: 16 - - name: "EndHour" - value: 18 - - name: "EndMinute" - value: 00 - response: - error: INVALID_COMMAND - - - label: "Create Week Day schedule for Sunday Wednesday and Saturday" - command: "SetWeekDaySchedule" - arguments: - values: - - name: "WeekDayIndex" - value: 1 - - name: "UserIndex" - value: 1 - - name: "DaysMask" - value: 0x49 # (Sunday, Wednesday and Saturday) + value: 0x80 # (Not a valid day between Sunday thru Saturday) - name: "StartHour" value: 15 - name: "StartMinute" @@ -1705,7 +1684,7 @@ tests: - name: "UserIndex" value: 2 - name: "DaysMask" - value: 0x40 + value: 0x49 # (Sunday, Wednesday and Saturday) - name: "StartHour" value: 23 - name: "StartMinute" @@ -1732,7 +1711,7 @@ tests: - name: "Status" value: 0x0 - name: "DaysMask" - value: 0x40 + value: 0x49 - name: "StartHour" value: 23 - name: "StartMinute" diff --git a/src/controller/python/chip/ble/LinuxImpl.cpp b/src/controller/python/chip/ble/LinuxImpl.cpp index 852e1f725d22b0..b665e4df391334 100644 --- a/src/controller/python/chip/ble/LinuxImpl.cpp +++ b/src/controller/python/chip/ble/LinuxImpl.cpp @@ -16,9 +16,15 @@ * limitations under the License. */ +#include +#include + +#include #include #include #include +#include +#include #include using namespace chip::DeviceLayer::Internal; @@ -93,9 +99,18 @@ class ScannerDelegateImpl : public ChipDeviceScannerDelegate mScanCallback(scanCallback), mCompleteCallback(completeCallback), mErrorCallback(errorCallback) {} - CHIP_ERROR ScannerInit(BluezAdapter1 * adapter) { return mScanner.Init(adapter, this); } + CHIP_ERROR ScannerInit(BluezAdapter1 * adapter) + { + ReturnErrorOnFailure(mBluezObjectManager.Init()); + return mScanner.Init(adapter, this); + } + + void ScannerShutdown() { mBluezObjectManager.Shutdown(); } + CHIP_ERROR ScannerStartScan(chip::System::Clock::Timeout timeout) { return mScanner.StartScan(timeout); } + CHIP_ERROR ScannerStopScan() { return mScanner.StopScan(); } + void OnDeviceScanned(BluezDevice1 & device, const chip::Ble::ChipBLEDeviceIdentificationInfo & info) override { if (mScanCallback) @@ -122,7 +137,8 @@ class ScannerDelegateImpl : public ChipDeviceScannerDelegate } private: - ChipDeviceScanner mScanner; + BluezObjectManager mBluezObjectManager; + ChipDeviceScanner mScanner{ mBluezObjectManager }; PyObject * const mContext; const DeviceScannedCallback mScanCallback; const ScanCompleteCallback mCompleteCallback; @@ -152,6 +168,10 @@ extern "C" void * pychip_ble_scanner_start(PyObject * context, void * adapter, u extern "C" void pychip_ble_scanner_delete(void * scanner) { + auto * delegate = static_cast(scanner); chip::DeviceLayer::StackLock lock; - delete static_cast(scanner); + // Make sure that the scanner is stopped before deleting the delegate. + delegate->ScannerStopScan(); + delegate->ScannerShutdown(); + delete delegate; } diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 9e2d1699691f10..c58c7669fb51ca 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -1035,9 +1035,11 @@ - (void)_setupSubscription MTRWeakReference * weakSelf = [MTRWeakReference weakReferenceWithObject:self]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (kTimeToWaitBeforeMarkingUnreachableAfterSettingUpSubscription * NSEC_PER_SEC)), self.queue, ^{ MTRDevice * strongSelf = weakSelf.strongObject; - os_unfair_lock_lock(&strongSelf->_lock); - [strongSelf _markDeviceAsUnreachableIfNotSusbcribed]; - os_unfair_lock_unlock(&strongSelf->_lock); + if (strongSelf != nil) { + os_unfair_lock_lock(&strongSelf->_lock); + [strongSelf _markDeviceAsUnreachableIfNotSusbcribed]; + os_unfair_lock_unlock(&strongSelf->_lock); + } }); [_deviceController diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.mm index 6ed3b00eeae3ee..2b7c8d59b1e061 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.mm @@ -125,6 +125,12 @@ - (nullable instancetype)initWithController:(MTRDeviceController *)controller __block id resumptionNodeList; dispatch_sync(_storageDelegateQueue, ^{ + @autoreleasepool { + resumptionNodeList = [_storageDelegate controller:_controller + valueForKey:sResumptionNodeListKey + securityLevel:MTRStorageSecurityLevelSecure + sharingType:MTRStorageSharingTypeNotShared]; + } resumptionNodeList = [_storageDelegate controller:_controller valueForKey:sResumptionNodeListKey securityLevel:MTRStorageSecurityLevelSecure @@ -145,6 +151,7 @@ - (nullable instancetype)initWithController:(MTRDeviceController *)controller } else { _nodesWithResumptionInfo = [[NSMutableArray alloc] init]; } + return self; } @@ -233,10 +240,12 @@ - (MTRCertificateTLVBytes _Nullable)fetchLastLocallyUsedNOC { __block id data; dispatch_sync(_storageDelegateQueue, ^{ - data = [_storageDelegate controller:_controller - valueForKey:sLastLocallyUsedNOCKey - securityLevel:MTRStorageSecurityLevelSecure - sharingType:MTRStorageSharingTypeNotShared]; + @autoreleasepool { + data = [_storageDelegate controller:_controller + valueForKey:sLastLocallyUsedNOCKey + securityLevel:MTRStorageSecurityLevelSecure + sharingType:MTRStorageSharingTypeNotShared]; + } }); if (data == nil) { @@ -259,10 +268,12 @@ - (nullable MTRCASESessionResumptionInfo *)_findResumptionInfoWithKey:(nullable __block id resumptionInfo; dispatch_sync(_storageDelegateQueue, ^{ - resumptionInfo = [_storageDelegate controller:_controller - valueForKey:key - securityLevel:MTRStorageSecurityLevelSecure - sharingType:MTRStorageSharingTypeNotShared]; + @autoreleasepool { + resumptionInfo = [_storageDelegate controller:_controller + valueForKey:key + securityLevel:MTRStorageSecurityLevelSecure + sharingType:MTRStorageSharingTypeNotShared]; + } }); if (resumptionInfo == nil) { @@ -304,11 +315,12 @@ - (nullable MTRCASESessionResumptionInfo *)_findResumptionInfoWithKey:(nullable - (id)_fetchAttributeCacheValueForKey:(NSString *)key expectedClass:(Class)expectedClass; { id data; - data = [_storageDelegate controller:_controller - valueForKey:key - securityLevel:MTRStorageSecurityLevelSecure - sharingType:MTRStorageSharingTypeNotShared]; - + @autoreleasepool { + data = [_storageDelegate controller:_controller + valueForKey:key + securityLevel:MTRStorageSecurityLevelSecure + sharingType:MTRStorageSharingTypeNotShared]; + } if (data == nil) { return nil; } diff --git a/src/include/platform/ConfigurationManager.h b/src/include/platform/ConfigurationManager.h index 4ebf2c6edf4d36..c7158d22c58d5e 100644 --- a/src/include/platform/ConfigurationManager.h +++ b/src/include/platform/ConfigurationManager.h @@ -80,17 +80,26 @@ class ConfigurationManager kMinRotatingDeviceIDUniqueIDLength = 16, kRotatingDeviceIDUniqueIDLength = CHIP_DEVICE_CONFIG_ROTATING_DEVICE_ID_UNIQUE_ID_LENGTH, #endif + kEthernetMACAddressLength = 6, + kThreadMACAddressLength = 8, #if CHIP_DEVICE_CONFIG_ENABLE_THREAD - kPrimaryMACAddressLength = 8, + kPrimaryMACAddressLength = kThreadMACAddressLength, #else - kPrimaryMACAddressLength = 6, + kPrimaryMACAddressLength = kEthernetMACAddressLength, #endif kMaxMACAddressLength = 8, kMaxLanguageTagLength = 5 // ISO 639-1 standard language codes }; - virtual CHIP_ERROR GetPrimaryMACAddress(MutableByteSpan buf) = 0; - virtual CHIP_ERROR GetPrimaryWiFiMACAddress(uint8_t * buf) = 0; + // Copies the primary MAC into a mutable span, which must be of size kPrimaryMACAddressLength. + // Upon success, the span will be reduced to the size of the MAC address being returned, which + // can be less than kPrimaryMACAddressLength on a device that supports Thread. + virtual CHIP_ERROR GetPrimaryMACAddress(MutableByteSpan buf) = 0; + + // Copies the primary WiFi MAC into a buffer of size kEthernetMACAddressLength + virtual CHIP_ERROR GetPrimaryWiFiMACAddress(uint8_t * buf) = 0; + + // Copies the primary Thread (802.15.4) MAC into a buffer of size kThreadMACAddressLength virtual CHIP_ERROR GetPrimary802154MACAddress(uint8_t * buf) = 0; virtual CHIP_ERROR GetSoftwareVersionString(char * buf, size_t bufSize) = 0; virtual CHIP_ERROR GetSoftwareVersion(uint32_t & softwareVer) = 0; diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.ipp b/src/include/platform/internal/GenericConfigurationManagerImpl.ipp index 24c6a28113906d..955b782a3238ed 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.ipp +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.ipp @@ -374,19 +374,21 @@ CHIP_ERROR GenericConfigurationManagerImpl::GetPrimaryMACAddress(Mu if (buf.size() != ConfigurationManager::kPrimaryMACAddressLength) return CHIP_ERROR_INVALID_ARGUMENT; - memset(buf.data(), 0, buf.size()); + memset(buf.data(), 0, buf.size()); // zero the whole buffer, in case the caller ignores buf.size() #if CHIP_DEVICE_CONFIG_ENABLE_THREAD if (chip::DeviceLayer::ThreadStackMgr().GetPrimary802154MACAddress(buf.data()) == CHIP_NO_ERROR) { ChipLogDetail(DeviceLayer, "Using Thread extended MAC for hostname."); + buf.reduce_size(kThreadMACAddressLength); return CHIP_NO_ERROR; } #endif if (chip::DeviceLayer::ConfigurationMgr().GetPrimaryWiFiMACAddress(buf.data()) == CHIP_NO_ERROR) { - ChipLogDetail(DeviceLayer, "Using wifi MAC for hostname"); + ChipLogDetail(DeviceLayer, "Using WiFi MAC for hostname"); + buf.reduce_size(kEthernetMACAddressLength); return CHIP_NO_ERROR; } diff --git a/src/platform/Darwin/DnssdContexts.cpp b/src/platform/Darwin/DnssdContexts.cpp index a8ae75e34d2eb5..f1335641d67dbf 100644 --- a/src/platform/Darwin/DnssdContexts.cpp +++ b/src/platform/Darwin/DnssdContexts.cpp @@ -30,6 +30,12 @@ namespace { constexpr uint8_t kDnssdKeyMaxSize = 32; constexpr uint8_t kDnssdTxtRecordMaxEntries = 20; +constexpr char kLocalDot[] = "local."; + +bool IsLocalDomain(const char * domain) +{ + return strcmp(kLocalDot, domain) == 0; +} std::string GetHostNameWithoutDomain(const char * hostnameWithDomain) { @@ -246,7 +252,6 @@ void MdnsContexts::Delete(GenericContext * context) { DNSServiceRefDeallocate(context->serviceRef); } - chip::Platform::Delete(context); } @@ -383,6 +388,7 @@ void BrowseContext::OnBrowseAdd(const char * name, const char * type, const char ChipLogProgress(Discovery, "Mdns: %s name: %s, type: %s, domain: %s, interface: %" PRIu32, __func__, StringOrNullMarker(name), StringOrNullMarker(type), StringOrNullMarker(domain), interfaceId); + VerifyOrReturn(IsLocalDomain(domain)); auto service = GetService(name, type, protocol, interfaceId); services.push_back(service); } @@ -393,6 +399,7 @@ void BrowseContext::OnBrowseRemove(const char * name, const char * type, const c StringOrNullMarker(type), StringOrNullMarker(domain), interfaceId); VerifyOrReturn(name != nullptr); + VerifyOrReturn(IsLocalDomain(domain)); services.erase(std::remove_if(services.begin(), services.end(), [name, type, interfaceId](const DnssdService & service) { @@ -436,6 +443,8 @@ void BrowseWithDelegateContext::OnBrowseAdd(const char * name, const char * type ChipLogProgress(Discovery, "Mdns: %s name: %s, type: %s, domain: %s, interface: %" PRIu32, __func__, StringOrNullMarker(name), StringOrNullMarker(type), StringOrNullMarker(domain), interfaceId); + VerifyOrReturn(IsLocalDomain(domain)); + auto delegate = static_cast(context); auto service = GetService(name, type, protocol, interfaceId); delegate->OnBrowseAdd(service); @@ -447,6 +456,7 @@ void BrowseWithDelegateContext::OnBrowseRemove(const char * name, const char * t StringOrNullMarker(type), StringOrNullMarker(domain), interfaceId); VerifyOrReturn(name != nullptr); + VerifyOrReturn(IsLocalDomain(domain)); auto delegate = static_cast(context); auto service = GetService(name, type, protocol, interfaceId); @@ -458,35 +468,27 @@ ResolveContext::ResolveContext(void * cbContext, DnssdResolveCallback cb, chip:: std::shared_ptr && consumerCounterToUse) : browseThatCausedResolve(browseCausingResolve) { - type = ContextType::Resolve; - context = cbContext; - callback = cb; - protocol = GetProtocol(cbAddressType); - instanceName = instanceNameToResolve; - consumerCounter = std::move(consumerCounterToUse); - hasSrpTimerStarted = false; + type = ContextType::Resolve; + context = cbContext; + callback = cb; + protocol = GetProtocol(cbAddressType); + instanceName = instanceNameToResolve; + consumerCounter = std::move(consumerCounterToUse); } ResolveContext::ResolveContext(CommissioningResolveDelegate * delegate, chip::Inet::IPAddressType cbAddressType, const char * instanceNameToResolve, std::shared_ptr && consumerCounterToUse) : browseThatCausedResolve(nullptr) { - type = ContextType::Resolve; - context = delegate; - callback = nullptr; - protocol = GetProtocol(cbAddressType); - instanceName = instanceNameToResolve; - consumerCounter = std::move(consumerCounterToUse); - hasSrpTimerStarted = false; + type = ContextType::Resolve; + context = delegate; + callback = nullptr; + protocol = GetProtocol(cbAddressType); + instanceName = instanceNameToResolve; + consumerCounter = std::move(consumerCounterToUse); } -ResolveContext::~ResolveContext() -{ - if (this->hasSrpTimerStarted) - { - CancelSrpTimer(this); - } -} +ResolveContext::~ResolveContext() {} void ResolveContext::DispatchFailure(const char * errorStr, CHIP_ERROR err) { @@ -534,16 +536,7 @@ void ResolveContext::DispatchSuccess() for (auto interfaceIndex : priorityInterfaceIndices) { - if (TryReportingResultsForInterfaceIndex(interfaceIndex)) - { - if (needDelete) - { - MdnsContexts::GetInstance().Delete(this); - } - return; - } - - if (TryReportingResultsForInterfaceIndex(interfaceIndex)) + if (TryReportingResultsForInterfaceIndex(static_cast(interfaceIndex))) { if (needDelete) { @@ -555,8 +548,7 @@ void ResolveContext::DispatchSuccess() for (auto & interface : interfaces) { - auto interfaceId = interface.first.first; - if (TryReportingResultsForInterfaceIndex(interfaceId)) + if (TryReportingResultsForInterfaceIndex(interface.first)) { break; } @@ -576,44 +568,35 @@ bool ResolveContext::TryReportingResultsForInterfaceIndex(uint32_t interfaceInde return false; } - std::map, InterfaceInfo>::iterator iter = interfaces.begin(); - while (iter != interfaces.end()) - { - std::pair key = iter->first; - if (key.first == interfaceIndex) - { - auto & interface = interfaces[key]; - auto & ips = interface.addresses; - - // Some interface may not have any ips, just ignore them. - if (ips.size() == 0) - { - return false; - } + auto & interface = interfaces[interfaceIndex]; + auto & ips = interface.addresses; - ChipLogProgress(Discovery, "Mdns: Resolve success on interface %" PRIu32, interfaceIndex); + // Some interface may not have any ips, just ignore them. + if (ips.size() == 0) + { + return false; + } - auto & service = interface.service; - auto addresses = Span(ips.data(), ips.size()); - if (nullptr == callback) - { - auto delegate = static_cast(context); - DiscoveredNodeData nodeData; - service.ToDiscoveredNodeData(addresses, nodeData); - delegate->OnNodeDiscovered(nodeData); - } - else - { - callback(context, &service, addresses, CHIP_NO_ERROR); - } + ChipLogProgress(Discovery, "Mdns: Resolve success on interface %" PRIu32, interfaceIndex); - return true; - } + auto & service = interface.service; + auto addresses = Span(ips.data(), ips.size()); + if (nullptr == callback) + { + auto delegate = static_cast(context); + DiscoveredNodeData nodeData; + service.ToDiscoveredNodeData(addresses, nodeData); + delegate->OnNodeDiscovered(nodeData); } - return false; + else + { + callback(context, &service, addresses, CHIP_NO_ERROR); + } + + return true; } -CHIP_ERROR ResolveContext::OnNewAddress(const std::pair & interfaceKey, const struct sockaddr * address) +CHIP_ERROR ResolveContext::OnNewAddress(uint32_t interfaceId, const struct sockaddr * address) { // If we don't have any information about this interfaceId, just ignore the // address, since it won't be usable anyway without things like the port. @@ -621,9 +604,7 @@ CHIP_ERROR ResolveContext::OnNewAddress(const std::pair & // on the system, because the hostnames we are looking up all end in // ".local". In other words, we can get regular DNS results in here, not // just DNS-SD ones. - auto interfaceId = interfaceKey.first; - - if (interfaces.find(interfaceKey) == interfaces.end()) + if (interfaces.find(interfaceId) == interfaces.end()) { return CHIP_NO_ERROR; } @@ -646,7 +627,7 @@ CHIP_ERROR ResolveContext::OnNewAddress(const std::pair & return CHIP_NO_ERROR; } - interfaces[interfaceKey].addresses.push_back(ip); + interfaces[interfaceId].addresses.push_back(ip); return CHIP_NO_ERROR; } @@ -728,15 +709,7 @@ void ResolveContext::OnNewInterface(uint32_t interfaceId, const char * fullname, // resolving. interface.fullyQualifiedDomainName = hostnameWithDomain; - std::string domainFromHostname = GetDomainFromHostName(hostnameWithDomain); - if (domainFromHostname.empty()) - { - ChipLogError(Discovery, "Mdns: No domain set in hostname %s", hostnameWithDomain); - return; - } - - std::pair interfaceKey = std::make_pair(interfaceId, domainFromHostname); - interfaces.insert(std::make_pair(std::move(interfaceKey), std::move(interface))); + interfaces.insert(std::make_pair(interfaceId, std::move(interface))); } bool ResolveContext::HasInterface() diff --git a/src/platform/Darwin/DnssdImpl.cpp b/src/platform/Darwin/DnssdImpl.cpp index 94bbdc477d9b64..7e9e7af521686d 100644 --- a/src/platform/Darwin/DnssdImpl.cpp +++ b/src/platform/Darwin/DnssdImpl.cpp @@ -26,7 +26,6 @@ #include #include -using namespace chip; using namespace chip::Dnssd; using namespace chip::Dnssd::Internal; @@ -34,13 +33,8 @@ namespace { constexpr char kLocalDot[] = "local."; -constexpr char kSrpDot[] = "default.service.arpa."; - -// The extra time in milliseconds that we will wait for the resolution on the srp domain to complete. -constexpr uint16_t kSrpTimeoutInMsec = 250; - constexpr DNSServiceFlags kRegisterFlags = kDNSServiceFlagsNoAutoRename; -constexpr DNSServiceFlags kBrowseFlags = kDNSServiceFlagsShareConnection; +constexpr DNSServiceFlags kBrowseFlags = 0; constexpr DNSServiceFlags kGetAddrInfoFlags = kDNSServiceFlagsTimeout | kDNSServiceFlagsShareConnection; constexpr DNSServiceFlags kResolveFlags = kDNSServiceFlagsShareConnection; constexpr DNSServiceFlags kReconfirmRecordFlags = 0; @@ -55,7 +49,7 @@ uint32_t GetInterfaceId(chip::Inet::InterfaceId interfaceId) return interfaceId.IsPresent() ? interfaceId.GetPlatformInterface() : kDNSServiceInterfaceIndexAny; } -std::string GetHostNameWithLocalDomain(const char * hostname) +std::string GetHostNameWithDomain(const char * hostname) { return std::string(hostname) + '.' + kLocalDot; } @@ -137,64 +131,6 @@ std::shared_ptr GetCounterHolder(const char * name) namespace chip { namespace Dnssd { -/** - * @brief Returns the domain name from a given hostname with domain. - * The assumption here is that the hostname comprises of "hostnameWithoutDomain.." - * The domainName returned from this API is "." - * - * @param[in] hostname The hostname with domain. - */ -std::string GetDomainFromHostName(const char * hostnameWithDomain) -{ - std::string hostname = std::string(hostnameWithDomain); - - // Find the first occurence of '.' - size_t first_pos = hostname.find("."); - - // if not found, return empty string - VerifyOrReturnValue(first_pos != std::string::npos, std::string()); - - // Get a substring after the first occurence of '.' to the end of the string - return hostname.substr(first_pos + 1, hostname.size()); -} - -/** - * @brief Callback that is called when the timeout for resolving on the kSrpDot domain has expired. - * - * @param[in] systemLayer The system layer. - * @param[in] callbackContext The context passed to the timer callback. - */ -void SrpTimerExpiredCallback(System::Layer * systemLayer, void * callbackContext) -{ - ChipLogProgress(Discovery, "Mdns: Timer expired for resolve to complete on the srp domain."); - auto sdCtx = static_cast(callbackContext); - VerifyOrDie(sdCtx != nullptr); - sdCtx->Finalize(); -} - -/** - * @brief Starts a timer to wait for the resolution on the kSrpDot domain to happen. - * - * @param[in] timeoutSeconds The timeout in seconds. - * @param[in] ResolveContext The resolve context. - */ -CHIP_ERROR StartSrpTimer(uint16_t timeoutInMSecs, ResolveContext * ctx) -{ - VerifyOrReturnValue(ctx != nullptr, CHIP_ERROR_INCORRECT_STATE); - return DeviceLayer::SystemLayer().StartTimer(System::Clock::Milliseconds16(timeoutInMSecs), SrpTimerExpiredCallback, - reinterpret_cast(ctx)); -} - -/** - * @brief Cancels the timer that was started to wait for the resolution on the kSrpDot domain to happen. - * - * @param[in] ResolveContext The resolve context. - */ -void CancelSrpTimer(ResolveContext * ctx) -{ - DeviceLayer::SystemLayer().CancelTimer(SrpTimerExpiredCallback, reinterpret_cast(ctx)); -} - Global MdnsContexts::sInstance; namespace { @@ -247,24 +183,14 @@ static void OnBrowse(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interf CHIP_ERROR Browse(BrowseHandler * sdCtx, uint32_t interfaceId, const char * type) { - auto err = DNSServiceCreateConnection(&sdCtx->serviceRef); - VerifyOrReturnError(kDNSServiceErr_NoError == err, sdCtx->Finalize(err)); - - // We will browse on both the local domain and the srp domain. - ChipLogProgress(Discovery, "Browsing for: %s on domain %s", StringOrNullMarker(type), kLocalDot); - - auto sdRefLocal = sdCtx->serviceRef; // Mandatory copy because of kDNSServiceFlagsShareConnection - err = DNSServiceBrowse(&sdRefLocal, kBrowseFlags, interfaceId, type, kLocalDot, OnBrowse, sdCtx); - VerifyOrReturnError(kDNSServiceErr_NoError == err, sdCtx->Finalize(err)); - - ChipLogProgress(Discovery, "Browsing for: %s on domain %s", StringOrNullMarker(type), kSrpDot); - - auto sdRefSrp = sdCtx->serviceRef; // Mandatory copy because of kDNSServiceFlagsShareConnection - err = DNSServiceBrowse(&sdRefSrp, kBrowseFlags, interfaceId, type, kSrpDot, OnBrowse, sdCtx); + ChipLogProgress(Discovery, "Browsing for: %s", StringOrNullMarker(type)); + DNSServiceRef sdRef; + auto err = DNSServiceBrowse(&sdRef, kBrowseFlags, interfaceId, type, kLocalDot, OnBrowse, sdCtx); VerifyOrReturnError(kDNSServiceErr_NoError == err, sdCtx->Finalize(err)); - return MdnsContexts::GetInstance().Add(sdCtx, sdCtx->serviceRef); + return MdnsContexts::GetInstance().Add(sdCtx, sdRef); } + CHIP_ERROR Browse(void * context, DnssdBrowseCallback callback, uint32_t interfaceId, const char * type, DnssdServiceProtocol protocol, intptr_t * browseIdentifier) { @@ -293,64 +219,25 @@ static void OnGetAddrInfo(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t i ReturnOnFailure(MdnsContexts::GetInstance().Has(sdCtx)); LogOnFailure(__func__, err); - std::string domainName = GetDomainFromHostName(hostname); - if (domainName.empty()) - { - ChipLogError(Discovery, "Mdns: Domain name is not set in hostname %s", hostname); - return; - } if (kDNSServiceErr_NoError == err) { - std::pair key = std::make_pair(interfaceId, domainName); - sdCtx->OnNewAddress(key, address); + sdCtx->OnNewAddress(interfaceId, address); } if (!(flags & kDNSServiceFlagsMoreComing)) { VerifyOrReturn(sdCtx->HasAddress(), sdCtx->Finalize(kDNSServiceErr_BadState)); - - if (domainName.compare(kSrpDot) == 0) - { - ChipLogProgress(Discovery, "Mdns: Resolve completed on the srp domain."); - - // Cancel the timer if one has been started - if (sdCtx->hasSrpTimerStarted) - { - CancelSrpTimer(sdCtx); - } - sdCtx->Finalize(); - } - else if (domainName.compare(kLocalDot) == 0) - { - ChipLogProgress(Discovery, - "Mdns: Resolve completed on the local domain. Starting a timer for the srp resolve to come back"); - - // Usually the resolution on the local domain is quicker than on the srp domain. We would like to give the - // resolution on the srp domain around 250 millisecs more to give it a chance to resolve before finalizing - // the resolution. - if (!sdCtx->hasSrpTimerStarted) - { - // Schedule a timer to allow the resolve on Srp domain to complete. - CHIP_ERROR error = StartSrpTimer(kSrpTimeoutInMsec, sdCtx); - - // If the timer fails to start, finalize the context and return. - if (error != CHIP_NO_ERROR) - { - sdCtx->Finalize(); - return; - } - sdCtx->hasSrpTimerStarted = true; - } - } + sdCtx->Finalize(); } } static void GetAddrInfo(ResolveContext * sdCtx) { auto protocol = sdCtx->protocol; + for (auto & interface : sdCtx->interfaces) { - auto interfaceId = interface.first.first; + auto interfaceId = interface.first; auto hostname = interface.second.fullyQualifiedDomainName.c_str(); auto sdRefCopy = sdCtx->serviceRef; // Mandatory copy because of kDNSServiceFlagsShareConnection auto err = DNSServiceGetAddrInfo(&sdRefCopy, kGetAddrInfoFlags, interfaceId, protocol, hostname, OnGetAddrInfo, sdCtx); @@ -376,13 +263,7 @@ static void OnResolve(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t inter if (!(flags & kDNSServiceFlagsMoreComing)) { VerifyOrReturn(sdCtx->HasInterface(), sdCtx->Finalize(kDNSServiceErr_BadState)); - - // If a resolve was not requested on this context, call GetAddrInfo and set the isResolveRequested flag to true. - if (!sdCtx->isResolveRequested) - { - GetAddrInfo(sdCtx); - sdCtx->isResolveRequested = true; - } + GetAddrInfo(sdCtx); } } @@ -395,13 +276,8 @@ static CHIP_ERROR Resolve(ResolveContext * sdCtx, uint32_t interfaceId, chip::In auto err = DNSServiceCreateConnection(&sdCtx->serviceRef); VerifyOrReturnError(kDNSServiceErr_NoError == err, sdCtx->Finalize(err)); - // Similar to browse, will try to resolve using both the local domain and the srp domain. - auto sdRefLocal = sdCtx->serviceRef; // Mandatory copy because of kDNSServiceFlagsShareConnection - err = DNSServiceResolve(&sdRefLocal, kResolveFlags, interfaceId, name, type, kLocalDot, OnResolve, sdCtx); - VerifyOrReturnError(kDNSServiceErr_NoError == err, sdCtx->Finalize(err)); - - auto sdRefSrp = sdCtx->serviceRef; // Mandatory copy because of kDNSServiceFlagsShareConnection - err = DNSServiceResolve(&sdRefSrp, kResolveFlags, interfaceId, name, type, kSrpDot, OnResolve, sdCtx); + auto sdRefCopy = sdCtx->serviceRef; // Mandatory copy because of kDNSServiceFlagsShareConnection + err = DNSServiceResolve(&sdRefCopy, kResolveFlags, interfaceId, name, type, kLocalDot, OnResolve, sdCtx); VerifyOrReturnError(kDNSServiceErr_NoError == err, sdCtx->Finalize(err)); auto retval = MdnsContexts::GetInstance().Add(sdCtx, sdCtx->serviceRef); @@ -463,7 +339,7 @@ CHIP_ERROR ChipDnssdPublishService(const DnssdService * service, DnssdPublishCal auto regtype = GetFullTypeWithSubTypes(service); auto interfaceId = GetInterfaceId(service->mInterface); - auto hostname = GetHostNameWithLocalDomain(service->mHostName); + auto hostname = GetHostNameWithDomain(service->mHostName); return Register(context, callback, interfaceId, regtype.c_str(), service->mName, service->mPort, record, service->mAddressType, hostname.c_str()); @@ -609,7 +485,7 @@ CHIP_ERROR ChipDnssdReconfirmRecord(const char * hostname, chip::Inet::IPAddress auto interfaceId = interface.GetPlatformInterface(); auto rrclass = kDNSServiceClass_IN; - auto fullname = GetHostNameWithLocalDomain(hostname); + auto fullname = GetHostNameWithDomain(hostname); uint16_t rrtype; uint16_t rdlen; diff --git a/src/platform/Darwin/DnssdImpl.h b/src/platform/Darwin/DnssdImpl.h index 8a9853082b59ee..18f1d93baaab27 100644 --- a/src/platform/Darwin/DnssdImpl.h +++ b/src/platform/Darwin/DnssdImpl.h @@ -30,14 +30,6 @@ namespace chip { namespace Dnssd { -struct BrowseWithDelegateContext; -struct RegisterContext; -struct ResolveContext; - -std::string GetDomainFromHostName(const char * hostname); - -void CancelSrpTimer(ResolveContext * ctx); - enum class ContextType { Register, @@ -64,6 +56,10 @@ struct GenericContext CHIP_ERROR FinalizeInternal(const char * errorStr, CHIP_ERROR err); }; +struct BrowseWithDelegateContext; +struct RegisterContext; +struct ResolveContext; + class MdnsContexts { public: @@ -231,13 +227,11 @@ struct InterfaceInfo struct ResolveContext : public GenericContext { DnssdResolveCallback callback; - std::map, InterfaceInfo> interfaces; + std::map interfaces; DNSServiceProtocol protocol; std::string instanceName; - bool isResolveRequested = false; std::shared_ptr consumerCounter; BrowseContext * const browseThatCausedResolve; // Can be null - bool hasSrpTimerStarted = false; // browseCausingResolve can be null. ResolveContext(void * cbContext, DnssdResolveCallback cb, chip::Inet::IPAddressType cbAddressType, @@ -250,7 +244,7 @@ struct ResolveContext : public GenericContext void DispatchFailure(const char * errorStr, CHIP_ERROR err) override; void DispatchSuccess() override; - CHIP_ERROR OnNewAddress(const std::pair & interfaceKey, const struct sockaddr * address); + CHIP_ERROR OnNewAddress(uint32_t interfaceId, const struct sockaddr * address); bool HasAddress(); void OnNewInterface(uint32_t interfaceId, const char * fullname, const char * hostname, uint16_t port, uint16_t txtLen, diff --git a/src/platform/Darwin/PlatformManagerImpl.cpp b/src/platform/Darwin/PlatformManagerImpl.cpp index 5db5c69f2656b0..0edc652ed827f2 100644 --- a/src/platform/Darwin/PlatformManagerImpl.cpp +++ b/src/platform/Darwin/PlatformManagerImpl.cpp @@ -169,7 +169,10 @@ dispatch_queue_t PlatformManagerImpl::GetWorkQueue() { if (mWorkQueue == nullptr) { - mWorkQueue = dispatch_queue_create(CHIP_CONTROLLER_QUEUE, DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + mWorkQueue = + dispatch_queue_create(CHIP_CONTROLLER_QUEUE, + dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL, + QOS_CLASS_USER_INITIATED, QOS_MIN_RELATIVE_PRIORITY)); dispatch_suspend(mWorkQueue); dispatch_queue_set_specific(mWorkQueue, &sPlatformManagerKey, this, nullptr); mIsWorkQueueSuspended = true; diff --git a/src/platform/Linux/BLEManagerImpl.cpp b/src/platform/Linux/BLEManagerImpl.cpp index e472e805a1154e..36b74308638300 100644 --- a/src/platform/Linux/BLEManagerImpl.cpp +++ b/src/platform/Linux/BLEManagerImpl.cpp @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -123,6 +124,7 @@ void BLEManagerImpl::_Shutdown() DeviceLayer::SystemLayer().CancelTimer(HandleConnectTimeout, &mEndpoint); // Release BLE connection resources (unregister from BlueZ). mEndpoint.Shutdown(); + mBluezObjectManager.Shutdown(); mFlags.Clear(Flags::kBluezBLELayerInitialized); } @@ -251,8 +253,7 @@ void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) void BLEManagerImpl::HandlePlatformSpecificBLEEvent(const ChipDeviceEvent * apEvent) { - CHIP_ERROR err = CHIP_NO_ERROR; - bool controlOpComplete = false; + CHIP_ERROR err = CHIP_NO_ERROR; ChipLogDetail(DeviceLayer, "HandlePlatformSpecificBLEEvent %d", apEvent->Type); switch (apEvent->Type) { @@ -288,7 +289,7 @@ void BLEManagerImpl::HandlePlatformSpecificBLEEvent(const ChipDeviceEvent * apEv break; case DeviceEventType::kPlatformLinuxBLEPeripheralAdvStartComplete: SuccessOrExit(err = apEvent->Platform.BLEPeripheralAdvStartComplete.mError); - sInstance.mFlags.Clear(Flags::kControlOpInProgress).Clear(Flags::kAdvertisingRefreshNeeded); + mFlags.Clear(Flags::kControlOpInProgress).Clear(Flags::kAdvertisingRefreshNeeded); // Do not restart the timer if it is still active. This is to avoid the timer from being restarted // if the advertising is stopped due to a premature release. if (!DeviceLayer::SystemLayer().IsTimerActive(HandleAdvertisingTimer, this)) @@ -296,29 +297,29 @@ void BLEManagerImpl::HandlePlatformSpecificBLEEvent(const ChipDeviceEvent * apEv // Start a timer to make sure that the fast advertising is stopped after specified timeout. SuccessOrExit(err = DeviceLayer::SystemLayer().StartTimer(kFastAdvertiseTimeout, HandleAdvertisingTimer, this)); } - sInstance.mFlags.Set(Flags::kAdvertising); + mFlags.Set(Flags::kAdvertising); break; case DeviceEventType::kPlatformLinuxBLEPeripheralAdvStopComplete: SuccessOrExit(err = apEvent->Platform.BLEPeripheralAdvStopComplete.mError); - sInstance.mFlags.Clear(Flags::kControlOpInProgress).Clear(Flags::kAdvertisingRefreshNeeded); + mFlags.Clear(Flags::kControlOpInProgress).Clear(Flags::kAdvertisingRefreshNeeded); DeviceLayer::SystemLayer().CancelTimer(HandleAdvertisingTimer, this); - // Transition to the not Advertising state... - if (sInstance.mFlags.Has(Flags::kAdvertising)) + if (mFlags.Has(Flags::kAdvertising)) { - sInstance.mFlags.Clear(Flags::kAdvertising); + mFlags.Clear(Flags::kAdvertising); ChipLogProgress(DeviceLayer, "CHIPoBLE advertising stopped"); } break; case DeviceEventType::kPlatformLinuxBLEPeripheralAdvReleased: // If the advertising was stopped due to a premature release, check if it needs to be restarted. - sInstance.mFlags.Clear(Flags::kAdvertising); + mFlags.Clear(Flags::kAdvertising); DriveBLEState(); break; case DeviceEventType::kPlatformLinuxBLEPeripheralRegisterAppComplete: SuccessOrExit(err = apEvent->Platform.BLEPeripheralRegisterAppComplete.mError); + mFlags.Clear(Flags::kControlOpInProgress); mFlags.Set(Flags::kAppRegistered); - controlOpComplete = true; + DriveBLEState(); break; default: break; @@ -330,13 +331,7 @@ void BLEManagerImpl::HandlePlatformSpecificBLEEvent(const ChipDeviceEvent * apEv ChipLogError(DeviceLayer, "Disabling CHIPoBLE service due to error: %s", ErrorStr(err)); mServiceMode = ConnectivityManager::kCHIPoBLEServiceMode_Disabled; DeviceLayer::SystemLayer().CancelTimer(HandleAdvertisingTimer, this); - sInstance.mFlags.Clear(Flags::kControlOpInProgress); - } - - if (controlOpComplete) - { mFlags.Clear(Flags::kControlOpInProgress); - DriveBLEState(); } } @@ -587,11 +582,25 @@ void BLEManagerImpl::DriveBLEState() // If there's already a control operation in progress, wait until it completes. VerifyOrExit(!mFlags.Has(Flags::kControlOpInProgress), /* */); - // Initializes the Bluez BLE layer if needed. - if (mServiceMode == ConnectivityManager::kCHIPoBLEServiceMode_Enabled && !mFlags.Has(Flags::kBluezBLELayerInitialized)) + // Initializes the BlueZ BLE layer if needed. + if (mServiceMode == ConnectivityManager::kCHIPoBLEServiceMode_Enabled) { - SuccessOrExit(err = mEndpoint.Init(mIsCentral, mAdapterId)); - mFlags.Set(Flags::kBluezBLELayerInitialized); + if (!mFlags.Has(Flags::kBluezManagerInitialized)) + { + SuccessOrExit(err = mBluezObjectManager.Init()); + mFlags.Set(Flags::kBluezManagerInitialized); + } + if (!mFlags.Has(Flags::kBluezAdapterAvailable)) + { + mAdapter.reset(mBluezObjectManager.GetAdapter(mAdapterId)); + VerifyOrExit(mAdapter, err = BLE_ERROR_ADAPTER_UNAVAILABLE); + mFlags.Set(Flags::kBluezAdapterAvailable); + } + if (!mFlags.Has(Flags::kBluezBLELayerInitialized)) + { + SuccessOrExit(err = mEndpoint.Init(mAdapter.get(), mIsCentral)); + mFlags.Set(Flags::kBluezBLELayerInitialized); + } } // Register the CHIPoBLE application with the Bluez BLE layer if needed. @@ -614,7 +623,7 @@ void BLEManagerImpl::DriveBLEState() // Configure advertising data if it hasn't been done yet. if (!mFlags.Has(Flags::kAdvertisingConfigured)) { - SuccessOrExit(err = mBLEAdvertisement.Init(mEndpoint, mpBLEAdvUUID, mDeviceName)); + SuccessOrExit(err = mBLEAdvertisement.Init(mAdapter.get(), mpBLEAdvUUID, mDeviceName)); mFlags.Set(Flags::kAdvertisingConfigured); } @@ -724,33 +733,25 @@ void BLEManagerImpl::InitiateScan(BleScanState scanType) if (scanType == BleScanState::kNotScanning) { - BleConnectionDelegate::OnConnectionError(mBLEScanConfig.mAppState, CHIP_ERROR_INCORRECT_STATE); ChipLogError(Ble, "Invalid scan type requested"); - return; - } - - if (!mFlags.Has(Flags::kBluezBLELayerInitialized)) - { BleConnectionDelegate::OnConnectionError(mBLEScanConfig.mAppState, CHIP_ERROR_INCORRECT_STATE); - ChipLogError(Ble, "BLE Layer is not yet initialized"); return; } - if (mEndpoint.GetAdapter() == nullptr) + if (!mFlags.Has(Flags::kBluezAdapterAvailable)) { - BleConnectionDelegate::OnConnectionError(mBLEScanConfig.mAppState, CHIP_ERROR_INCORRECT_STATE); - ChipLogError(Ble, "No adapter available for new connection establishment"); + BleConnectionDelegate::OnConnectionError(mBLEScanConfig.mAppState, BLE_ERROR_ADAPTER_UNAVAILABLE); return; } mBLEScanConfig.mBleScanState = scanType; - CHIP_ERROR err = mDeviceScanner.Init(mEndpoint.GetAdapter(), this); + CHIP_ERROR err = mDeviceScanner.Init(mAdapter.get(), this); if (err != CHIP_NO_ERROR) { mBLEScanConfig.mBleScanState = BleScanState::kNotScanning; + ChipLogError(Ble, "Failed to create a BLE device scanner: %" CHIP_ERROR_FORMAT, err.Format()); BleConnectionDelegate::OnConnectionError(mBLEScanConfig.mAppState, CHIP_ERROR_INTERNAL); - ChipLogError(Ble, "Failed to create a BLE device scanner"); return; } @@ -758,7 +759,7 @@ void BLEManagerImpl::InitiateScan(BleScanState scanType) if (err != CHIP_NO_ERROR) { mBLEScanConfig.mBleScanState = BleScanState::kNotScanning; - ChipLogError(Ble, "Failed to start a BLE can: %s", chip::ErrorStr(err)); + ChipLogError(Ble, "Failed to start a BLE can: %" CHIP_ERROR_FORMAT, err.Format()); BleConnectionDelegate::OnConnectionError(mBLEScanConfig.mAppState, err); return; } diff --git a/src/platform/Linux/BLEManagerImpl.h b/src/platform/Linux/BLEManagerImpl.h index 790373c28b3830..24533762040db6 100644 --- a/src/platform/Linux/BLEManagerImpl.h +++ b/src/platform/Linux/BLEManagerImpl.h @@ -31,6 +31,7 @@ #include "bluez/BluezAdvertisement.h" #include "bluez/BluezEndpoint.h" +#include "bluez/BluezObjectManager.h" #include "bluez/ChipDeviceScanner.h" #include "bluez/Types.h" @@ -159,16 +160,18 @@ class BLEManagerImpl final : public BLEManager, enum class Flags : uint16_t { kAsyncInitCompleted = 0x0001, /**< One-time asynchronous initialization actions have been performed. */ - kBluezBLELayerInitialized = 0x0002, /**< The Bluez layer has been initialized. */ - kAppRegistered = 0x0004, /**< The CHIPoBLE application has been registered with the Bluez layer. */ - kAdvertisingConfigured = 0x0008, /**< CHIPoBLE advertising has been configured in the Bluez layer. */ - kAdvertising = 0x0010, /**< The system is currently CHIPoBLE advertising. */ - kControlOpInProgress = 0x0020, /**< An async control operation has been issued to the ESP BLE layer. */ - kAdvertisingEnabled = 0x0040, /**< The application has enabled CHIPoBLE advertising. */ - kFastAdvertisingEnabled = 0x0080, /**< The application has enabled fast advertising. */ - kUseCustomDeviceName = 0x0100, /**< The application has configured a custom BLE device name. */ - kAdvertisingRefreshNeeded = 0x0200, /**< The advertising configuration/state in BLE layer needs to be updated. */ - kExtAdvertisingEnabled = 0x0400, /**< The application has enabled CHIPoBLE extended advertising. */ + kBluezManagerInitialized = 0x0002, /**< The BlueZ object manager has been initialized. */ + kBluezAdapterAvailable = 0x0004, /**< Selected BlueZ adapter is available for use. */ + kBluezBLELayerInitialized = 0x0008, /**< The BlueZ BLE layer has been initialized. */ + kAppRegistered = 0x0010, /**< The CHIPoBLE application has been registered with the Bluez layer. */ + kAdvertisingConfigured = 0x0020, /**< CHIPoBLE advertising has been configured in the Bluez layer. */ + kAdvertising = 0x0040, /**< The system is currently CHIPoBLE advertising. */ + kControlOpInProgress = 0x0080, /**< An async control operation has been issued to the ESP BLE layer. */ + kAdvertisingEnabled = 0x0100, /**< The application has enabled CHIPoBLE advertising. */ + kFastAdvertisingEnabled = 0x0200, /**< The application has enabled fast advertising. */ + kUseCustomDeviceName = 0x0400, /**< The application has configured a custom BLE device name. */ + kAdvertisingRefreshNeeded = 0x0800, /**< The advertising configuration/state in BLE layer needs to be updated. */ + kExtAdvertisingEnabled = 0x1000, /**< The application has enabled CHIPoBLE extended advertising. */ }; enum @@ -187,15 +190,18 @@ class BLEManagerImpl final : public BLEManager, CHIPoBLEServiceMode mServiceMode; BitFlags mFlags; + BluezObjectManager mBluezObjectManager; + GAutoPtr mAdapter; uint32_t mAdapterId = 0; + char mDeviceName[kMaxDeviceNameLength + 1]; bool mIsCentral = false; - BluezEndpoint mEndpoint; + BluezEndpoint mEndpoint{ mBluezObjectManager }; - BluezAdvertisement mBLEAdvertisement; + BluezAdvertisement mBLEAdvertisement{ mEndpoint }; const char * mpBLEAdvUUID = nullptr; - ChipDeviceScanner mDeviceScanner; + ChipDeviceScanner mDeviceScanner{ mBluezObjectManager }; BLEScanConfig mBLEScanConfig; }; diff --git a/src/platform/Linux/BUILD.gn b/src/platform/Linux/BUILD.gn index 4f28b2d520e066..d73a2dcb0fc13c 100644 --- a/src/platform/Linux/BUILD.gn +++ b/src/platform/Linux/BUILD.gn @@ -103,6 +103,8 @@ static_library("Linux") { "bluez/BluezEndpoint.h", "bluez/BluezObjectIterator.h", "bluez/BluezObjectList.h", + "bluez/BluezObjectManager.cpp", + "bluez/BluezObjectManager.h", "bluez/ChipDeviceScanner.cpp", "bluez/ChipDeviceScanner.h", "bluez/Types.h", diff --git a/src/platform/Linux/bluez/AdapterIterator.cpp b/src/platform/Linux/bluez/AdapterIterator.cpp index 0455359f424bfb..dd51ea470ae319 100644 --- a/src/platform/Linux/bluez/AdapterIterator.cpp +++ b/src/platform/Linux/bluez/AdapterIterator.cpp @@ -17,48 +17,25 @@ #include "AdapterIterator.h" +#include + +#include + +#include #include #include #include -#include +#include + +#include "BluezObjectIterator.h" +#include "BluezObjectList.h" +#include "BluezObjectManager.h" +#include "Types.h" namespace chip { namespace DeviceLayer { namespace Internal { -CHIP_ERROR AdapterIterator::Initialize() -{ - // When creating D-Bus proxy object, the thread default context must be initialized. Otherwise, - // all D-Bus signals will be delivered to the GLib global default main context. - VerifyOrDie(g_main_context_get_thread_default() != nullptr); - - GAutoPtr error; - mManager.reset(g_dbus_object_manager_client_new_for_bus_sync( - G_BUS_TYPE_SYSTEM, G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE, BLUEZ_INTERFACE, "/", - bluez_object_manager_client_get_proxy_type, nullptr /* unused user data in the Proxy Type Func */, - nullptr /* destroy notify */, nullptr /* cancellable */, &error.GetReceiver())); - - VerifyOrReturnError(mManager, CHIP_ERROR_INTERNAL, - ChipLogError(DeviceLayer, "Failed to get D-Bus object manager for listing adapters: %s", error->message)); - - mObjectList.Init(mManager.get()); - mIterator = mObjectList.begin(); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR AdapterIterator::Shutdown() -{ - // Release resources on the glib thread to synchronize with potential signal handlers - // attached to the manager client object that may run on the glib thread. - return PlatformMgrImpl().GLibMatterContextInvokeSync( - +[](AdapterIterator * self) { - self->mManager.reset(); - return CHIP_NO_ERROR; - }, - this); -} - bool AdapterIterator::Advance() { for (; mIterator != BluezObjectList::end(); ++mIterator) @@ -93,11 +70,15 @@ uint32_t AdapterIterator::GetIndex() const bool AdapterIterator::Next() { - if (!mManager) + if (!mIsInitialized) { - CHIP_ERROR err = PlatformMgrImpl().GLibMatterContextInvokeSync( - +[](AdapterIterator * self) { return self->Initialize(); }, this); - VerifyOrReturnError(err == CHIP_NO_ERROR, false, ChipLogError(DeviceLayer, "Failed to initialize adapter iterator")); + CHIP_ERROR err = mObjectManager.Init(); + VerifyOrReturnError( + err == CHIP_NO_ERROR, false, + ChipLogError(DeviceLayer, "Failed to initialize BlueZ object manager: %" CHIP_ERROR_FORMAT, err.Format())); + mObjectList.Init(mObjectManager.GetObjectManager()); + mIterator = mObjectList.begin(); + mIsInitialized = true; } return Advance(); diff --git a/src/platform/Linux/bluez/AdapterIterator.h b/src/platform/Linux/bluez/AdapterIterator.h index c998df602f81fc..3de2db068fb634 100644 --- a/src/platform/Linux/bluez/AdapterIterator.h +++ b/src/platform/Linux/bluez/AdapterIterator.h @@ -19,13 +19,11 @@ #include -#include - -#include #include #include -#include "BluezObjectList.h" +#include "BluezObjectIterator.h" +#include "BluezObjectManager.h" #include "Types.h" namespace chip { @@ -49,7 +47,7 @@ class AdapterIterator { public: AdapterIterator() = default; - ~AdapterIterator() { Shutdown(); } + ~AdapterIterator() { mObjectManager.Shutdown(); } /// Moves to the next DBUS interface. /// @@ -67,18 +65,15 @@ class AdapterIterator BluezAdapter1 * GetAdapter() const { return mCurrentAdapter.get(); } private: - /// Sets up the DBUS manager and loads the list - CHIP_ERROR Initialize(); - /// Destroys the DBUS manager - CHIP_ERROR Shutdown(); - /// Loads the next value in the list. /// /// Returns true if a value could be loaded, false if no more items to /// iterate through. bool Advance(); - GAutoPtr mManager; + BluezObjectManager mObjectManager; + bool mIsInitialized = false; + BluezObjectList mObjectList; BluezObjectIterator mIterator; // Data valid only if Next() returns true diff --git a/src/platform/Linux/bluez/BluezAdvertisement.cpp b/src/platform/Linux/bluez/BluezAdvertisement.cpp index db44bd6a8e2b34..aa5135d00beda3 100644 --- a/src/platform/Linux/bluez/BluezAdvertisement.cpp +++ b/src/platform/Linux/bluez/BluezAdvertisement.cpp @@ -82,7 +82,7 @@ BluezLEAdvertisement1 * BluezAdvertisement::CreateLEAdvertisement() }), this); - g_dbus_object_manager_server_export(mRoot.get(), G_DBUS_OBJECT_SKELETON(object)); + g_dbus_object_manager_server_export(mEndpoint.GetGattApplicationObjectManager(), G_DBUS_OBJECT_SKELETON(object)); g_object_unref(object); return adv; @@ -108,16 +108,15 @@ CHIP_ERROR BluezAdvertisement::InitImpl() return CHIP_NO_ERROR; } -CHIP_ERROR BluezAdvertisement::Init(const BluezEndpoint & aEndpoint, const char * aAdvUUID, const char * aAdvName) +CHIP_ERROR BluezAdvertisement::Init(BluezAdapter1 * apAdapter, const char * aAdvUUID, const char * aAdvName) { VerifyOrReturnError(!mAdv, CHIP_ERROR_INCORRECT_STATE, ChipLogError(DeviceLayer, "FAIL: BLE advertisement already initialized in %s", __func__)); - mRoot.reset(reinterpret_cast(g_object_ref(aEndpoint.GetGattApplicationObjectManager()))); - mAdapter.reset(reinterpret_cast(g_object_ref(aEndpoint.GetAdapter()))); + mAdapter.reset(reinterpret_cast(g_object_ref(apAdapter))); GAutoPtr rootPath; - g_object_get(G_OBJECT(mRoot.get()), "object-path", &rootPath.GetReceiver(), nullptr); + g_object_get(G_OBJECT(mEndpoint.GetGattApplicationObjectManager()), "object-path", &rootPath.GetReceiver(), nullptr); g_snprintf(mAdvPath, sizeof(mAdvPath), "%s/advertising", rootPath.get()); g_strlcpy(mAdvUUID, aAdvUUID, sizeof(mAdvUUID)); @@ -205,11 +204,10 @@ void BluezAdvertisement::Shutdown() // attached to the advertising object that may run on the glib thread. PlatformMgrImpl().GLibMatterContextInvokeSync( +[](BluezAdvertisement * self) { - // The object manager server (mRoot) might not be released right away (it may be held + // The application object manager might not be released right away (it may be held // by other BLE layer objects). We need to unexport the advertisement object in the // explicit way to make sure that we can export it again in the Init() method. - g_dbus_object_manager_server_unexport(self->mRoot.get(), self->mAdvPath); - self->mRoot.reset(); + g_dbus_object_manager_server_unexport(self->mEndpoint.GetGattApplicationObjectManager(), self->mAdvPath); self->mAdapter.reset(); self->mAdv.reset(); return CHIP_NO_ERROR; @@ -226,16 +224,7 @@ void BluezAdvertisement::StartDone(GObject * aObject, GAsyncResult * aResult) aResult, &error.GetReceiver())) { ChipLogError(DeviceLayer, "FAIL: RegisterAdvertisement: %s", error->message); - switch (error->code) - { - case G_DBUS_ERROR_NO_REPLY: // BlueZ crashed or the D-Bus connection is broken - case G_DBUS_ERROR_SERVICE_UNKNOWN: // BlueZ service is not available on the bus - case G_DBUS_ERROR_UNKNOWN_OBJECT: // Requested BLE adapter is not available - BLEManagerImpl::NotifyBLEPeripheralAdvStartComplete(BLE_ERROR_ADAPTER_UNAVAILABLE); - break; - default: - BLEManagerImpl::NotifyBLEPeripheralAdvStartComplete(CHIP_ERROR_INTERNAL); - } + BLEManagerImpl::NotifyBLEPeripheralAdvStartComplete(BluezCallToChipError(error.get())); return; } @@ -290,16 +279,7 @@ void BluezAdvertisement::StopDone(GObject * aObject, GAsyncResult * aResult) aResult, &error.GetReceiver())) { ChipLogError(DeviceLayer, "FAIL: UnregisterAdvertisement: %s", error->message); - switch (error->code) - { - case G_DBUS_ERROR_NO_REPLY: // BlueZ crashed or the D-Bus connection is broken - case G_DBUS_ERROR_SERVICE_UNKNOWN: // BlueZ service is not available on the bus - case G_DBUS_ERROR_UNKNOWN_OBJECT: // Requested BLE adapter is not available - BLEManagerImpl::NotifyBLEPeripheralAdvStopComplete(BLE_ERROR_ADAPTER_UNAVAILABLE); - break; - default: - BLEManagerImpl::NotifyBLEPeripheralAdvStopComplete(CHIP_ERROR_INTERNAL); - } + BLEManagerImpl::NotifyBLEPeripheralAdvStopComplete(BluezCallToChipError(error.get())); return; } diff --git a/src/platform/Linux/bluez/BluezAdvertisement.h b/src/platform/Linux/bluez/BluezAdvertisement.h index 559f13f2082dfa..f1ee9aee21e15d 100644 --- a/src/platform/Linux/bluez/BluezAdvertisement.h +++ b/src/platform/Linux/bluez/BluezAdvertisement.h @@ -46,10 +46,10 @@ class BluezAdvertisement static constexpr ServiceDataFlags kServiceDataNone = 0; static constexpr ServiceDataFlags kServiceDataExtendedAnnouncement = 1 << 0; - BluezAdvertisement() = default; + BluezAdvertisement(BluezEndpoint & aEndpoint) : mEndpoint(aEndpoint) {} ~BluezAdvertisement() { Shutdown(); } - CHIP_ERROR Init(const BluezEndpoint & aEndpoint, const char * aAdvUUID, const char * aAdvName); + CHIP_ERROR Init(BluezAdapter1 * apAdapter, const char * aAdvUUID, const char * aAdvName); CHIP_ERROR SetupServiceData(ServiceDataFlags aFlags); CHIP_ERROR SetIntervals(AdvertisingIntervals aAdvIntervals); void Shutdown(); @@ -81,8 +81,7 @@ class BluezAdvertisement void StopDone(GObject * aObject, GAsyncResult * aResult); CHIP_ERROR StopImpl(); - // Objects (interfaces) used by LE advertisement - GAutoPtr mRoot; + BluezEndpoint & mEndpoint; GAutoPtr mAdapter; GAutoPtr mAdv; diff --git a/src/platform/Linux/bluez/BluezConnection.cpp b/src/platform/Linux/bluez/BluezConnection.cpp index 7f5d6326506528..87c74bb917f54c 100644 --- a/src/platform/Linux/bluez/BluezConnection.cpp +++ b/src/platform/Linux/bluez/BluezConnection.cpp @@ -34,7 +34,6 @@ #include #include "BluezEndpoint.h" -#include "BluezObjectList.h" #include "Types.h" namespace chip { @@ -89,7 +88,7 @@ CHIP_ERROR BluezConnection::Init(const BluezEndpoint & aEndpoint) } else { - for (BluezObject & object : BluezObjectList(aEndpoint.mObjMgr.get())) + for (BluezObject & object : aEndpoint.mObjectManager.GetObjects()) { BluezGattService1 * service = bluez_object_get_gatt_service1(&object); if (service != nullptr) @@ -106,7 +105,7 @@ CHIP_ERROR BluezConnection::Init(const BluezEndpoint & aEndpoint) VerifyOrExit(mService, ChipLogError(DeviceLayer, "FAIL: NULL service in %s", __func__)); - for (BluezObject & object : BluezObjectList(aEndpoint.mObjMgr.get())) + for (BluezObject & object : aEndpoint.mObjectManager.GetObjects()) { BluezGattCharacteristic1 * char1 = bluez_object_get_gatt_characteristic1(&object); if (char1 != nullptr) diff --git a/src/platform/Linux/bluez/BluezEndpoint.cpp b/src/platform/Linux/bluez/BluezEndpoint.cpp index e622407c6e18d9..d8969d9b58a62f 100644 --- a/src/platform/Linux/bluez/BluezEndpoint.cpp +++ b/src/platform/Linux/bluez/BluezEndpoint.cpp @@ -73,7 +73,6 @@ #include #include "BluezConnection.h" -#include "BluezObjectList.h" #include "Types.h" namespace chip { @@ -268,16 +267,7 @@ void BluezEndpoint::RegisterGattApplicationDone(GObject * aObject, GAsyncResult &error.GetReceiver())) { ChipLogError(DeviceLayer, "FAIL: RegisterGattApplication: %s", error->message); - switch (error->code) - { - case G_DBUS_ERROR_NO_REPLY: // BlueZ crashed or the D-Bus connection is broken - case G_DBUS_ERROR_SERVICE_UNKNOWN: // BlueZ service is not available on the bus - case G_DBUS_ERROR_UNKNOWN_OBJECT: // Requested BLE adapter is not available - BLEManagerImpl::NotifyBLEPeripheralRegisterAppComplete(BLE_ERROR_ADAPTER_UNAVAILABLE); - break; - default: - BLEManagerImpl::NotifyBLEPeripheralRegisterAppComplete(CHIP_ERROR_INTERNAL); - } + BLEManagerImpl::NotifyBLEPeripheralRegisterAppComplete(BluezCallToChipError(error.get())); return; } @@ -412,47 +402,6 @@ BluezGattService1 * BluezEndpoint::CreateGattService(const char * aUUID) return service; } -CHIP_ERROR BluezEndpoint::SetupAdapter() -{ - char expectedPath[32]; - snprintf(expectedPath, sizeof(expectedPath), BLUEZ_PATH "/hci%u", mAdapterId); - - for (BluezObject & object : BluezObjectList(mObjMgr.get())) - { - GAutoPtr adapter(bluez_object_get_adapter1(&object)); - if (adapter) - { - if (mpAdapterAddr == nullptr) // no adapter address provided, bind to the hci indicated by nodeid - { - if (strcmp(g_dbus_proxy_get_object_path(G_DBUS_PROXY(adapter.get())), expectedPath) == 0) - { - mAdapter.reset(static_cast(g_object_ref(adapter.get()))); - break; - } - } - else - { - if (strcmp(bluez_adapter1_get_address(adapter.get()), mpAdapterAddr) == 0) - { - mAdapter.reset(static_cast(g_object_ref(adapter.get()))); - break; - } - } - } - } - - VerifyOrReturnError(mAdapter, CHIP_ERROR_INTERNAL, ChipLogError(DeviceLayer, "FAIL: NULL mAdapter in %s", __func__)); - - bluez_adapter1_set_powered(mAdapter.get(), TRUE); - - // Setting "Discoverable" to False on the adapter and to True on the advertisement convinces - // Bluez to set "BR/EDR Not Supported" flag. Bluez doesn't provide API to do that explicitly - // and the flag is necessary to force using LE transport. - bluez_adapter1_set_discoverable(mAdapter.get(), FALSE); - - return CHIP_NO_ERROR; -} - BluezConnection * BluezEndpoint::GetBluezConnection(const char * aPath) { auto it = mConnMap.find(aPath); @@ -594,7 +543,7 @@ void BluezEndpoint::SetupGattServer(GDBusConnection * aConn) g_dbus_object_manager_server_set_connection(mRoot.get(), aConn); } -CHIP_ERROR BluezEndpoint::StartupEndpointBindings() +CHIP_ERROR BluezEndpoint::SetupEndpointBindings() { GAutoPtr err; GAutoPtr conn(g_bus_get_sync(G_BUS_TYPE_SYSTEM, nullptr, &err.GetReceiver())); @@ -603,32 +552,23 @@ CHIP_ERROR BluezEndpoint::StartupEndpointBindings() SetupGattServer(conn.get()); - mObjMgr.reset(g_dbus_object_manager_client_new_sync( - conn.get(), G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE, BLUEZ_INTERFACE, "/", bluez_object_manager_client_get_proxy_type, - nullptr /* unused user data in the Proxy Type Func */, nullptr /*destroy notify */, nullptr /* cancellable */, - &err.GetReceiver())); - VerifyOrReturnError(mObjMgr, CHIP_ERROR_INTERNAL, - ChipLogError(DeviceLayer, "FAIL: Error getting object manager client: %s", err->message)); - - g_signal_connect(mObjMgr.get(), "object-added", + g_signal_connect(mObjectManager.GetObjectManager(), "object-added", G_CALLBACK(+[](GDBusObjectManager * aMgr, GDBusObject * aObj, BluezEndpoint * self) { return self->BluezSignalOnObjectAdded(aMgr, aObj); }), this); - g_signal_connect(mObjMgr.get(), "object-removed", + g_signal_connect(mObjectManager.GetObjectManager(), "object-removed", G_CALLBACK(+[](GDBusObjectManager * aMgr, GDBusObject * aObj, BluezEndpoint * self) { return self->BluezSignalOnObjectRemoved(aMgr, aObj); }), this); - g_signal_connect(mObjMgr.get(), "interface-proxy-properties-changed", + g_signal_connect(mObjectManager.GetObjectManager(), "interface-proxy-properties-changed", G_CALLBACK(+[](GDBusObjectManagerClient * aMgr, GDBusObjectProxy * aObj, GDBusProxy * aIface, GVariant * aChangedProps, const char * const * aInvalidatedProps, BluezEndpoint * self) { return self->BluezSignalInterfacePropertiesChanged(aMgr, aObj, aIface, aChangedProps, aInvalidatedProps); }), this); - SetupAdapter(); - return CHIP_NO_ERROR; } @@ -638,30 +578,24 @@ CHIP_ERROR BluezEndpoint::RegisterGattApplication() +[](BluezEndpoint * self) { return self->RegisterGattApplicationImpl(); }, this); } -CHIP_ERROR BluezEndpoint::Init(bool aIsCentral, uint32_t aAdapterId) +CHIP_ERROR BluezEndpoint::Init(BluezAdapter1 * apAdapter, bool aIsCentral) { VerifyOrReturnError(!mIsInitialized, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(apAdapter != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - mAdapterId = aAdapterId; + mAdapter.reset(reinterpret_cast(g_object_ref(apAdapter))); mIsCentral = aIsCentral; CHIP_ERROR err = PlatformMgrImpl().GLibMatterContextInvokeSync( - +[](BluezEndpoint * self) { return self->StartupEndpointBindings(); }, this); - VerifyOrReturnError(err == CHIP_NO_ERROR, err, ChipLogError(DeviceLayer, "Failed to schedule endpoint initialization")); + +[](BluezEndpoint * self) { return self->SetupEndpointBindings(); }, this); + VerifyOrReturnError(err == CHIP_NO_ERROR, err, + ChipLogError(DeviceLayer, "Failed to schedule endpoint initialization: %" CHIP_ERROR_FORMAT, err.Format())); - ChipLogDetail(DeviceLayer, "BlueZ integration init success"); mIsInitialized = true; return CHIP_NO_ERROR; } -CHIP_ERROR BluezEndpoint::Init(bool aIsCentral, const char * apBleAddr) -{ - VerifyOrReturnError(!mIsInitialized, CHIP_ERROR_INCORRECT_STATE); - mpAdapterAddr = g_strdup(apBleAddr); - return Init(aIsCentral, mAdapterId); -} - void BluezEndpoint::Shutdown() { VerifyOrReturn(mIsInitialized); @@ -672,7 +606,6 @@ void BluezEndpoint::Shutdown() // the middle of being processed when the cleanup function is called. PlatformMgrImpl().GLibMatterContextInvokeSync( +[](BluezEndpoint * self) { - self->mObjMgr.reset(); self->mAdapter.reset(); self->mRoot.reset(); self->mService.reset(); @@ -685,7 +618,6 @@ void BluezEndpoint::Shutdown() }, this); - g_free(mpAdapterAddr); g_free(mpRootPath); g_free(mpServicePath); g_free(mpPeerDevicePath); diff --git a/src/platform/Linux/bluez/BluezEndpoint.h b/src/platform/Linux/bluez/BluezEndpoint.h index ad2f798d6d5b6a..2f9d7e76b78193 100644 --- a/src/platform/Linux/bluez/BluezEndpoint.h +++ b/src/platform/Linux/bluez/BluezEndpoint.h @@ -58,6 +58,7 @@ #include #include "BluezConnection.h" +#include "BluezObjectManager.h" #include "Types.h" namespace chip { @@ -67,15 +68,12 @@ namespace Internal { class BluezEndpoint { public: - BluezEndpoint() = default; + BluezEndpoint(BluezObjectManager & aObjectManager) : mObjectManager(aObjectManager) {} ~BluezEndpoint() = default; - CHIP_ERROR Init(bool aIsCentral, uint32_t aAdapterId); - CHIP_ERROR Init(bool aIsCentral, const char * apBleAddr); + CHIP_ERROR Init(BluezAdapter1 * apAdapter, bool aIsCentral); void Shutdown(); - BluezAdapter1 * GetAdapter() const { return mAdapter.get(); } - CHIP_ERROR RegisterGattApplication(); GDBusObjectManagerServer * GetGattApplicationObjectManager() const { return mRoot.get(); } @@ -83,9 +81,7 @@ class BluezEndpoint void CancelConnect(); private: - CHIP_ERROR StartupEndpointBindings(); - - CHIP_ERROR SetupAdapter(); + CHIP_ERROR SetupEndpointBindings(); void SetupGattServer(GDBusConnection * aConn); void SetupGattService(); @@ -114,21 +110,16 @@ class BluezEndpoint CHIP_ERROR ConnectDeviceImpl(BluezDevice1 & aDevice); + BluezObjectManager & mObjectManager; + GAutoPtr mAdapter; + bool mIsCentral = false; bool mIsInitialized = false; - // Adapter properties - uint32_t mAdapterId = 0; - char * mpAdapterAddr = nullptr; - // Paths for objects published by this service char * mpRootPath = nullptr; char * mpServicePath = nullptr; - // Objects (interfaces) subscribed to by this service - GAutoPtr mObjMgr; - GAutoPtr mAdapter; - // Objects (interfaces) published by this service GAutoPtr mRoot; GAutoPtr mService; diff --git a/src/platform/Linux/bluez/BluezObjectList.h b/src/platform/Linux/bluez/BluezObjectList.h index 5831f07a3c6c85..c79141f6a73cad 100644 --- a/src/platform/Linux/bluez/BluezObjectList.h +++ b/src/platform/Linux/bluez/BluezObjectList.h @@ -38,6 +38,10 @@ class BluezObjectList BluezObjectList() = default; explicit BluezObjectList(GDBusObjectManager * manager) { Init(manager); } + // This class is not trivially copyable + BluezObjectList(const BluezObjectList &) = delete; + BluezObjectList & operator=(const BluezObjectList &) = delete; + ~BluezObjectList() { if (mObjectList != nullptr) diff --git a/src/platform/Linux/bluez/BluezObjectManager.cpp b/src/platform/Linux/bluez/BluezObjectManager.cpp new file mode 100644 index 00000000000000..ba858c5fd53941 --- /dev/null +++ b/src/platform/Linux/bluez/BluezObjectManager.cpp @@ -0,0 +1,153 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "BluezObjectManager.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "Types.h" + +namespace chip { +namespace DeviceLayer { +namespace Internal { + +CHIP_ERROR BluezObjectManager::Init() +{ + return PlatformMgrImpl().GLibMatterContextInvokeSync( + +[](BluezObjectManager * self) { + ReturnErrorOnFailure(self->SetupDBusConnection()); + ReturnErrorOnFailure(self->SetupObjectManager()); + return CHIP_NO_ERROR; + }, + this); +} + +void BluezObjectManager::Shutdown() +{ + // Run endpoint cleanup on the CHIPoBluez thread. This is necessary because the + // cleanup function releases the D-Bus manager client object, which handles D-Bus + // signals. Otherwise, we will face race condition when the D-Bus signal is in + // the middle of being processed when the cleanup function is called. + PlatformMgrImpl().GLibMatterContextInvokeSync( + +[](BluezObjectManager * self) { + self->mConnection.reset(); + self->mObjectManager.reset(); + return CHIP_NO_ERROR; + }, + this); +} + +BluezAdapter1 * BluezObjectManager::GetAdapter(unsigned int aAdapterId) +{ + char expectedPath[32]; + snprintf(expectedPath, sizeof(expectedPath), BLUEZ_PATH "/hci%u", aAdapterId); + + for (BluezObject & object : GetObjects()) + { + GAutoPtr adapter(bluez_object_get_adapter1(&object)); + if (adapter && strcmp(g_dbus_proxy_get_object_path(reinterpret_cast(adapter.get())), expectedPath) == 0) + { + SetupAdapter(adapter.get()); + return adapter.release(); + } + } + + return nullptr; +} + +BluezAdapter1 * BluezObjectManager::GetAdapter(const char * aAdapterAddress) +{ + for (BluezObject & object : GetObjects()) + { + GAutoPtr adapter(bluez_object_get_adapter1(&object)); + if (adapter && strcmp(bluez_adapter1_get_address(adapter.get()), aAdapterAddress) == 0) + { + SetupAdapter(adapter.get()); + return adapter.release(); + } + } + + return nullptr; +} + +CHIP_ERROR BluezObjectManager::SetupAdapter(BluezAdapter1 * aAdapter) +{ + // Make sure the adapter is powered on. + bluez_adapter1_set_powered(aAdapter, TRUE); + // Setting "Discoverable" to False on the adapter and to True on the advertisement convinces + // BlueZ to set "BR/EDR Not Supported" flag. BlueZ doesn't provide API to do that explicitly + // and the flag is necessary to force using LE transport. + bluez_adapter1_set_discoverable(aAdapter, FALSE); + return CHIP_NO_ERROR; +} + +CHIP_ERROR BluezObjectManager::SetupDBusConnection() +{ + GAutoPtr err; + mConnection.reset(g_bus_get_sync(G_BUS_TYPE_SYSTEM, nullptr, &err.GetReceiver())); + VerifyOrReturnError(mConnection != nullptr, CHIP_ERROR_INTERNAL, + ChipLogError(DeviceLayer, "FAIL: Get D-Bus system bus: %s", err->message)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR BluezObjectManager::SetupObjectManager() +{ + // When connecting to signals, the thread default context must be initialized. Otherwise, + // all D-Bus signals will be delivered to the GLib global default main context. + VerifyOrDie(g_main_context_get_thread_default() != nullptr); + + GAutoPtr err; + mObjectManager.reset(g_dbus_object_manager_client_new_sync( + mConnection.get(), G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE, BLUEZ_INTERFACE, "/", + bluez_object_manager_client_get_proxy_type, nullptr /* unused user data in the proxy type func */, + nullptr /* destroy notify */, nullptr /* cancellable */, &err.GetReceiver())); + VerifyOrReturnError(mObjectManager, CHIP_ERROR_INTERNAL, + ChipLogError(DeviceLayer, "FAIL: Get D-Bus object manager client: %s", err->message)); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR BluezCallToChipError(const GError * aError) +{ + switch (aError->code) + { + // BlueZ crashed or the D-Bus connection is broken in both cases adapter is not available. + case G_DBUS_ERROR_NO_REPLY: + // BlueZ service is not available on the bus, hence the adapter is not available too. + case G_DBUS_ERROR_SERVICE_UNKNOWN: + // Requested D-Bus object is not available on the given path. This happens when the adapter + // was unplugged and unregistered from the BlueZ object manager. + case G_DBUS_ERROR_UNKNOWN_OBJECT: + return BLE_ERROR_ADAPTER_UNAVAILABLE; + default: + return CHIP_ERROR_INTERNAL; + } +} + +} // namespace Internal +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/Linux/bluez/BluezObjectManager.h b/src/platform/Linux/bluez/BluezObjectManager.h new file mode 100644 index 00000000000000..04abd47dfb5c6d --- /dev/null +++ b/src/platform/Linux/bluez/BluezObjectManager.h @@ -0,0 +1,71 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include +#include + +#include "BluezObjectList.h" + +namespace chip { +namespace DeviceLayer { +namespace Internal { + +class BluezObjectManager +{ +public: + BluezObjectManager() = default; + BluezObjectManager(const BluezObjectManager &) = delete; + BluezObjectManager & operator=(const BluezObjectManager &) = delete; + + ~BluezObjectManager() = default; + + CHIP_ERROR Init(); + void Shutdown(); + + // Convenience method to get the D-Bus connection established by this object manager. + GDBusConnection * GetConnection() const { return mConnection.get(); } + // Convenience method to get the BlueZ object manager. + GDBusObjectManager * GetObjectManager() const { return mObjectManager.get(); } + + // Get the list of objects in the BlueZ object manager. + BluezObjectList GetObjects() const { return BluezObjectList(mObjectManager.get()); } + + // Get the adapter with the given HCI ID. + BluezAdapter1 * GetAdapter(unsigned int aAdapterId); + // Get the adapter with the given Bluetooth address. + BluezAdapter1 * GetAdapter(const char * aAdapterAddress); + +private: + CHIP_ERROR SetupDBusConnection(); + CHIP_ERROR SetupObjectManager(); + CHIP_ERROR SetupAdapter(BluezAdapter1 * aAdapter); + + GAutoPtr mConnection; + GAutoPtr mObjectManager; +}; + +// Helper function to convert glib error returned by bluez_*_call_*() functions to CHIP_ERROR. +CHIP_ERROR BluezCallToChipError(const GError * aError); + +} // namespace Internal +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/Linux/bluez/ChipDeviceScanner.cpp b/src/platform/Linux/bluez/ChipDeviceScanner.cpp index e564ae5b6fdca5..cd1c45956c5636 100644 --- a/src/platform/Linux/bluez/ChipDeviceScanner.cpp +++ b/src/platform/Linux/bluez/ChipDeviceScanner.cpp @@ -17,14 +17,17 @@ #include "ChipDeviceScanner.h" -#include -#include +#include +#include +#include +#include + +#include #include #include #include -#include "BluezObjectList.h" #include "Types.h" namespace chip { @@ -54,6 +57,7 @@ bool BluezGetChipDeviceInfo(BluezDevice1 & aDevice, chip::Ble::ChipBLEDeviceIden CHIP_ERROR ChipDeviceScanner::Init(BluezAdapter1 * adapter, ChipDeviceScannerDelegate * delegate) { + VerifyOrReturnError(adapter != nullptr, CHIP_ERROR_INVALID_ARGUMENT); // Make this function idempotent by shutting down previously initialized state if any. Shutdown(); @@ -61,24 +65,6 @@ CHIP_ERROR ChipDeviceScanner::Init(BluezAdapter1 * adapter, ChipDeviceScannerDel mAdapter.reset(reinterpret_cast(g_object_ref(adapter))); mDelegate = delegate; - // Create the D-Bus object manager client object on the glib thread, so that all D-Bus signals - // will be delivered to the glib thread. - ReturnErrorOnFailure(PlatformMgrImpl().GLibMatterContextInvokeSync( - +[](ChipDeviceScanner * self) { - // When creating D-Bus proxy object, the thread default context must be initialized. - VerifyOrDie(g_main_context_get_thread_default() != nullptr); - - GAutoPtr err; - self->mManager.reset(g_dbus_object_manager_client_new_for_bus_sync( - G_BUS_TYPE_SYSTEM, G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE, BLUEZ_INTERFACE, "/", - bluez_object_manager_client_get_proxy_type, nullptr /* unused user data in the Proxy Type Func */, - nullptr /* destroy notify */, nullptr /* cancellable */, &err.GetReceiver())); - VerifyOrReturnError(self->mManager, CHIP_ERROR_INTERNAL, - ChipLogError(Ble, "Failed to get D-Bus object manager for device scanning: %s", err->message)); - return CHIP_NO_ERROR; - }, - this)); - mScannerState = ChipDeviceScannerState::SCANNER_INITIALIZED; return CHIP_NO_ERROR; @@ -95,7 +81,6 @@ void ChipDeviceScanner::Shutdown() // released during a D-Bus signal being processed. PlatformMgrImpl().GLibMatterContextInvokeSync( +[](ChipDeviceScanner * self) { - self->mManager.reset(); self->mAdapter.reset(); return CHIP_NO_ERROR; }, @@ -188,23 +173,22 @@ CHIP_ERROR ChipDeviceScanner::StopScanImpl() if (mObjectAddedSignal) { - g_signal_handler_disconnect(mManager.get(), mObjectAddedSignal); + g_signal_handler_disconnect(mObjectManager.GetObjectManager(), mObjectAddedSignal); mObjectAddedSignal = 0; } if (mPropertiesChangedSignal) { - g_signal_handler_disconnect(mManager.get(), mPropertiesChangedSignal); + g_signal_handler_disconnect(mObjectManager.GetObjectManager(), mPropertiesChangedSignal); mPropertiesChangedSignal = 0; } GAutoPtr error; if (!bluez_adapter1_call_stop_discovery_sync(mAdapter.get(), nullptr /* not cancellable */, &error.GetReceiver())) { - // Do not report error if BlueZ service is not available on the bus (service unknown) or - // the requested BLE adapter is not available (unknown object). In both cases the scan is - // already stopped. - if (error->code != G_DBUS_ERROR_SERVICE_UNKNOWN && error->code != G_DBUS_ERROR_UNKNOWN_OBJECT) + // Do not report error if returned error indicates that the BLE adapter is not available. + // In such case the scan is already stopped. + if (BluezCallToChipError(error.get()) != BLE_ERROR_ADAPTER_UNAVAILABLE) { ChipLogError(Ble, "Failed to stop discovery: %s", error->message); return CHIP_ERROR_INTERNAL; @@ -270,16 +254,15 @@ void ChipDeviceScanner::RemoveDevice(BluezDevice1 & device) CHIP_ERROR ChipDeviceScanner::StartScanImpl() { - GAutoPtr error; - mObjectAddedSignal = g_signal_connect(mManager.get(), "object-added", + mObjectAddedSignal = g_signal_connect(mObjectManager.GetObjectManager(), "object-added", G_CALLBACK(+[](GDBusObjectManager * aMgr, GDBusObject * aObj, ChipDeviceScanner * self) { return self->SignalObjectAdded(aMgr, aObj); }), this); mPropertiesChangedSignal = g_signal_connect( - mManager.get(), "interface-proxy-properties-changed", + mObjectManager.GetObjectManager(), "interface-proxy-properties-changed", G_CALLBACK(+[](GDBusObjectManagerClient * aMgr, GDBusObjectProxy * aObj, GDBusProxy * aIface, GVariant * aChangedProps, const char * const * aInvalidatedProps, ChipDeviceScanner * self) { return self->SignalInterfacePropertiesChanged(aMgr, aObj, aIface, aChangedProps, aInvalidatedProps); @@ -287,7 +270,7 @@ CHIP_ERROR ChipDeviceScanner::StartScanImpl() this); ChipLogProgress(Ble, "BLE removing known devices"); - for (BluezObject & object : BluezObjectList(mManager.get())) + for (BluezObject & object : mObjectManager.GetObjects()) { GAutoPtr device(bluez_object_get_device1(&object)); if (device) @@ -307,6 +290,7 @@ CHIP_ERROR ChipDeviceScanner::StartScanImpl() g_variant_builder_add(&filterBuilder, "{sv}", "Transport", g_variant_new_string("le")); GVariant * filter = g_variant_builder_end(&filterBuilder); + GAutoPtr error; if (!bluez_adapter1_call_set_discovery_filter_sync(mAdapter.get(), filter, mCancellable.get(), &error.GetReceiver())) { // Not critical: ignore if fails @@ -318,7 +302,7 @@ CHIP_ERROR ChipDeviceScanner::StartScanImpl() if (!bluez_adapter1_call_start_discovery_sync(mAdapter.get(), mCancellable.get(), &error.GetReceiver())) { ChipLogError(Ble, "Failed to start discovery: %s", error->message); - return CHIP_ERROR_INTERNAL; + return BluezCallToChipError(error.get()); } return CHIP_NO_ERROR; diff --git a/src/platform/Linux/bluez/ChipDeviceScanner.h b/src/platform/Linux/bluez/ChipDeviceScanner.h index a3e3a665f72782..43c24491d6e330 100644 --- a/src/platform/Linux/bluez/ChipDeviceScanner.h +++ b/src/platform/Linux/bluez/ChipDeviceScanner.h @@ -27,6 +27,7 @@ #include #include +#include "BluezObjectManager.h" #include "Types.h" namespace chip { @@ -55,7 +56,7 @@ class ChipDeviceScannerDelegate class ChipDeviceScanner { public: - ChipDeviceScanner() = default; + ChipDeviceScanner(BluezObjectManager & aObjectManager) : mObjectManager(aObjectManager) {} ChipDeviceScanner(ChipDeviceScanner &&) = default; ChipDeviceScanner(const ChipDeviceScanner &) = delete; ChipDeviceScanner & operator=(const ChipDeviceScanner &) = delete; @@ -107,8 +108,9 @@ class ChipDeviceScanner /// so that it can be re-discovered if it's still advertising. void RemoveDevice(BluezDevice1 & device); - GAutoPtr mManager; + BluezObjectManager & mObjectManager; GAutoPtr mAdapter; + ChipDeviceScannerDelegate * mDelegate = nullptr; unsigned long mObjectAddedSignal = 0; unsigned long mPropertiesChangedSignal = 0; diff --git a/src/platform/silabs/BLEManagerImpl.h b/src/platform/silabs/BLEManagerImpl.h index 12b3ba121886af..4580488ccf6a36 100644 --- a/src/platform/silabs/BLEManagerImpl.h +++ b/src/platform/silabs/BLEManagerImpl.h @@ -24,13 +24,6 @@ #pragma once #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE - -#if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) -#define BLE_MIN_CONNECTION_INTERVAL_MS 45 // 45 msec -#define BLE_MAX_CONNECTION_INTERVAL_MS 45 // 45 msec -#define BLE_SLAVE_LATENCY_MS 0 -#define BLE_TIMEOUT_MS 400 -#endif // (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) #include "FreeRTOS.h" #include "timers.h" #if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) @@ -209,6 +202,11 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla static void DriveBLEState(intptr_t arg); static void BleAdvTimeoutHandler(TimerHandle_t xTimer); uint8_t GetTimerHandle(uint8_t connectionHandle, bool allocate); + +#if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) +protected: + static void OnSendIndicationTimeout(System::Layer * aLayer, void * appState); +#endif }; /** diff --git a/src/platform/silabs/SiWx917/wifi/wfx_host_events.h b/src/platform/silabs/SiWx917/wifi/wfx_host_events.h index 455563e1899bb8..526e22c751a69f 100644 --- a/src/platform/silabs/SiWx917/wifi/wfx_host_events.h +++ b/src/platform/silabs/SiWx917/wifi/wfx_host_events.h @@ -245,9 +245,6 @@ void wfx_dhcp_got_ipv4(uint32_t); void wfx_ip_changed_notify(int got_ip); #endif /* CHIP_DEVICE_CONFIG_ENABLE_IPV4 */ -sl_status_t sl_si91x_host_process_data_frame(sl_wifi_interface_t interface, sl_wifi_buffer_t * buffer); -void * sl_si91x_host_get_buffer_data(sl_wifi_buffer_t * buffer, uint16_t offset, uint16_t * data_length); - #if SL_ICD_ENABLED sl_status_t wfx_power_save(rsi_power_save_profile_mode_t sl_si91x_ble_state, sl_si91x_performance_profile_t sl_si91x_wifi_state); void sl_button_on_change(uint8_t btn, uint8_t btnAction); diff --git a/src/platform/silabs/platformAbstraction/GsdkSpam.cpp b/src/platform/silabs/platformAbstraction/GsdkSpam.cpp index 5527fbfe90d73d..8bfce2f4dc487f 100644 --- a/src/platform/silabs/platformAbstraction/GsdkSpam.cpp +++ b/src/platform/silabs/platformAbstraction/GsdkSpam.cpp @@ -44,7 +44,6 @@ extern "C" { #include "sl_component_catalog.h" #include "sl_mbedtls.h" -#include "sl_system_init.h" #if SILABS_LOG_OUT_UART || ENABLE_CHIP_SHELL || CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI #include "uart.h" #endif @@ -68,8 +67,6 @@ SilabsPlatform::SilabsButtonCb SilabsPlatform::mButtonCallback = nullptr; CHIP_ERROR SilabsPlatform::Init(void) { - sl_system_init(); - mRebootCause = RMU_ResetCauseGet(); // Clear register so it does accumualate the causes of each reset RMU_ResetCauseClear(); diff --git a/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp b/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp index f57b73f0499d41..8a03e8a71a7cca 100644 --- a/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp +++ b/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp @@ -31,7 +31,6 @@ extern "C" { #include "sl_event_handler.h" #include "sl_si91x_led.h" #include "sl_si91x_led_config.h" -#include "sl_system_init.h" void soc_pll_config(void); } @@ -50,8 +49,6 @@ CHIP_ERROR SilabsPlatform::Init(void) { mButtonCallback = nullptr; - sl_system_init(); - // TODO: Setting the highest priority for SVCall_IRQn to avoid the HardFault issue NVIC_SetPriority(SVCall_IRQn, CORE_INTERRUPT_HIGHEST_PRIORITY); diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp index 7c6f5a58ffe717..53fd807519cf43 100644 --- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp +++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp @@ -68,6 +68,13 @@ extern "C" { #include #endif +#define BLE_MIN_CONNECTION_INTERVAL_MS 45 +#define BLE_MAX_CONNECTION_INTERVAL_MS 45 +#define BLE_SLAVE_LATENCY_MS 0 +#define BLE_TIMEOUT_MS 400 +#define BLE_DEFAULT_TIMER_PERIOD_MS (1) +#define BLE_SEND_INDICATION_TIMER_PERIOD_MS (5000) + extern sl_wfx_msg_t event_msg; StaticTask_t rsiBLETaskStruct; @@ -246,8 +253,6 @@ namespace { #define BLE_CONFIG_MIN_CE_LENGTH (0) // Leave to min value #define BLE_CONFIG_MAX_CE_LENGTH (0xFFFF) // Leave to max value -#define BLE_DEFAULT_TIMER_PERIOD_MS (1) - TimerHandle_t sbleAdvTimeoutTimer; // FreeRTOS sw timer. const uint8_t UUID_CHIPoBLEService[] = { 0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80, @@ -301,6 +306,18 @@ CHIP_ERROR BLEManagerImpl::_Init() return err; } +void BLEManagerImpl::OnSendIndicationTimeout(System::Layer * aLayer, void * appState) +{ + // TODO: change the connection handle with the ble device ID + uint8_t connHandle = 1; + ChipLogProgress(DeviceLayer, "BLEManagerImpl::HandleSoftTimerEvent CHIPOBLE_PROTOCOL_ABORT"); + ChipDeviceEvent event; + event.Type = DeviceEventType::kCHIPoBLEConnectionError; + event.CHIPoBLEConnectionError.ConId = connHandle; + event.CHIPoBLEConnectionError.Reason = BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT; + PlatformMgr().PostEventOrDie(&event); +} + uint16_t BLEManagerImpl::_NumConnections(void) { uint16_t numCons = 0; @@ -423,6 +440,7 @@ void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) case DeviceEventType::kCHIPoBLEIndicateConfirm: { ChipLogProgress(DeviceLayer, "_OnPlatformEvent kCHIPoBLEIndicateConfirm"); + DeviceLayer::SystemLayer().CancelTimer(OnSendIndicationTimeout, this); HandleIndicationConfirmation(event->CHIPoBLEIndicateConfirm.ConId, &CHIP_BLE_SVC_ID, &ChipUUID_CHIPoBLEChar_TX); } break; @@ -471,12 +489,16 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU int32_t status = 0; status = rsi_ble_indicate_value(event_msg.resp_enh_conn.dev_addr, event_msg.rsi_ble_measurement_hndl, (data->DataLength()), data->Start()); + if (status != RSI_SUCCESS) { ChipLogProgress(DeviceLayer, "indication failed with error code %lx ", status); return false; } + // start timer for the indication Confirmation Event + DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(BLE_SEND_INDICATION_TIMER_PERIOD_MS), + OnSendIndicationTimeout, this); return true; } @@ -927,12 +949,6 @@ void BLEManagerImpl::HandleTxConfirmationEvent(BLE_CONNECTION_OBJECT conId) PlatformMgr().PostEventOrDie(&event); } -// TODO:: Need to Implement -void BLEManagerImpl::HandleSoftTimerEvent(void) -{ - // TODO:: Need to Implement -} - bool BLEManagerImpl::RemoveConnection(uint8_t connectionHandle) { CHIPoBLEConState * bleConnState = GetConnectionState(connectionHandle, true);