Skip to content

AccessorySetupKit iOS xcode16.0 b4

Rolf Bjarne Kvinge edited this page Aug 12, 2024 · 3 revisions

#AccessorySetupKit.framework https://github.com/xamarin/xamarin-macios/pull/20857

diff -ruN /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASAccessory.h /Applications/Xcode_16.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASAccessory.h
--- /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASAccessory.h	2024-06-29 10:40:05
+++ /Applications/Xcode_16.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASAccessory.h	2024-07-12 14:00:45
@@ -18,7 +18,7 @@
 //---------------------------------------------------------------------------------------------------------------------------
 /*!    @brief        Authorized Accessory State
 */
-typedef CF_ENUM( NSInteger, ASAccessoryState )
+typedef NS_ENUM( NSInteger, ASAccessoryState )
 {
     ASAccessoryStateUnauthorized            = 0,    // Invalid or Unauthorized Accessory.
     ASAccessoryStateAwaitingAuthorization   = 10,   // Selected by user but pending for full authorization.
@@ -58,6 +58,12 @@
     @abstract    A bluetooth identifier which clients can use to establish a connection to a bluetooth device.
 */
 @property (readonly, copy, nullable, nonatomic) NSUUID *bluetoothIdentifier;
+
+/*!
+    @property    bluetoothTransportBridgingIdentifier
+    @abstract    Identifier for bridging classic transport profiles.
+*/
+@property (readonly, copy, nullable, nonatomic) NSData *bluetoothTransportBridgingIdentifier;
 
 /*!
     @property    name
diff -ruN /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASAccessoryEvent.h /Applications/Xcode_16.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASAccessoryEvent.h
--- /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASAccessoryEvent.h	2024-06-29 10:40:05
+++ /Applications/Xcode_16.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASAccessoryEvent.h	2024-07-12 14:00:45
@@ -23,15 +23,19 @@
 /// Type of event.
 typedef NS_ENUM( NSInteger, ASAccessoryEventType )
 {
-    ASAccessoryEventTypeUnknown NS_SWIFT_NAME(unknown)                              = 0,    // Unknown event. Placeholder for initializing event types.
-    ASAccessoryEventTypeActivated NS_SWIFT_NAME(activated)                          = 10,   // [ASAccessoryEvent] Instance activate completed.
-    ASAccessoryEventTypeInvalidated NS_SWIFT_NAME(invalidated)                      = 11,   // [ASAccessoryEvent] Instance invalidated.
-    ASAccessoryEventTypeMigrationComplete NS_SWIFT_NAME(migrationComplete)          = 20,   // [ASAccessoryEvent] Accessories migration complete.
-    ASAccessoryEventTypeAccessoryAdded NS_SWIFT_NAME(accessoryAdded)                = 30,   // [ASAccessoryEvent] Accessory added.
-    ASAccessoryEventTypeAccessoryRemoved NS_SWIFT_NAME(accessoryRemoved)            = 31,   // [ASAccessoryEvent] Accessory removed from system.
-    ASAccessoryEventTypeAccessoryChanged NS_SWIFT_NAME(accessoryChanged)            = 32,   // [ASAccessoryEvent] Accessory properties changed.
-    ASAccessoryEventTypePickerDidPresent NS_SWIFT_NAME(pickerDidPresent)            = 42,   // [ASAccessoryEvent] Picker did present.
-    ASAccessoryEventTypePickerDidDismiss NS_SWIFT_NAME(pickerDidDismiss)            = 45,   // [ASAccessoryEvent] Picker did dismiss.
+    ASAccessoryEventTypeUnknown                     = 0,    // Unknown event. Placeholder for initializing event types.
+    ASAccessoryEventTypeActivated                   = 10,   // [ASAccessoryEvent] Instance activate completed.
+    ASAccessoryEventTypeInvalidated                 = 11,   // [ASAccessoryEvent] Instance invalidated.
+    ASAccessoryEventTypeMigrationComplete           = 20,   // [ASAccessoryEvent] Accessories migration complete.
+    ASAccessoryEventTypeAccessoryAdded              = 30,   // [ASAccessoryEvent] Accessory added.
+    ASAccessoryEventTypeAccessoryRemoved            = 31,   // [ASAccessoryEvent] Accessory removed from system.
+    ASAccessoryEventTypeAccessoryChanged            = 32,   // [ASAccessoryEvent] Accessory properties changed.
+    ASAccessoryEventTypePickerDidPresent            = 40,   // [ASAccessoryEvent] Picker did present.
+    ASAccessoryEventTypePickerDidDismiss            = 50,   // [ASAccessoryEvent] Picker did dismiss.
+    ASAccessoryEventTypePickerSetupBridging         = 60,   // [ASAccessoryEvent] Picker started bridging with accessory.
+    ASAccessoryEventTypePickerSetupFailed           = 70,   // [ASAccessoryEvent] Picker failed setup for accessory.
+    ASAccessoryEventTypePickerSetupPairing          = 80,   // [ASAccessoryEvent] Picker started pairing with accessory.
+    ASAccessoryEventTypePickerSetupRename           = 90,   // [ASAccessoryEvent] Picker started rename of accessory.
 };
 
 //===========================================================================================================================
diff -ruN /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASAccessorySession.h /Applications/Xcode_16.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASAccessorySession.h
--- /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASAccessorySession.h	2024-06-29 10:40:05
+++ /Applications/Xcode_16.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASAccessorySession.h	2024-07-12 14:00:45
@@ -46,11 +46,16 @@
 				  completionHandler:(void(^)(NSError * _Nullable error)) completionHandler
 NS_SWIFT_NAME(showPicker(for:completionHandler:));
 
-/// Finish accessory.awaiting authorization.
+/// Finish accessory setup awaiting authorization.
 - (void) finishAuthorization:(ASAccessory *) accessory
                     settings:(ASAccessorySettings *) settings
            completionHandler:(void(^)(NSError * _Nullable error)) completionHandler
 NS_SWIFT_NAME(finishAuthorization(for:settings:completionHandler:));
+
+/// Fail accessory setup awaiting authorization.
+- (void) failAuthorization:(ASAccessory *) accessory
+         completionHandler:(void(^)(NSError * _Nullable error)) completionHandler
+NS_SWIFT_NAME(failAuthorization(for:completionHandler:));
 
 /// Remove accessory.
 - (void) removeAccessory:(ASAccessory *) accessory
diff -ruN /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASAccessorySettings.h /Applications/Xcode_16.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASAccessorySettings.h
--- /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASAccessorySettings.h	2024-06-29 10:40:05
+++ /Applications/Xcode_16.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASAccessorySettings.h	2024-07-12 14:00:45
@@ -18,10 +18,22 @@
 @interface ASAccessorySettings : NSObject
 
 /*!
+    @property    defaultSettings
+    @abstract    Empty settings object.
+*/
+@property (class, readonly, nonatomic) ASAccessorySettings *defaultSettings;
+
+/*!
     @property    SSID
     @abstract    Hotspot identifier which clients can use to connect to accessory's hotspot.
 */
 @property (readwrite, copy, nullable, nonatomic) NSString *SSID;
+
+/*!
+    @property    bluetoothTransportBridgingIdentifier
+    @abstract    6-byte Identifier for bridging classic transport profiles.
+*/
+@property (readwrite, copy, nullable, nonatomic) NSData *bluetoothTransportBridgingIdentifier;
 
 @end
 
diff -ruN /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASDiscoveryDescriptor.h /Applications/Xcode_16.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASDiscoveryDescriptor.h
--- /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASDiscoveryDescriptor.h	2024-06-29 10:40:04
+++ /Applications/Xcode_16.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASDiscoveryDescriptor.h	2024-07-12 14:00:45
@@ -15,6 +15,15 @@
 
 @class CBUUID;
 
+//---------------------------------------------------------------------------------------------------------------------------
+/*!    @brief        Discovery Range
+*/
+typedef NS_ENUM( NSInteger, ASDiscoveryDescriptorRange )
+{
+    ASDiscoveryDescriptorRangeDefault            = 0,
+    ASDiscoveryDescriptorRangeImmediate          = 10,
+} NS_SWIFT_NAME(ASDiscoveryDescriptor.Range);
+
 AS_EXTERN
 API_AVAILABLE( ios( 18.0 ) ) API_UNAVAILABLE(macos, macCatalyst, watchos, tvos, visionos)
 NS_SWIFT_SENDABLE
@@ -49,6 +58,12 @@
  * @discussion Accessory's over-the-air Bluetooth name sub-string.
  */
 @property (readwrite, copy, nullable, nonatomic) NSString *bluetoothNameSubstring;
+
+/*!
+ * @property bluetoothRange
+ * @discussion Discover accessory within specific bluetooth range.
+ */
+@property (readwrite, assign, nonatomic) ASDiscoveryDescriptorRange bluetoothRange;
 
 /*!
  * @property serviceDataBlob
diff -ruN /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASErrors.h /Applications/Xcode_16.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASErrors.h
--- /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASErrors.h	2024-06-29 10:40:04
+++ /Applications/Xcode_16.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASErrors.h	2024-07-12 14:00:45
@@ -21,9 +21,11 @@
     ASErrorCodeSuccess                      = 0,        // Success.
     ASErrorCodeUnknown                      = 1,        // Underlying failure with an unknown cause.
     ASErrorCodeActivationFailed             = 100,      // Unable to activate discovery session.
+    ASErrorCodeConnectionFailed             = 150,      // Unable to establish connection with accessory.
     ASErrorCodeDiscoveryTimeout             = 200,      // Discovery timed out.
     ASErrorCodeExtensionNotFound            = 300,      // Unable to find App Extension.
     ASErrorCodeInvalidated                  = 400,      // Invalidate was called before the operation completed normally.
+    ASErrorCodeInvalidRequest               = 450,      // Invalid request.
     ASErrorCodePickerAlreadyActive          = 500,      // Picker already active.
     ASErrorCodePickerRestricted             = 550,      // Picker restricted due to application in background.
     ASErrorCodeUserCancelled                = 700,      // User cancelled.
diff -ruN /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASPickerDisplayItem.h /Applications/Xcode_16.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASPickerDisplayItem.h
--- /Applications/Xcode_16.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASPickerDisplayItem.h	2024-06-29 10:40:05
+++ /Applications/Xcode_16.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AccessorySetupKit.framework/Headers/ASPickerDisplayItem.h	2024-07-12 14:00:45
@@ -15,6 +15,15 @@
 
 @class ASDiscoveryDescriptor;
 
+//---------------------------------------------------------------------------------------------------------------------------
+/*!    @brief        Accessory Setup Options
+*/
+typedef NS_OPTIONS( NSUInteger, ASPickerDisplayItemSetupOptions )
+{
+    ASPickerDisplayItemSetupRename                          = ( 1U << 0 ),   // Ask user to rename accessory.
+    ASPickerDisplayItemSetupConfirmAuthorization            = ( 1U << 1 ),   // App session finishes accessory authorization.
+} NS_SWIFT_NAME(ASPickerDisplayItem.SetupOptions);
+
 AS_EXTERN
 API_AVAILABLE( ios( 18.0 ) ) API_UNAVAILABLE(macos, macCatalyst, watchos, tvos, visionos)
 NS_SWIFT_SENDABLE
@@ -23,11 +32,9 @@
 /// NOTE:-  `name` and `image` is ignored if display item matched with an already authorized accessory for another app
 
 /// Ask user to rename accessory.
-@property (readwrite, assign, nonatomic) BOOL allowsRename;
+@property (readwrite, assign, nonatomic) BOOL allowsRename
+API_DEPRECATED_WITH_REPLACEMENT( "ASPickerDisplayItem.setupOptions", ios( 18.0, 18.0 ) );
 
-/// Accessory rename option. `allowsRename` needs to be allowed to update options.
-@property (readwrite, assign, nonatomic) ASAccessoryRenameOptions renameOptions;
-
 /// Accessory's display name on picker as title.
 @property (readonly, copy, nonatomic) NSString *name;
 
@@ -36,6 +43,12 @@
 
 /// Accessory discovery parameters.
 @property (readonly, copy, nonatomic) ASDiscoveryDescriptor *descriptor;
+
+/// Accessory rename option. `allowsRename` needs to be allowed to update options.
+@property (readwrite, assign, nonatomic) ASAccessoryRenameOptions renameOptions;
+
+/// Accessory custom setup options.
+@property (readwrite, assign, nonatomic) ASPickerDisplayItemSetupOptions setupOptions;
 
 - (instancetype)initWithName:(NSString *) name productImage:(UIImage *) productImage
         descriptor:(ASDiscoveryDescriptor *) descriptor NS_DESIGNATED_INITIALIZER;
Clone this wiki locally