From 3a42b6a21ee12e43b7cc307a8eb98a84c1d2dea7 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 1 Nov 2023 15:56:31 -0400 Subject: [PATCH] Revert "Add better APIs for initializing MTRCluster instances from Swift. (#29915)" (#30131) This reverts commit 954fff089a7c28dfcae16bbe23dd583a822fce04. The reason for the revert is that some of the CI systems we are dealing with do not have a reasonable Swift compiler yet, which cause CI to fail on Matter.framework. Note that if relanding it's better to revert this PR, because the revert had some conflicts that had to be resolved. --- src/darwin/Framework/CHIP/MTRDefines.h | 2 +- .../CHIP/templates/MTRClusters-swift.zapt | 15 - .../Framework/CHIP/templates/templates.json | 5 - .../CHIP/zap-generated/MTRClusters.swift | 692 ------------------ .../Framework/CHIPTests/MTRDeviceTests.m | 17 - .../CHIPTests/MTRSwiftDeviceTests.swift | 20 +- .../Matter.xcodeproj/project.pbxproj | 24 - 7 files changed, 3 insertions(+), 772 deletions(-) delete mode 100644 src/darwin/Framework/CHIP/templates/MTRClusters-swift.zapt delete mode 100644 src/darwin/Framework/CHIP/zap-generated/MTRClusters.swift diff --git a/src/darwin/Framework/CHIP/MTRDefines.h b/src/darwin/Framework/CHIP/MTRDefines.h index 00ff4b99310f87..add06898ec9080 100644 --- a/src/darwin/Framework/CHIP/MTRDefines.h +++ b/src/darwin/Framework/CHIP/MTRDefines.h @@ -67,7 +67,7 @@ #if MTR_ENABLE_PROVISIONAL #define MTR_PROVISIONALLY_AVAILABLE MTR_NEWLY_AVAILABLE #else -#define MTR_PROVISIONALLY_AVAILABLE API_UNAVAILABLE(ios, macos, tvos, watchos) MTR_HIDDEN +#define MTR_PROVISIONALLY_AVAILABLE NS_UNAVAILABLE MTR_HIDDEN #endif #ifndef MTR_PER_CONTROLLER_STORAGE_ENABLED diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters-swift.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters-swift.zapt deleted file mode 100644 index 2fc3162fd99acf..00000000000000 --- a/src/darwin/Framework/CHIP/templates/MTRClusters-swift.zapt +++ /dev/null @@ -1,15 +0,0 @@ -{{> header excludeZapComment=true}} - -private let clusterQueue = DispatchQueue(label: "MTRCluster completion dispatch") - -{{#zcl_clusters}} -{{#if (isSupported (asUpperCamelCase name preserveAcronyms=true))}} -{{swiftAvailability (asUpperCamelCase name preserveAcronyms=true) minimalRelease="Future"}} -extension MTRCluster{{asUpperCamelCase name preserveAcronyms=true}} { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -{{/if}} -{{/zcl_clusters}} \ No newline at end of file diff --git a/src/darwin/Framework/CHIP/templates/templates.json b/src/darwin/Framework/CHIP/templates/templates.json index d04cf45ba83c2d..89c101a30d77e2 100644 --- a/src/darwin/Framework/CHIP/templates/templates.json +++ b/src/darwin/Framework/CHIP/templates/templates.json @@ -79,11 +79,6 @@ "name": "Objc ZCL synchronous API", "output": "src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm" }, - { - "path": "MTRClusters-swift.zapt", - "name": "Swift ZCL synchronous API Header extensions", - "output": "src/darwin/Framework/CHIP/zap-generated/MTRClusters.swift" - }, { "path": "MTRStructsObjc.zapt", "name": "Objc reflections of MTR spec structs header", diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.swift b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.swift deleted file mode 100644 index 1492c53ceb1745..00000000000000 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.swift +++ /dev/null @@ -1,692 +0,0 @@ -/* - * - * 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. - */ - - -private let clusterQueue = DispatchQueue(label: "MTRCluster completion dispatch") - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterIdentify { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterGroups { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterScenes { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterOnOff { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterOnOffSwitchConfiguration { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterLevelControl { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterBinaryInputBasic { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterPulseWidthModulation { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterDescriptor { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterBinding { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterAccessControl { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterActions { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterBasicInformation { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterOTASoftwareUpdateProvider { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterOTASoftwareUpdateRequestor { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterLocalizationConfiguration { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterTimeFormatLocalization { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterUnitLocalization { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterPowerSourceConfiguration { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterPowerSource { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterGeneralCommissioning { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterNetworkCommissioning { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterDiagnosticLogs { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterGeneralDiagnostics { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterSoftwareDiagnostics { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterThreadNetworkDiagnostics { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterWiFiNetworkDiagnostics { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterEthernetNetworkDiagnostics { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterTimeSynchronization { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterBridgedDeviceBasicInformation { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterSwitch { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterAdministratorCommissioning { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterOperationalCredentials { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterGroupKeyManagement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterFixedLabel { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterUserLabel { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterBooleanState { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterICDManagement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterModeSelect { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterLaundryWasherMode { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterRefrigeratorAndTemperatureControlledCabinetMode { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterLaundryWasherControls { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterRVCRunMode { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterRVCCleanMode { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterTemperatureControl { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterRefrigeratorAlarm { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterDishwasherMode { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterAirQuality { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterSmokeCOAlarm { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterDishwasherAlarm { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterMicrowaveOvenMode { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterMicrowaveOvenControl { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterOperationalState { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterRVCOperationalState { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterHEPAFilterMonitoring { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterActivatedCarbonFilterMonitoring { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterDoorLock { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterWindowCovering { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterBarrierControl { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterPumpConfigurationAndControl { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterThermostat { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterFanControl { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterThermostatUserInterfaceConfiguration { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterColorControl { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterBallastConfiguration { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterIlluminanceMeasurement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterTemperatureMeasurement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterPressureMeasurement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterFlowMeasurement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterRelativeHumidityMeasurement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterOccupancySensing { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterCarbonMonoxideConcentrationMeasurement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterCarbonDioxideConcentrationMeasurement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterNitrogenDioxideConcentrationMeasurement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterOzoneConcentrationMeasurement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterPM25ConcentrationMeasurement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterFormaldehydeConcentrationMeasurement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterPM1ConcentrationMeasurement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterPM10ConcentrationMeasurement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterTotalVolatileOrganicCompoundsConcentrationMeasurement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterRadonConcentrationMeasurement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterWakeOnLAN { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterChannel { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterTargetNavigator { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterMediaPlayback { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterMediaInput { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterLowPower { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterKeypadInput { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterContentLauncher { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterAudioOutput { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterApplicationLauncher { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterApplicationBasic { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterAccountLogin { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterElectricalMeasurement { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS 17.2, macOS 14.2, watchOS 10.2, tvOS 17.2, *) -extension MTRClusterUnitTesting { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - -@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) -extension MTRClusterSampleMEI { - public convenience init(device : MTRDevice, endpointID: UInt) { - self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! - } -} - diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index 2028d1f03ad9f8..c6b5951eeea936 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -1513,23 +1513,6 @@ - (void)test017_TestMTRDeviceBasics XCTAssertNotEqual(attributeReportsReceived, 0); XCTAssertNotEqual(eventReportsReceived, 0); - // Check that we can read one of those attributes we received. - __auto_type * descriptorCluster = [[MTRClusterDescriptor alloc] initWithDevice:device endpointID:@(0) queue:queue]; - __auto_type * partsListDictionary = [descriptorCluster readAttributePartsListWithParams:nil]; - XCTAssertNotNil(partsListDictionary); - - __auto_type * responseValue = @{ - MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:@(0) clusterID:@(MTRClusterIDTypeDescriptorID) attributeID:@(MTRAttributeIDTypeClusterDescriptorAttributePartsListID)], - MTRDataKey : partsListDictionary, - }; - - NSError * error; - __auto_type * report = [[MTRAttributeReport alloc] initWithResponseValue:responseValue error:&error]; - XCTAssertNil(error); - XCTAssertNotNil(report); - XCTAssertNotNil(report.value); - XCTAssertTrue([report.value isKindOfClass:NSArray.class]); - // Before resubscribe, first test write failure and expected value effects NSNumber * testEndpointID = @(1); NSNumber * testClusterID = @(8); diff --git a/src/darwin/Framework/CHIPTests/MTRSwiftDeviceTests.swift b/src/darwin/Framework/CHIPTests/MTRSwiftDeviceTests.swift index aa4f21c4463491..b800588e55cd03 100644 --- a/src/darwin/Framework/CHIPTests/MTRSwiftDeviceTests.swift +++ b/src/darwin/Framework/CHIPTests/MTRSwiftDeviceTests.swift @@ -100,8 +100,8 @@ class MTRSwiftDeviceTestDelegate : NSObject, MTRDeviceDelegate { // Because we are using things from Matter.framework that are flagged // as only being available starting with macOS 13.5, we need to flag our // code with the same availability annotation. -@available(macOS, introduced: 14.2) -@available(iOS, introduced: 17.2) +@available(macOS, introduced: 14.1) +@available(iOS, introduced: 17.1) class MTRSwiftDeviceTests : XCTestCase { static var sStackInitRan : Bool = false static var sNeedsStackShutdown : Bool = true @@ -292,22 +292,6 @@ class MTRSwiftDeviceTests : XCTestCase { XCTAssertNotEqual(attributeReportsReceived, 0) XCTAssertNotEqual(eventReportsReceived, 0) - // Check that we can read one of those attributes we received. - let descriptorCluster = MTRClusterDescriptor(device: device, endpointID: 0) - let partsListDictionary = descriptorCluster.readAttributePartsList(with: nil) - XCTAssertNotNil(partsListDictionary); - - let path = MTRAttributePath(endpointID: 0, - clusterID: MTRClusterIDType.descriptorID.rawValue as NSNumber, - attributeID: MTRAttributeIDType.clusterDescriptorAttributePartsListID.rawValue as NSNumber) - let responseValue : [String: Any] = [ - MTRAttributePathKey: path, - MTRDataKey: partsListDictionary!, - ] - let report = try! MTRAttributeReport(responseValue: responseValue) - XCTAssertNotNil(report.value) - XCTAssertTrue(report.value is [NSNumber]) - // Before resubscribe, first test write failure and expected value effects let testEndpointID = 1 as NSNumber let testClusterID = 8 as NSNumber diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index fcc5d770f64889..53ce6ed70871b9 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -178,7 +178,6 @@ 51B22C222740CB1D008D5055 /* MTRCommandPayloadsObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B22C212740CB1D008D5055 /* MTRCommandPayloadsObjc.h */; settings = {ATTRIBUTES = (Public, ); }; }; 51B22C262740CB32008D5055 /* MTRStructsObjc.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51B22C252740CB32008D5055 /* MTRStructsObjc.mm */; }; 51B22C2A2740CB47008D5055 /* MTRCommandPayloadsObjc.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51B22C292740CB47008D5055 /* MTRCommandPayloadsObjc.mm */; }; - 51B6C5C62AD85B3D003F4D3A /* MTRClusters.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51B6C5C52AD85B3D003F4D3A /* MTRClusters.swift */; }; 51C8E3F82825CDB600D47D00 /* MTRTestKeys.m in Sources */ = {isa = PBXBuildFile; fileRef = 51C8E3F72825CDB600D47D00 /* MTRTestKeys.m */; }; 51C984622A61CE2A00B0AD9A /* MTRFabricInfoChecker.m in Sources */ = {isa = PBXBuildFile; fileRef = 51C984602A61CE2A00B0AD9A /* MTRFabricInfoChecker.m */; }; 51CFDDB12AC5F78F00DA7CA5 /* EmptyDataModelHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51CFDDB02AC5F78F00DA7CA5 /* EmptyDataModelHandler.cpp */; }; @@ -543,9 +542,7 @@ 51B22C212740CB1D008D5055 /* MTRCommandPayloadsObjc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRCommandPayloadsObjc.h; sourceTree = ""; }; 51B22C252740CB32008D5055 /* MTRStructsObjc.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRStructsObjc.mm; sourceTree = ""; }; 51B22C292740CB47008D5055 /* MTRCommandPayloadsObjc.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCommandPayloadsObjc.mm; sourceTree = ""; }; - 51B6C5C52AD85B3D003F4D3A /* MTRClusters.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MTRClusters.swift; sourceTree = ""; }; 51B6C5C72AD85B47003F4D3A /* MTRCommandPayloads_Internal.zapt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MTRCommandPayloads_Internal.zapt; sourceTree = ""; }; - 51B6C5C92AD85B50003F4D3A /* MTRClusters-swift.zapt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "MTRClusters-swift.zapt"; sourceTree = ""; }; 51C8E3F72825CDB600D47D00 /* MTRTestKeys.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRTestKeys.m; sourceTree = ""; }; 51C984602A61CE2A00B0AD9A /* MTRFabricInfoChecker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRFabricInfoChecker.m; sourceTree = ""; }; 51C984612A61CE2A00B0AD9A /* MTRFabricInfoChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRFabricInfoChecker.h; sourceTree = ""; }; @@ -1000,7 +997,6 @@ 51B22C1D2740CB0A008D5055 /* MTRStructsObjc.h */, 51B22C252740CB32008D5055 /* MTRStructsObjc.mm */, 5178E67D2AE098210069DF72 /* MTRCommandTimedCheck.mm */, - 51B6C5C52AD85B3D003F4D3A /* MTRClusters.swift */, 51F522672AE70734000C4050 /* MTRDeviceTypeMetadata.mm */, ); path = "zap-generated"; @@ -1035,7 +1031,6 @@ 3D843728294984AF0070D20A /* MTRClusters.zapt */, 3D843720294984AF0070D20A /* MTRClusters_Internal.zapt */, 3D843726294984AF0070D20A /* MTRClusters-src.zapt */, - 51B6C5C92AD85B50003F4D3A /* MTRClusters-swift.zapt */, 3D84371A294984AF0070D20A /* MTRCommandPayloadsObjc.zapt */, 3D843727294984AF0070D20A /* MTRCommandPayloadsObjc-src.zapt */, 51B6C5C72AD85B47003F4D3A /* MTRCommandPayloads_Internal.zapt */, @@ -1571,7 +1566,6 @@ }; B202528C2459E34F00F97062 = { CreatedOnToolsVersion = 11.4.1; - LastSwiftMigration = 1420; }; B20252952459E34F00F97062 = { CreatedOnToolsVersion = 11.4.1; @@ -1747,7 +1741,6 @@ 2C222AD1255C620600E446B9 /* MTRBaseDevice.mm in Sources */, 1EC3238D271999E2002A8BF0 /* cluster-objects.cpp in Sources */, 3CF134A9289D8D800017A19E /* MTRCSRInfo.mm in Sources */, - 51B6C5C62AD85B3D003F4D3A /* MTRClusters.swift in Sources */, 991DC0892475F47D00C13860 /* MTRDeviceController.mm in Sources */, B2E0D7B7245B0B5C003C5B48 /* MTRQRCodeSetupPayloadParser.mm in Sources */, 514304202914CED9004DC7FE /* generic-callback-stubs.cpp in Sources */, @@ -2056,7 +2049,6 @@ isa = XCBuildConfiguration; buildSettings = { CHIP_ROOT = "$(PROJECT_DIR)/../../.."; - CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; @@ -2086,11 +2078,6 @@ INFOPLIST_FILE = CHIP/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 13.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); LIBRARY_SEARCH_PATHS = "$(TEMP_DIR)/out/lib"; OTHER_CFLAGS = "-fmacro-prefix-map=$(SRCROOT)/CHIP/="; OTHER_LDFLAGS = ""; @@ -2129,8 +2116,6 @@ PRODUCT_BUNDLE_IDENTIFIER = com.csa.matter; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; TAPI_VERIFY_MODE = Pedantic; TARGETED_DEVICE_FAMILY = "1,2,3,4"; VERSION_INFO_EXPORT_DECL = "__attribute__((visibility(\"hidden\")))"; @@ -2140,7 +2125,6 @@ BA09EB752474881D00605257 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; "HEADER_SEARCH_PATHS[arch=*]" = "$(PROJECT_DIR)/../../../src"; @@ -2230,7 +2214,6 @@ isa = XCBuildConfiguration; buildSettings = { CHIP_ROOT = "$(PROJECT_DIR)/../../.."; - CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; @@ -2260,11 +2243,6 @@ INFOPLIST_FILE = CHIP/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 13.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); LIBRARY_SEARCH_PATHS = "$(TEMP_DIR)/out/lib"; OTHER_CFLAGS = "-fmacro-prefix-map=$(SRCROOT)/CHIP/="; OTHER_LDFLAGS = ""; @@ -2304,7 +2282,6 @@ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = iphoneos; STRIP_STYLE = "non-global"; - SWIFT_VERSION = 5.0; TAPI_VERIFY_MODE = Pedantic; TARGETED_DEVICE_FAMILY = "1,2,3,4"; VERSION_INFO_EXPORT_DECL = "__attribute__((visibility(\"hidden\")))"; @@ -2314,7 +2291,6 @@ BA09EB792474882200605257 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = "";