diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.h b/src/darwin/Framework/CHIP/MTRBaseDevice.h index 5371dd22962ab4..64c8fd99981595 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.h +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.h @@ -121,30 +121,30 @@ typedef void (^MTRDeviceResubscriptionScheduledHandler)(NSError * error, NSNumbe MTR_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)) typedef void (^MTRDeviceOpenCommissioningWindowHandler)(MTRSetupPayload * _Nullable payload, NSError * _Nullable error); -extern NSString * const MTRAttributePathKey; -extern NSString * const MTRCommandPathKey; -extern NSString * const MTREventPathKey; -extern NSString * const MTRDataKey; -extern NSString * const MTRErrorKey; -extern NSString * const MTRTypeKey; -extern NSString * const MTRValueKey; -extern NSString * const MTRContextTagKey; -extern NSString * const MTRSignedIntegerValueType; -extern NSString * const MTRUnsignedIntegerValueType; -extern NSString * const MTRBooleanValueType; -extern NSString * const MTRUTF8StringValueType; -extern NSString * const MTROctetStringValueType; -extern NSString * const MTRFloatValueType; -extern NSString * const MTRDoubleValueType; -extern NSString * const MTRNullValueType; -extern NSString * const MTRStructureValueType; -extern NSString * const MTRArrayValueType; -extern NSString * const MTREventNumberKey MTR_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5)); -extern NSString * const MTREventPriorityKey MTR_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5)); -extern NSString * const MTREventTimeTypeKey MTR_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5)); -extern NSString * const MTREventSystemUpTimeKey MTR_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5)); -extern NSString * const MTREventTimestampDateKey MTR_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5)); -extern NSString * const MTREventIsHistoricalKey MTR_AVAILABLE(ios(17.3), macos(14.3), watchos(10.3), tvos(17.3)); +MTR_EXTERN NSString * const MTRAttributePathKey MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTRCommandPathKey MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTREventPathKey MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTRDataKey MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTRErrorKey MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTRTypeKey MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTRValueKey MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTRContextTagKey MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTRSignedIntegerValueType MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTRUnsignedIntegerValueType MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTRBooleanValueType MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTRUTF8StringValueType MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTROctetStringValueType MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTRFloatValueType MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTRDoubleValueType MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTRNullValueType MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTRStructureValueType MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTRArrayValueType MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSString * const MTREventNumberKey MTR_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5)); +MTR_EXTERN NSString * const MTREventPriorityKey MTR_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5)); +MTR_EXTERN NSString * const MTREventTimeTypeKey MTR_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5)); +MTR_EXTERN NSString * const MTREventSystemUpTimeKey MTR_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5)); +MTR_EXTERN NSString * const MTREventTimestampDateKey MTR_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5)); +MTR_EXTERN NSString * const MTREventIsHistoricalKey MTR_AVAILABLE(ios(17.3), macos(14.3), watchos(10.3), tvos(17.3)); @class MTRClusterStateCacheContainer; @class MTRAttributeCacheContainer; @@ -165,8 +165,7 @@ typedef NS_ENUM(uint8_t, MTRTransportType) { */ MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) @interface MTRAttributeRequestPath : NSObject -@property (nonatomic, readonly, copy, nullable) NSNumber * endpoint MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) - ; +@property (nonatomic, readonly, copy, nullable) NSNumber * endpoint MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); @property (nonatomic, readonly, copy, nullable) NSNumber * cluster MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); @property (nonatomic, readonly, copy, nullable) NSNumber * attribute MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); @@ -184,8 +183,7 @@ MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) */ MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) @interface MTREventRequestPath : NSObject -@property (nonatomic, readonly, copy, nullable) NSNumber * endpoint MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) - ; +@property (nonatomic, readonly, copy, nullable) NSNumber * endpoint MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); @property (nonatomic, readonly, copy, nullable) NSNumber * cluster MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); @property (nonatomic, readonly, copy, nullable) NSNumber * event MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); @@ -195,6 +193,7 @@ MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); @end +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseDevice : NSObject - (instancetype)init NS_UNAVAILABLE; @@ -551,6 +550,7 @@ MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) */ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRClusterPath : NSObject + @property (nonatomic, readonly, copy) NSNumber * endpoint; @property (nonatomic, readonly, copy) NSNumber * cluster; @@ -564,7 +564,9 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) * A path indicating a specific attribute on a device (i.e. without any * wildcards). */ +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRAttributePath : MTRClusterPath + @property (nonatomic, readonly, copy) NSNumber * attribute; + (MTRAttributePath *)attributePathWithEndpointID:(NSNumber *)endpointID @@ -578,7 +580,9 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) * (i.e. without any wildcards). There can be multiple instances of actual * events for a given event path. */ +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTREventPath : MTRClusterPath + @property (nonatomic, readonly, copy) NSNumber * event; + (MTREventPath *)eventPathWithEndpointID:(NSNumber *)endpointID @@ -590,7 +594,9 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) * A path indicating a specific command on a device (i.e. without any * wildcards). */ +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRCommandPath : MTRClusterPath + @property (nonatomic, readonly, copy) NSNumber * command; + (MTRCommandPath *)commandPathWithEndpointID:(NSNumber *)endpointID @@ -598,7 +604,9 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) commandID:(NSNumber *)commandID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @end +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRAttributeReport : NSObject + @property (nonatomic, readonly, copy) MTRAttributePath * path; /** @@ -665,7 +673,9 @@ typedef NS_ENUM(NSUInteger, MTREventPriority) { MTREventPriorityCritical = 2 } MTR_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5)); +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTREventReport : NSObject + @property (nonatomic, readonly, copy) MTREventPath * path; /** diff --git a/src/darwin/Framework/CHIP/MTRCertificates.h b/src/darwin/Framework/CHIP/MTRCertificates.h index 67b3cebef895bf..d414ca760117c0 100644 --- a/src/darwin/Framework/CHIP/MTRCertificates.h +++ b/src/darwin/Framework/CHIP/MTRCertificates.h @@ -26,6 +26,7 @@ NS_ASSUME_NONNULL_BEGIN @protocol MTRKeypair; +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRCertificates : NSObject - (instancetype)init NS_UNAVAILABLE; diff --git a/src/darwin/Framework/CHIP/MTRCluster.h b/src/darwin/Framework/CHIP/MTRCluster.h index f4a6887b476aa4..516a031c3f8976 100644 --- a/src/darwin/Framework/CHIP/MTRCluster.h +++ b/src/darwin/Framework/CHIP/MTRCluster.h @@ -37,6 +37,7 @@ NS_ASSUME_NONNULL_BEGIN * MTRCluster * This is the base class for clusters. */ +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRCluster : NSObject - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; @@ -71,6 +72,7 @@ MTR_NEWLY_AVAILABLE * If not provided (i.e. nil passed for the CHIPWriteParams argument), will be * treated as if a default-initialized object was passed in. */ +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRWriteParams : NSObject /** @@ -106,6 +108,7 @@ MTR_NEWLY_AVAILABLE * If not provided (i.e. nil passed for the MTRReadParams argument), will be * treated as if a default-initialized object was passed in. */ +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRReadParams : NSObject /** @@ -137,6 +140,7 @@ MTR_NEWLY_AVAILABLE * provided (i.e. nil passed for the MTRSubscribeParams argument), will be * treated as if a default-initialized object was passed in. */ +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRSubscribeParams : MTRReadParams /** diff --git a/src/darwin/Framework/CHIP/MTRCommandTimedCheck.h b/src/darwin/Framework/CHIP/MTRCommandTimedCheck.h index 423a133d93dcc7..ba72bf99960311 100644 --- a/src/darwin/Framework/CHIP/MTRCommandTimedCheck.h +++ b/src/darwin/Framework/CHIP/MTRCommandTimedCheck.h @@ -15,9 +15,7 @@ * limitations under the License. */ -#pragma once - -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/src/darwin/Framework/CHIP/MTRCommissionableBrowser.h b/src/darwin/Framework/CHIP/MTRCommissionableBrowser.h index 1a05c13a59021a..52d0bc875464f0 100644 --- a/src/darwin/Framework/CHIP/MTRCommissionableBrowser.h +++ b/src/darwin/Framework/CHIP/MTRCommissionableBrowser.h @@ -23,7 +23,6 @@ NS_ASSUME_NONNULL_BEGIN @protocol MTRCommissionableBrowserDelegate; @class MTRDeviceController; -MTR_HIDDEN @interface MTRCommissionableBrowser : NSObject - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; diff --git a/src/darwin/Framework/CHIP/MTRCommissionableBrowserResult_Internal.h b/src/darwin/Framework/CHIP/MTRCommissionableBrowserResult_Internal.h index bf312d83361117..4500ab8eb877f2 100644 --- a/src/darwin/Framework/CHIP/MTRCommissionableBrowserResult_Internal.h +++ b/src/darwin/Framework/CHIP/MTRCommissionableBrowserResult_Internal.h @@ -24,7 +24,6 @@ NS_ASSUME_NONNULL_BEGIN -MTR_HIDDEN @interface MTRCommissionableBrowserResultInterfaces : NSObject @property (nonatomic, readwrite) chip::Optional resolutionData; diff --git a/src/darwin/Framework/CHIP/MTRCommissioningParameters.h b/src/darwin/Framework/CHIP/MTRCommissioningParameters.h index a6568dae900f69..771dfe54fc8893 100644 --- a/src/darwin/Framework/CHIP/MTRCommissioningParameters.h +++ b/src/darwin/Framework/CHIP/MTRCommissioningParameters.h @@ -25,6 +25,7 @@ NS_ASSUME_NONNULL_BEGIN /** * Information that can be provided to commissionWithNodeID to commision devices. */ +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRCommissioningParameters : NSObject /** diff --git a/src/darwin/Framework/CHIP/MTRDefines.h b/src/darwin/Framework/CHIP/MTRDefines.h index 97d918297327d5..3286b7e5a1a6c7 100644 --- a/src/darwin/Framework/CHIP/MTRDefines.h +++ b/src/darwin/Framework/CHIP/MTRDefines.h @@ -17,6 +17,26 @@ #import +#pragma mark - Overridable options + +/** + * @define `MTR_NO_AVAILABILITY` + * Turns off availability annotations, to allow compiling a version of + * Matter.framework for "local use", not as a system framework. + */ +#ifndef MTR_NO_AVAILABILITY +#define MTR_NO_AVAILABILITY 0 +#endif + +/** + * @define `MTR_ENABLE_PROVISIONAL` + * Makes provisional APIs available for evaluation / testing purposes. + * The usual API / ABI stability guarantees DO NOT APPLY to provisional features. + */ +#ifndef MTR_ENABLE_PROVISIONAL +#define MTR_ENABLE_PROVISIONAL 0 +#endif + #pragma mark - Attribute macros #define MTR_EXPORT __attribute__((visibility("default"))) @@ -35,40 +55,38 @@ #define MTR_SWIFT_DISFAVORED_OVERLOAD #endif -#pragma mark - Deprecation macros (can be overriden via build system) +#pragma mark - Availability / deprecation -/** - * MTR_NO_AVAILABILITY can be used to turn off availability - * annotations, to allow compiling a version of Matter.framework for "local - * use", not as a system framework. - */ -#if !defined(MTR_NO_AVAILABILITY) -#define MTR_NO_AVAILABILITY 0 -#endif +// clang-format off +#define _MTR_IMPLICIT_EXPORT \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wignored-attributes\"")\ + MTR_EXPORT \ + _Pragma("clang diagnostic pop") +// clang-format on + +#define _MTR_DEPRECATED _MTR_IMPLICIT_EXPORT MTR_SWIFT_DISFAVORED_OVERLOAD +// clang-format off #if MTR_NO_AVAILABILITY -#define MTR_DEPRECATED(...) MTR_SWIFT_DISFAVORED_OVERLOAD -#define MTR_DEPRECATED_WITH_REPLACEMENT(...) MTR_SWIFT_DISFAVORED_OVERLOAD -#define MTR_AVAILABLE(...) +#define MTR_DEPRECATED(...) _MTR_DEPRECATED +#define MTR_DEPRECATED_WITH_REPLACEMENT(...) _MTR_DEPRECATED +#define MTR_AVAILABLE(...) _MTR_IMPLICIT_EXPORT #else -#define MTR_DEPRECATED(...) API_DEPRECATED(__VA_ARGS__) MTR_SWIFT_DISFAVORED_OVERLOAD -#define MTR_DEPRECATED_WITH_REPLACEMENT(...) API_DEPRECATED_WITH_REPLACEMENT(__VA_ARGS__) MTR_SWIFT_DISFAVORED_OVERLOAD -#define MTR_AVAILABLE(...) API_AVAILABLE(__VA_ARGS__) +#define MTR_DEPRECATED(...) _MTR_DEPRECATED API_DEPRECATED(__VA_ARGS__) +#define MTR_DEPRECATED_WITH_REPLACEMENT(...) _MTR_DEPRECATED API_DEPRECATED_WITH_REPLACEMENT(__VA_ARGS__) +#define MTR_AVAILABLE(...) _MTR_IMPLICIT_EXPORT API_AVAILABLE(__VA_ARGS__) #endif // MTR_NO_AVAILABILITY +// clang-format on -#define MTR_NEWLY_DEPRECATED(message) - -#define MTR_NEWLY_AVAILABLE - -#if !defined(MTR_ENABLE_PROVISIONAL) -#define MTR_ENABLE_PROVISIONAL 0 -#endif +#define MTR_NEWLY_DEPRECATED(message) _MTR_IMPLICIT_EXPORT +#define MTR_NEWLY_AVAILABLE _MTR_IMPLICIT_EXPORT #if MTR_ENABLE_PROVISIONAL #define MTR_PROVISIONALLY_AVAILABLE MTR_NEWLY_AVAILABLE #else -#define MTR_PROVISIONALLY_AVAILABLE NS_UNAVAILABLE MTR_HIDDEN -#endif +#define MTR_PROVISIONALLY_AVAILABLE NS_UNAVAILABLE +#endif // MTR_ENABLE_PROVISIONAL #ifndef MTR_PER_CONTROLLER_STORAGE_ENABLED #define MTR_PER_CONTROLLER_STORAGE_ENABLED 1 diff --git a/src/darwin/Framework/CHIP/MTRDefines_Internal.h b/src/darwin/Framework/CHIP/MTRDefines_Internal.h index 731ea45d4ce17a..6a684f5f879e04 100644 --- a/src/darwin/Framework/CHIP/MTRDefines_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDefines_Internal.h @@ -31,7 +31,7 @@ #ifdef DEBUG #define MTR_TESTABLE MTR_EXPORT #else -#define MTR_TESTABLE MTR_HIDDEN +#define MTR_TESTABLE #endif // clang-format off diff --git a/src/darwin/Framework/CHIP/MTRDevice.h b/src/darwin/Framework/CHIP/MTRDevice.h index 0dc1a1097ef0e7..bd92c1b3df4e11 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.h +++ b/src/darwin/Framework/CHIP/MTRDevice.h @@ -31,6 +31,7 @@ typedef NS_ENUM(NSUInteger, MTRDeviceState) { @protocol MTRDeviceDelegate; +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRDevice : NSObject - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 021d00c64f2e62..909fe065ac39ac 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -48,7 +48,6 @@ // Consider moving utility classes to their own file #pragma mark - Utility Classes // This class is for storing weak references in a container -MTR_HIDDEN @interface MTRWeakReference : NSObject + (instancetype)weakReferenceWithObject:(ObjectType)object; - (instancetype)initWithObject:(ObjectType)object; diff --git a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.h b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.h index 1eab2b22beb8b1..0c3e35e9809548 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.h +++ b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.h @@ -24,6 +24,7 @@ NS_ASSUME_NONNULL_BEGIN @class MTRDeviceController; +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRDeviceAttestationDeviceInfo : NSObject - (instancetype)init NS_UNAVAILABLE; @@ -51,8 +52,7 @@ NS_ASSUME_NONNULL_BEGIN * used for device attestation. If attestation succeeds, this must match one of * the product IDs from the certification declaration. */ -@property (nonatomic, readonly) NSNumber * basicInformationProductID MTR_AVAILABLE(ios(16.6), macos(13.5), watchos(9.6), tvos(16.6)) - ; +@property (nonatomic, readonly) NSNumber * basicInformationProductID MTR_AVAILABLE(ios(16.6), macos(13.5), watchos(9.6), tvos(16.6)); @property (nonatomic, readonly) MTRCertificateDERBytes dacCertificate; @property (nonatomic, readonly) MTRCertificateDERBytes dacPAICertificate; diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.h b/src/darwin/Framework/CHIP/MTRDeviceController.h index e830f024d8d155..a3757e6353f796 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController.h @@ -38,6 +38,7 @@ typedef void (^MTRDeviceConnectionCallback)(MTRBaseDevice * _Nullable device, NS @protocol MTRDevicePairingDelegate; @protocol MTRDeviceControllerDelegate; +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRDeviceController : NSObject /** diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index ba3ec1958a42fd..836ea101ff8b1d 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -1222,7 +1222,6 @@ - (void)operationalInstanceAdded:(chip::NodeId)nodeID * Shim to allow us to treat an MTRDevicePairingDelegate as an * MTRDeviceControllerDelegate. */ -MTR_HIDDEN @interface MTRDevicePairingDelegateShim : NSObject @property (nonatomic, readonly) id delegate; - (instancetype)initWithDelegate:(id)delegate; @@ -1280,7 +1279,6 @@ - (void)onPairingDeleted:(NSError * _Nullable)error * Shim to allow us to treat an MTRNOCChainIssuer as an * MTROperationalCertificateIssuer. */ -MTR_HIDDEN @interface MTROperationalCertificateChainIssuerShim : NSObject @property (nonatomic, readonly) id nocChainIssuer; @property (nonatomic, readonly) BOOL shouldSkipAttestationCertificateValidation; diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h b/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h index 3abab9ea48adcc..21adb966b80997 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h @@ -30,7 +30,6 @@ NS_ASSUME_NONNULL_BEGIN /** * Interface that represents a single CASE session resumption entry. */ -MTR_HIDDEN @interface MTRCASESessionResumptionInfo : NSObject @property (nonatomic) NSNumber * nodeID; @property (nonatomic) NSData * resumptionID; @@ -42,7 +41,6 @@ MTR_HIDDEN * Interface that wraps a type-safe API around * MTRDeviceControllerStorageDelegate. */ -MTR_HIDDEN @interface MTRDeviceControllerDataStore : NSObject - (nullable instancetype)initWithController:(MTRDeviceController *)controller diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index b87155b0f17b13..717679e233a3be 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -1128,7 +1128,6 @@ - (PersistentStorageDelegate *)storageDelegate @end -MTR_HIDDEN @interface MTRDummyStorage : NSObject @end diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.h b/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.h index b4c383b6481963..9616e22b7a494c 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.h @@ -24,7 +24,6 @@ NS_ASSUME_NONNULL_BEGIN typedef NSXPCConnection * _Nonnull (^MTRXPCConnectBlock)(void); -MTR_HIDDEN @interface MTRDeviceControllerOverXPC : MTRDeviceController - (instancetype)init NS_UNAVAILABLE; diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.h index 76dd5a9c8d5d04..f9cabae78b3418 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.h @@ -24,6 +24,7 @@ NS_ASSUME_NONNULL_BEGIN @protocol MTRKeypair; +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRDeviceControllerStartupParams : NSObject - (instancetype)init NS_UNAVAILABLE; diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h index 71e6a74f5688f3..66ced06e8e1673 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h @@ -91,7 +91,6 @@ NS_ASSUME_NONNULL_BEGIN @end -MTR_HIDDEN @interface MTRDeviceControllerStartupParamsInternal : MTRDeviceControllerStartupParams // Fabric table we can use to do things like allocate operational keys. diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerXPCConnection.h b/src/darwin/Framework/CHIP/MTRDeviceControllerXPCConnection.h index 0dc4592f2ea981..641413b82c9084 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerXPCConnection.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerXPCConnection.h @@ -29,7 +29,6 @@ typedef void (^MTRXPCReportHandler)(id _Nullable values, NSError * _Nullable err * Releasing the handle may cause invalidating the XPC connection. Hence, in order to retain the connection, the handle must not be * released. */ -MTR_HIDDEN @interface MTRDeviceControllerXPCProxyHandle : NSObject @property (nonatomic, readonly, getter=proxy) id proxy; @@ -43,7 +42,6 @@ typedef void (^MTRGetProxyHandleHandler)(dispatch_queue_t queue, MTRDeviceContro * * This class is in charge of making a new XPC connection and disconnecting as needed by the clients and by the report handlers. */ -MTR_HIDDEN @interface MTRDeviceControllerXPCConnection : NSObject /** diff --git a/src/darwin/Framework/CHIP/MTRDeviceOverXPC.h b/src/darwin/Framework/CHIP/MTRDeviceOverXPC.h index c7da1f211110e0..dadd7b4bf50e88 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceOverXPC.h +++ b/src/darwin/Framework/CHIP/MTRDeviceOverXPC.h @@ -25,7 +25,6 @@ NS_ASSUME_NONNULL_BEGIN -MTR_HIDDEN @interface MTRDeviceOverXPC : MTRBaseDevice - (instancetype)init NS_UNAVAILABLE; diff --git a/src/darwin/Framework/CHIP/MTRError.h b/src/darwin/Framework/CHIP/MTRError.h index 1abc415a35b0d1..a2bea3e5a49e40 100644 --- a/src/darwin/Framework/CHIP/MTRError.h +++ b/src/darwin/Framework/CHIP/MTRError.h @@ -20,9 +20,9 @@ #import NS_ASSUME_NONNULL_BEGIN -FOUNDATION_EXPORT NSErrorDomain const MTRErrorDomain; -FOUNDATION_EXPORT NSErrorDomain const MTRInteractionErrorDomain; +MTR_EXTERN NSErrorDomain const MTRErrorDomain MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN NSErrorDomain const MTRInteractionErrorDomain MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); /** * MTRErrorDomain contains errors caused by data processing the framework diff --git a/src/darwin/Framework/CHIP/MTRError.mm b/src/darwin/Framework/CHIP/MTRError.mm index 8d326a098f3681..9f7c0938b41c61 100644 --- a/src/darwin/Framework/CHIP/MTRError.mm +++ b/src/darwin/Framework/CHIP/MTRError.mm @@ -34,7 +34,6 @@ // Class for holding on to a CHIP_ERROR that we can use as the value // in a dictionary. -MTR_HIDDEN @interface MTRErrorHolder : NSObject @property (nonatomic, readonly) CHIP_ERROR error; diff --git a/src/darwin/Framework/CHIP/MTRError_Internal.h b/src/darwin/Framework/CHIP/MTRError_Internal.h index 8fb49d97f08237..9997118ae95191 100644 --- a/src/darwin/Framework/CHIP/MTRError_Internal.h +++ b/src/darwin/Framework/CHIP/MTRError_Internal.h @@ -25,7 +25,6 @@ NS_ASSUME_NONNULL_BEGIN -MTR_HIDDEN @interface MTRError : NSObject + (NSError * _Nullable)errorForCHIPErrorCode:(CHIP_ERROR)errorCode; + (NSError * _Nullable)errorForIMStatus:(const chip::app::StatusIB &)status; diff --git a/src/darwin/Framework/CHIP/MTROTAHeader.h b/src/darwin/Framework/CHIP/MTROTAHeader.h index 4eb7bbac849f4b..60a2bcabdb1683 100644 --- a/src/darwin/Framework/CHIP/MTROTAHeader.h +++ b/src/darwin/Framework/CHIP/MTROTAHeader.h @@ -37,8 +37,9 @@ typedef NS_ENUM(NSUInteger, MTROTAImageDigestType) { MTROTAImageDigestTypeSha3_256, MTROTAImageDigestTypeSha3_384, MTROTAImageDigestTypeSha3_512, -}; +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTROTAHeader : NSObject /** diff --git a/src/darwin/Framework/CHIP/MTRSetupPayload.h b/src/darwin/Framework/CHIP/MTRSetupPayload.h index 267e1d39f05f21..9d6466b9cbdc32 100644 --- a/src/darwin/Framework/CHIP/MTRSetupPayload.h +++ b/src/darwin/Framework/CHIP/MTRSetupPayload.h @@ -50,6 +50,7 @@ typedef NS_ENUM(NSUInteger, MTROptionalQRCodeInfoType) { * An optional information item present in the QR code the setup payload was * initialized from. */ +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTROptionalQRCodeInfo : NSObject @property (nonatomic, assign) MTROptionalQRCodeInfoType type MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -74,6 +75,7 @@ typedef NS_ENUM(NSUInteger, MTROptionalQRCodeInfoType) { * creating from numeric code will not work, because some required information * will be missing. */ +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRSetupPayload : NSObject @property (nonatomic, copy) NSNumber * version; diff --git a/src/darwin/Framework/CHIP/MTRThreadOperationalDataset.h b/src/darwin/Framework/CHIP/MTRThreadOperationalDataset.h index 76cfdbb6b49d4e..2464f54d18070b 100644 --- a/src/darwin/Framework/CHIP/MTRThreadOperationalDataset.h +++ b/src/darwin/Framework/CHIP/MTRThreadOperationalDataset.h @@ -26,6 +26,7 @@ NS_ASSUME_NONNULL_BEGIN * The latter can be used to pass Thread network credentials via * MTRCommissioningParameters. */ +MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRThreadOperationalDataset : NSObject - (instancetype)init NS_UNAVAILABLE; @@ -61,13 +62,13 @@ NS_ASSUME_NONNULL_BEGIN /** * The expected lengths of each of the NSData fields in the MTRThreadOperationalDataset */ -extern size_t const MTRSizeThreadNetworkName; -extern size_t const MTRSizeThreadExtendedPanId MTR_DEPRECATED( +MTR_EXTERN size_t const MTRSizeThreadNetworkName MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN size_t const MTRSizeThreadExtendedPanId MTR_DEPRECATED( "Please use MTRSizeThreadExtendedPANID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -extern size_t const MTRSizeThreadExtendedPANID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -extern size_t const MTRSizeThreadMasterKey; -extern size_t const MTRSizeThreadPSKc; -extern size_t const MTRSizeThreadPANID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +MTR_EXTERN size_t const MTRSizeThreadExtendedPANID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +MTR_EXTERN size_t const MTRSizeThreadMasterKey MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN size_t const MTRSizeThreadPSKc MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_EXTERN size_t const MTRSizeThreadPANID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); /** * The Thread Network name diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index a7f00d50661487..11552fbd217d12 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -2032,6 +2032,7 @@ "CHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=", "$(inherited)", ); + GCC_SYMBOLS_PRIVATE_EXTERN = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; @@ -2039,14 +2040,16 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-Wl,-unexported_symbol,\"__Z*\""; + OTHER_TAPI_FLAGS = "-fobjc-arc -fvisibility=hidden"; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos appletvos appletvsimulator watchos watchsimulator"; - SUPPORTS_TEXT_BASED_API = NO; + SUPPORTS_TEXT_BASED_API = YES; SWIFT_INSTALL_OBJC_HEADER = NO; + TAPI_ENABLE_PROJECT_HEADERS = YES; + TAPI_LANGUAGE = "objective-c++"; + TAPI_LANGUAGE_STANDARD = "gnu++17"; TARGETED_DEVICE_FAMILY = "1,2,3,4"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -2076,20 +2079,6 @@ "CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES=1", "MTR_ENABLE_PROVISIONAL=1", ); - HEADER_SEARCH_PATHS = ( - "$(CHIP_ROOT)/src", - "$(CHIP_ROOT)/src/include", - "$(CHIP_ROOT)/src/lib", - "$(CHIP_ROOT)/src/app", - "$(CHIP_ROOT)/config/ios", - "$(CHIP_ROOT)/third_party/nlassert/repo/include", - "$(CHIP_ROOT)/src/darwin/Framework/CHIP/", - "$(CHIP_ROOT)/src/app/util", - "$(CHIP_ROOT)/third_party/nlio/repo/include", - "$(TEMP_DIR)/out/gen/include", - "$(CHIP_ROOT)/zzz_generated/", - "$(CHIP_ROOT)/zzz_generated/app-common", - ); INFOPLIST_FILE = CHIP/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 13.4; @@ -2131,6 +2120,20 @@ PRODUCT_BUNDLE_IDENTIFIER = com.csa.matter; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = iphoneos; + SYSTEM_HEADER_SEARCH_PATHS = ( + "$(TEMP_DIR)/out/gen/include", + "$(CHIP_ROOT)/src/darwin/Framework/CHIP/", + "$(CHIP_ROOT)/config/ios", + "$(CHIP_ROOT)/src", + "$(CHIP_ROOT)/src/include", + "$(CHIP_ROOT)/src/lib", + "$(CHIP_ROOT)/src/app", + "$(CHIP_ROOT)/zzz_generated/", + "$(CHIP_ROOT)/zzz_generated/app-common", + "$(CHIP_ROOT)/third_party/nlassert/repo/include", + "$(CHIP_ROOT)/src/app/util", + "$(CHIP_ROOT)/third_party/nlio/repo/include", + ); TAPI_VERIFY_MODE = Pedantic; TARGETED_DEVICE_FAMILY = "1,2,3,4"; VERSION_INFO_EXPORT_DECL = "__attribute__((visibility(\"hidden\")))"; @@ -2197,6 +2200,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_PREPROCESSOR_DEFINITIONS = ""; + GCC_SYMBOLS_PRIVATE_EXTERN = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; @@ -2204,14 +2208,15 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-Wl,-unexported_symbol,\"__Z*\""; + OTHER_TAPI_FLAGS = "-fobjc-arc -fvisibility=hidden"; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos appletvos appletvsimulator watchos watchsimulator"; SUPPORTS_TEXT_BASED_API = YES; SWIFT_INSTALL_OBJC_HEADER = NO; + TAPI_LANGUAGE = "objective-c++"; + TAPI_LANGUAGE_STANDARD = "gnu++17"; TARGETED_DEVICE_FAMILY = "1,2,3,4"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -2242,20 +2247,6 @@ "CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES=1", "MTR_ENABLE_PROVISIONAL=1", ); - HEADER_SEARCH_PATHS = ( - "$(CHIP_ROOT)/src", - "$(CHIP_ROOT)/src/include", - "$(CHIP_ROOT)/src/lib", - "$(CHIP_ROOT)/src/app", - "$(CHIP_ROOT)/config/ios", - "$(CHIP_ROOT)/third_party/nlassert/repo/include", - "$(CHIP_ROOT)/src/darwin/Framework/CHIP/", - "$(CHIP_ROOT)/src/app/util", - "$(CHIP_ROOT)/third_party/nlio/repo/include", - "$(TEMP_DIR)/out/gen/include", - "$(CHIP_ROOT)/zzz_generated/", - "$(CHIP_ROOT)/zzz_generated/app-common", - ); INFOPLIST_FILE = CHIP/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 13.4; @@ -2298,6 +2289,20 @@ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = iphoneos; STRIP_STYLE = "non-global"; + SYSTEM_HEADER_SEARCH_PATHS = ( + "$(TEMP_DIR)/out/gen/include", + "$(CHIP_ROOT)/src/darwin/Framework/CHIP/", + "$(CHIP_ROOT)/config/ios", + "$(CHIP_ROOT)/src", + "$(CHIP_ROOT)/src/include", + "$(CHIP_ROOT)/src/lib", + "$(CHIP_ROOT)/src/app", + "$(CHIP_ROOT)/zzz_generated/", + "$(CHIP_ROOT)/zzz_generated/app-common", + "$(CHIP_ROOT)/third_party/nlassert/repo/include", + "$(CHIP_ROOT)/src/app/util", + "$(CHIP_ROOT)/third_party/nlio/repo/include", + ); TAPI_VERIFY_MODE = Pedantic; TARGETED_DEVICE_FAMILY = "1,2,3,4"; VERSION_INFO_EXPORT_DECL = "__attribute__((visibility(\"hidden\")))";