Skip to content

Commit

Permalink
Update Matter.framework availability annotations. (#25741)
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple authored and David Lechner committed Mar 22, 2023
1 parent 5c0c21a commit 3704244
Show file tree
Hide file tree
Showing 10 changed files with 349 additions and 304 deletions.
14 changes: 8 additions & 6 deletions src/darwin/Framework/CHIP/MTRBaseDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,23 +453,24 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4))
typedef NS_ENUM(NSUInteger, MTREventTimeType) {
MTREventTimeTypeSystemUpTime = 0,
MTREventTimeTypeTimestampDate
} MTR_NEWLY_AVAILABLE;
} API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5));

typedef NS_ENUM(NSUInteger, MTREventPriority) {
MTREventPriorityDebug = 0,
MTREventPriorityInfo = 1,
MTREventPriorityCritical = 2
} MTR_NEWLY_AVAILABLE;
} API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5));

@interface MTREventReport : NSObject
@property (nonatomic, readonly, copy) MTREventPath * path;
@property (nonatomic, readonly, copy) NSNumber * eventNumber; // EventNumber type (uint64_t)
@property (nonatomic, readonly, copy) NSNumber * priority; // PriorityLevel type (MTREventPriority)

// Either systemUpTime or timestampDate will be valid depending on eventTimeType
@property (nonatomic, readonly) MTREventTimeType eventTimeType MTR_NEWLY_AVAILABLE;
@property (nonatomic, readonly) NSTimeInterval systemUpTime MTR_NEWLY_AVAILABLE;
@property (nonatomic, readonly, copy, nullable) NSDate * timestampDate MTR_NEWLY_AVAILABLE;
@property (nonatomic, readonly) MTREventTimeType eventTimeType API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5));
@property (nonatomic, readonly) NSTimeInterval systemUpTime API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5));
@property (nonatomic, readonly, copy, nullable)
NSDate * timestampDate API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5));

// An instance of one of the event payload interfaces.
@property (nonatomic, readonly, copy) id value;
Expand Down Expand Up @@ -581,7 +582,8 @@ typedef NS_ENUM(NSUInteger, MTREventPriority) {
@end

@interface MTREventReport (Deprecated)
@property (nonatomic, readonly, copy) NSNumber * timestamp MTR_NEWLY_DEPRECATED("Please use timestampDate and systemUpTime");
@property (nonatomic, readonly, copy) NSNumber * timestamp MTR_DEPRECATED(
"Please use timestampDate and systemUpTime", ios(16.1, 16.5), macos(13.0, 13.4), watchos(9.1, 9.5), tvos(16.1, 16.5));
@end

NS_ASSUME_NONNULL_END
13 changes: 7 additions & 6 deletions src/darwin/Framework/CHIP/MTRDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ typedef NS_ENUM(NSUInteger, MTRDeviceState) {
*
* If events are always reported with calendar time, then this property will return nil.
*/
@property (nonatomic, readonly, nullable) NSDate * estimatedStartTime MTR_NEWLY_AVAILABLE;
@property (nonatomic, readonly, nullable)
NSDate * estimatedStartTime API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5));

/**
* Set the delegate to receive asynchronous callbacks about the device.
Expand Down Expand Up @@ -185,11 +186,11 @@ typedef NS_ENUM(NSUInteger, MTRDeviceState) {

@end

extern NSString * const MTREventNumberKey MTR_NEWLY_AVAILABLE;
extern NSString * const MTREventPriorityKey MTR_NEWLY_AVAILABLE;
extern NSString * const MTREventTimeTypeKey MTR_NEWLY_AVAILABLE;
extern NSString * const MTREventSystemUpTimeKey MTR_NEWLY_AVAILABLE;
extern NSString * const MTREventTimestampDateKey MTR_NEWLY_AVAILABLE;
extern NSString * const MTREventNumberKey API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5));
extern NSString * const MTREventPriorityKey API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5));
extern NSString * const MTREventTimeTypeKey API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5));
extern NSString * const MTREventSystemUpTimeKey API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5));
extern NSString * const MTREventTimestampDateKey API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5));

@protocol MTRDeviceDelegate <NSObject>
@required
Expand Down
4 changes: 2 additions & 2 deletions src/darwin/Framework/CHIP/MTRDeviceController+XPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ typedef void (^MTRValuesHandler)(id _Nullable values, NSError * _Nullable error)
/**
* Returns an NSXPCInterface configured for MTRDeviceControllerServerProtocol.
*/
+ (NSXPCInterface *)xpcInterfaceForServerProtocol MTR_NEWLY_AVAILABLE;
+ (NSXPCInterface *)xpcInterfaceForServerProtocol API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5));

/**
* Returns an NSXPCInterface configured for MTRDeviceControllerClientProtocol.
*/
+ (NSXPCInterface *)xpcInterfaceForClientProtocol MTR_NEWLY_AVAILABLE;
+ (NSXPCInterface *)xpcInterfaceForClientProtocol API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5));
@end

/**
Expand Down
3 changes: 2 additions & 1 deletion src/darwin/Framework/CHIP/MTRDeviceControllerDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ typedef NS_ENUM(NSInteger, MTRCommissioningStatus) {
MTRCommissioningStatusUnknown = 0,
MTRCommissioningStatusSuccess = 1,
MTRCommissioningStatusFailed = 2,
MTRCommissioningStatusDiscoveringMoreDevices MTR_NEWLY_DEPRECATED("MTRCommissioningStatusDiscoveringMoreDevices is not used.")
MTRCommissioningStatusDiscoveringMoreDevices MTR_DEPRECATED("MTRCommissioningStatusDiscoveringMoreDevices is not used.",
ios(16.1, 16.5), macos(13.0, 13.4), watchos(9.1, 9.5), tvos(16.1, 16.5))
= 3,
} API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));

Expand Down
2 changes: 1 addition & 1 deletion src/darwin/Framework/CHIP/MTRFabricInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

NS_ASSUME_NONNULL_BEGIN

MTR_NEWLY_AVAILABLE
API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5))
@interface MTRFabricInfo : NSObject

- (instancetype)init NS_UNAVAILABLE;
Expand Down
9 changes: 8 additions & 1 deletion src/darwin/Framework/CHIP/templates/availability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6541,7 +6541,11 @@
CoolSetpointPresent: CoolSetpointFieldPresent

- release: "First after major API revamp"
versions: "future"
versions:
ios: "16.5"
macos: "13.4"
watchos: "9.5"
tvos: "16.5"
introduced:
attributes:
TimeSynchronization:
Expand Down Expand Up @@ -6997,3 +7001,6 @@
PumpConfigurationAndControl:
PumpFeature:
LocalOperation: Local

- release: "TBD"
versions: "future"
Loading

0 comments on commit 3704244

Please sign in to comment.