-
Notifications
You must be signed in to change notification settings - Fork 520
DeviceDiscoveryExtension macOS xcode16.0 b6
Rolf Bjarne Kvinge edited this page Sep 3, 2024
·
2 revisions
#DeviceDiscoveryExtension.framework https://github.com/xamarin/xamarin-macios/pull/21175
diff -ruN /Applications/Xcode_16.0.0-beta5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDCommon.h /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDCommon.h
--- /Applications/Xcode_16.0.0-beta5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDCommon.h 1970-01-01 01:00:00
+++ /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDCommon.h 2024-08-07 13:31:36
@@ -0,0 +1,39 @@
+/*
+ Copyright (C) 2021-2022 Apple Inc. All Rights Reserved.
+*/
+
+#ifndef DEVICE_DISCOVERY_EXTENSION_INDIRECT_INCLUDES
+#error "Please #import <DeviceDiscoveryExtension/DeviceDiscoveryExtension.h> instead of this file directly."
+#endif
+
+#pragma once
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/// Marks an API as exported.
+#ifndef DD_EXTERN
+#ifdef __cplusplus
+#define DD_EXTERN extern "C" __attribute__((visibility("default")))
+#else
+#define DD_EXTERN extern __attribute__((visibility("default")))
+#endif
+#endif
+
+/// Work around some projects disabling OS_OBJECT_USE_OBJC by mapping to strong/assign as needed.
+#if defined( OS_OBJECT_USE_OBJC ) && OS_OBJECT_USE_OBJC
+ #define dd_os_ownership strong
+#else
+ #define dd_os_ownership assign
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_16.0.0-beta5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDDevice.h /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDDevice.h
--- /Applications/Xcode_16.0.0-beta5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDDevice.h 1970-01-01 01:00:00
+++ /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDDevice.h 2024-08-07 12:46:57
@@ -0,0 +1,177 @@
+// Copyright (C) 2021-2024 Apple Inc. All Rights Reserved.
+
+#ifndef DEVICE_DISCOVERY_EXTENSION_INDIRECT_INCLUDES
+#error "Please #import <DeviceDiscoveryExtension/DeviceDiscoveryExtension.h> instead of this file directly."
+#endif
+
+#pragma once
+
+#import <DeviceDiscoveryExtension/DDCommon.h>
+#import <Foundation/Foundation.h>
+#import <Network/Network.h>
+#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// @defgroup Supported Protocols
+typedef NSString * DDDeviceProtocolString NS_STRING_ENUM;
+
+API_AVAILABLE( ios( 16.0 ) )
+DD_EXTERN DDDeviceProtocolString const DDDeviceProtocolStringInvalid;
+
+API_AVAILABLE( ios( 16.0 ) )
+DD_EXTERN DDDeviceProtocolString const DDDeviceProtocolStringDIAL NS_SWIFT_NAME(DDDeviceProtocolString.dial);
+
+//---------------------------------------------------------------------------------------------------------------------------
+
+typedef NS_ENUM( NSInteger, DDDeviceProtocol )
+ {
+ DDDeviceProtocolInvalid NS_SWIFT_NAME(invalid) = 0, /// Invalid protocol.
+ DDDeviceProtocolDIAL NS_SWIFT_NAME(dial) = 1, /// DIAL protocol.
+ } NS_SWIFT_NAME(DDDevice.Protocol);
+
+/// Converts a device protocol type to a string for logging, etc.
+DD_EXTERN
+API_AVAILABLE( ios( 16.0 ) )
+NSString * DDDeviceProtocolToString( DDDeviceProtocol inValue );
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// Category of the device.
+typedef NS_ENUM( NSInteger, DDDeviceCategory )
+{
+ DDDeviceCategoryHiFiSpeaker NS_SWIFT_NAME(hifiSpeaker) = 0, /// Hi-Fi speaker.
+ DDDeviceCategoryHiFiSpeakerMultiple NS_SWIFT_NAME(hifiSpeakerMultiple) = 1, /// Multiple Hi-Fi speakers.
+ DDDeviceCategoryTVWithMediaBox NS_SWIFT_NAME(tvWithMediaBox) = 2, /// TV with MediaBox.
+ DDDeviceCategoryTV NS_SWIFT_NAME(tv) = 3, /// TV.
+ DDDeviceCategoryLaptopComputer NS_SWIFT_NAME(laptopComputer) = 4, /// Laptop computer.
+ DDDeviceCategoryDesktopComputer NS_SWIFT_NAME(desktopComputer) = 5, /// Desktop computer.
+ DDDeviceCategoryAccessorySetup NS_SWIFT_NAME(accessorySetup) = 6, /// AccessorySetupKit.
+} NS_SWIFT_NAME(DDDevice.Category);
+
+/// Converts a device category to a string for logging, etc.
+DD_EXTERN
+API_AVAILABLE( ios( 16.0 ) )
+NSString * DDDeviceCategoryToString( DDDeviceCategory inValue );
+
+//===========================================================================================================================
+/// State of the device.
+typedef NS_ENUM( NSInteger, DDDeviceState )
+{
+ DDDeviceStateInvalid = 0, /// Invalid/unapproved state.
+ DDDeviceStateActivating = 10, /// Selected by the user.
+ DDDeviceStateActivated = 20, /// Authorized and connected.
+ DDDeviceStateAuthorized = 25, /// Authorized by the user.
+ DDDeviceStateInvalidating = 30, /// Invalidating state.
+};
+
+/// Converts a device state to a string for logging, etc.
+DD_EXTERN
+API_AVAILABLE( ios( 16.0 ) )
+NSString * DDDeviceStateToString( DDDeviceState inValue );
+
+//===========================================================================================================================
+/// State of media playback on the device.
+typedef NS_ENUM( NSInteger, DDDeviceMediaPlaybackState )
+{
+ DDDeviceMediaPlaybackStateNoContent = 0, /// Not playing any media content.
+ DDDeviceMediaPlaybackStatePaused = 1, /// Media content playback is paused.
+ DDDeviceMediaPlaybackStatePlaying = 2, /// Media content is playing.
+} NS_SWIFT_NAME(DDDevice.MediaPlaybackState);
+
+//===========================================================================================================================
+/*! @brief Device Support
+*/
+typedef NS_OPTIONS( NSUInteger, DDDeviceSupports )
+{
+ DDDeviceSupportsBluetoothPairingLE = ( 1U << 1 ), /// Device supports Bluetooth Low Energy pairing.
+ DDDeviceSupportsBluetoothTransportBridging = ( 1U << 2 ), /// Device supports bring up of classic transport profiles when low energy transport for peripheral is connected.
+};
+
+/// Converts a device media playback state to a string for logging, etc.
+DD_EXTERN
+API_AVAILABLE( ios( 16.0 ) )
+NSString * DDDeviceMediaPlaybackStateToString( DDDeviceMediaPlaybackState inValue );
+
+//===========================================================================================================================
+/// DeviceDiscoveryExtension device.
+DD_EXTERN
+API_AVAILABLE( ios( 16.0 ) )
+@interface DDDevice : NSObject
+
+- (instancetype) init NS_UNAVAILABLE;
+
+/// Initializes a DD device with display name, category, protocol type, and identifier.
+- (instancetype) initWithDisplayName:(NSString *) displayName category:(DDDeviceCategory) category
+ protocolType:(UTType *) protocolType identifier:(NSString *) identifier NS_DESIGNATED_INITIALIZER;
+
+/// Device supported capabilities.
+@property (readwrite, assign, nonatomic) DDDeviceSupports deviceSupports
+ API_AVAILABLE( ios( 18.0 ) );
+
+/// Identifier to communicate with the device via Bluetooth.
+@property (readwrite, strong, nullable, nonatomic) NSUUID *bluetoothIdentifier;
+
+/// Category of the device.
+@property (readwrite, assign, nonatomic) DDDeviceCategory category;
+
+/// Device's custom asset for product image name in the main App bundle.
+@property (readwrite, copy, nullable, nonatomic) NSString *displayImageName
+ API_AVAILABLE( ios( 18.0 ) );
+
+/// Name of the device. Should be suitable for displaying to a user.
+@property (readwrite, copy, nonatomic) NSString *displayName;
+
+/// Identifier of the device.
+@property (readwrite, copy, nonatomic) NSString *identifier;
+
+/// Current state of media playback on this device.
+@property (readwrite, assign, nonatomic) DDDeviceMediaPlaybackState mediaPlaybackState;
+
+/// Title of the media content being played.
+@property (readwrite, copy, nullable, nonatomic) NSString *mediaContentTitle;
+
+/// Subtitle of the media content being played. It can be used to display extra information about the content, such as the name of the artist.
+@property (readwrite, copy, nullable, nonatomic) NSString *mediaContentSubtitle;
+
+/// Endpoint to communicate with the device via networking.
+@property (readwrite, dd_os_ownership, nullable, nonatomic) nw_endpoint_t networkEndpoint
+ NS_REFINED_FOR_SWIFT;
+
+/// Protocol of the device.
+@property (readwrite, assign, nonatomic) DDDeviceProtocol protocol;
+
+/// Uniform Type for the protocol.
+@property (readwrite, strong, nonatomic) UTType *protocolType;
+
+/// State of the device.
+@property (readwrite, assign, nonatomic) DDDeviceState state;
+
+/// Device's WiFi Hotspot SSID.
+@property (readwrite, copy, nullable, nonatomic) NSString *SSID
+ API_AVAILABLE( ios( 18.0 ) );
+
+/// Whether the device supports grouping with other devices with the same protocol.
+@property (readwrite, assign, nonatomic) BOOL supportsGrouping
+ API_AVAILABLE( ios( 17.0 ) );
+
+/// TXT record of the device.
+@property (readwrite, copy, nullable, nonatomic) NSData *txtRecordData
+ NS_REFINED_FOR_SWIFT;
+
+/// URL used for SSDP connection.
+/// The URL must have a valid hostname, no query parameters, and a maximum size of 100 bytes.
+@property (readwrite, copy, nonatomic) NSURL *url;
+
+
+@end
+
+#ifdef __cplusplus
+}
+#endif
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_16.0.0-beta5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDErrors.h /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDErrors.h
--- /Applications/Xcode_16.0.0-beta5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDErrors.h 1970-01-01 01:00:00
+++ /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDErrors.h 2024-08-07 13:31:37
@@ -0,0 +1,55 @@
+/*
+ Copyright (C) 2021-2022 Apple Inc. All Rights Reserved.
+*/
+
+#ifndef DEVICE_DISCOVERY_EXTENSION_INDIRECT_INCLUDES
+#error "Please #import <DeviceAccess/DeviceAccess.h> instead of this file directly."
+#endif
+
+#pragma once
+
+#import <DeviceDiscoveryExtension/DeviceDiscoveryExtension.h>
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/// NSError domain for DeviceAccess errors.
+API_AVAILABLE( ios( 16.0 ) )
+DD_EXTERN NSString * const DDErrorDomain;
+
+/// Error codes used with DDErrorDomain.
+/// DeviceDiscoveryExtension error code range: 350000-350999.
+typedef NS_ERROR_ENUM( DDErrorDomain, DDErrorCode )
+{
+ DDErrorCodeSuccess = 0, /// Success.
+ DDErrorCodeUnknown = 350000, /// Underlying failure with an unknown cause.
+ DDErrorCodeBadParameter = 350001, /// Bad parameter.
+ DDErrorCodeUnsupported = 350002, /// Unsupported value, operation, etc.
+ DDErrorCodeTimeout = 350003, /// Session or operation timed out.
+ DDErrorCodeInternal = 350004, /// Internal problem.
+ DDErrorCodeMissingEntitlement = 350005, /// Missing entitlement.
+ DDErrorCodePermission = 350006, /// Lacks permission to perform the operation.
+
+ // Next error code to be allocated
+ DDErrorCodeNext,
+
+} API_AVAILABLE( ios( 16.0 ) );
+
+/// Type for returning NSError's from functions. Avoids long and repetitious method signatures.
+API_AVAILABLE( ios( 16.0 ) )
+typedef NSError * _Nullable __autoreleasing * _Nullable DDErrorOutType;
+
+/// Invoked when a fail-able operation completes or an error occurs.
+/// @param inError nil if successful. non-nil if an error occurred.
+API_AVAILABLE( ios( 16.0 ) )
+typedef void ( ^DDErrorHandler )( NSError * _Nullable inError );
+
+#ifdef __cplusplus
+}
+#endif
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_16.0.0-beta5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDEvent.h /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDEvent.h
--- /Applications/Xcode_16.0.0-beta5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDEvent.h 1970-01-01 01:00:00
+++ /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDEvent.h 2024-08-07 13:31:37
@@ -0,0 +1,61 @@
+// Copyright (C) 2021-2022 Apple Inc. All Rights Reserved.
+
+#ifndef DEVICE_DISCOVERY_EXTENSION_INDIRECT_INCLUDES
+#error "Please #import <DeviceDiscoveryExtension/DeviceDiscoveryExtension.h> instead of this file directly."
+#endif
+
+#pragma once
+
+#import <DeviceDiscoveryExtension/DDCommon.h>
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+@class DDDevice;
+@class DDDeviceEvent;
+
+//===========================================================================================================================
+/// Type of event.
+typedef NS_ENUM( NSInteger, DDEventType )
+{
+ DDEventTypeUnknown NS_SWIFT_NAME(unknown) = 0, /// Unknown event. Placeholder for initializing event types.
+ DDEventTypeDeviceFound NS_SWIFT_NAME(deviceFound) = 40, /// [DDDeviceEvent] Device found.
+ DDEventTypeDeviceLost NS_SWIFT_NAME(deviceLost) = 41, /// [DDDeviceEvent] Device lost.
+ DDEventTypeDeviceChanged NS_SWIFT_NAME(deviceChanged) = 42, /// [DDDeviceEvent] Device changed.
+} NS_SWIFT_NAME(DDDeviceEvent.EventType);
+
+/// Converts an event to a string for logging, etc.
+DD_EXTERN
+API_AVAILABLE( ios( 16.0 ) )
+NSString * DDEventTypeToString( DDEventType inValue );
+
+/// Invoked when an event occurs.
+typedef void ( ^DDEventHandler )( DDDeviceEvent *inEvent );
+
+//===========================================================================================================================
+
+/// Device-related event (e.g. found, lost).
+DD_EXTERN
+API_AVAILABLE( ios( 16.0 ) )
+@interface DDDeviceEvent : NSObject
+
+/// Initializes a device event.
+- (instancetype) initWithEventType:(DDEventType) type device:(DDDevice *) device;
+
+/// Device found or lost.
+@property (readonly, strong, nonatomic) DDDevice *device;
+
+/// Type of event.
+@property (readonly, assign, nonatomic) DDEventType eventType;
+
+@end
+
+#ifdef __cplusplus
+}
+#endif
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_16.0.0-beta5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDExtension.h /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDExtension.h
--- /Applications/Xcode_16.0.0-beta5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDExtension.h 1970-01-01 01:00:00
+++ /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DDExtension.h 2024-08-07 13:31:36
@@ -0,0 +1,34 @@
+/*
+ Copyright (C) 2021-2022 Apple Inc. All Rights Reserved.
+*/
+
+#ifndef DEVICE_DISCOVERY_EXTENSION_INDIRECT_INCLUDES
+#error "Please #import <DeviceDiscoveryExtension/DeviceDiscoveryExtension.h> instead of this file directly."
+#endif
+
+#pragma once
+
+#import <DeviceDiscoveryExtension/DDCommon.h>
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//---------------------------------------------------------------------------------------------------------------------------
+/// Manages a session between the extension and host.
+DD_EXTERN
+@interface DDDiscoverySession : NSObject
+
+/// Reports an event to the host.
+- (void) reportEvent:(DDDeviceEvent *) inEvent;
+
+@end
+
+#ifdef __cplusplus
+}
+#endif
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_16.0.0-beta5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DeviceDiscoveryExtension.h /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DeviceDiscoveryExtension.h
--- /Applications/Xcode_16.0.0-beta5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DeviceDiscoveryExtension.h 1970-01-01 01:00:00
+++ /Applications/Xcode_16.0.0-beta6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DeviceDiscoveryExtension.framework/Headers/DeviceDiscoveryExtension.h 2024-08-07 13:31:36
@@ -0,0 +1,17 @@
+/*
+ Copyright (C) 2021-2022 Apple Inc. All Rights Reserved.
+*/
+
+#pragma once
+
+#ifndef DEVICE_DISCOVERY_EXTENSION_INDIRECT_INCLUDES
+#define DEVICE_DISCOVERY_EXTENSION_INDIRECT_INCLUDES
+#endif
+
+#import <DeviceDiscoveryExtension/DDCommon.h>
+#import <DeviceDiscoveryExtension/DDDevice.h>
+#import <DeviceDiscoveryExtension/DDErrors.h>
+#import <DeviceDiscoveryExtension/DDEvent.h>
+#import <DeviceDiscoveryExtension/DDExtension.h>
+
+#undef DEVICE_DISCOVERY_EXTENSION_INDIRECT_INCLUDES