diff --git a/src/Chip/ChipCompat.cs b/src/Chip/ChipCompat.cs index 5f41e9aad2..1ece686890 100644 --- a/src/Chip/ChipCompat.cs +++ b/src/Chip/ChipCompat.cs @@ -8,6 +8,7 @@ // using System; +using System.ComponentModel; using System.Threading.Tasks; using Foundation; using CoreFoundation; @@ -138,5 +139,353 @@ namespace Chip { #endif } + + [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] + public delegate void ChipDeviceConnectionCallback (ChipDevice device, NSError error); + + [Register("CHIPDeviceController", true)] + public partial class ChipDeviceController : NSObject { + public override IntPtr ClassHandle { get { throw new InvalidOperationException (Constants.RemovedFromChip); } } + + protected ChipDeviceController (NSObjectFlag t) : base (t) => throw new InvalidOperationException (Constants.RemovedFromChip); + + protected internal ChipDeviceController (IntPtr handle) : base (handle) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual bool GetConnectedDevice (ulong deviceID, global::CoreFoundation.DispatchQueue queue,ChipDeviceConnectionCallback completionHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task GetConnectedDeviceAsync (ulong deviceID, global::CoreFoundation.DispatchQueue queue) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task GetConnectedDeviceAsync (ulong deviceID, global::CoreFoundation.DispatchQueue queue, out bool result) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual ChipDevice? GetPairedDevice (ulong deviceId, out NSError? error) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual bool IsDevicePaired (ulong deviceID, out NSError? error) => throw new InvalidOperationException (Constants.RemovedFromChip); + +#if !NET && !__MACOS__ + [Obsolete ("This method is removed.", false)] + public virtual bool PairDevice (ulong deviceId, ushort discriminator, uint setupPinCode, out NSError? error) => throw new InvalidOperationException (Constants.RemovedFromChip); +#endif + +#if !__MACOS__ + public virtual bool PairDevice (ulong deviceID, ushort discriminator, uint setupPINCode, NSData? csrNonce, out NSError? error) => throw new InvalidOperationException (Constants.RemovedFromChip); +#endif + + public virtual bool PairDevice (ulong deviceId, string address, ushort port, ushort discriminator, uint setupPinCode, out NSError? error) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual bool PairDevice (ulong deviceId, string onboardingPayload, ChipOnboardingPayloadType onboardingPayloadType, out NSError? error) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual bool PairDeviceWithoutSecurity (ulong deviceId, string address, ushort port, out NSError? error) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void SetListenPort (ushort port) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void SetPairingDelegate (IChipDevicePairingDelegate @delegate, global::CoreFoundation.DispatchQueue queue) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual bool Shutdown () => throw new InvalidOperationException (Constants.RemovedFromChip); + + [Obsolete ("This method is removed.", false)] + public virtual bool Startup (IChipPersistentStorageDelegate? storageDelegate) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual bool Startup (IChipPersistentStorageDelegate? storageDelegate, ushort vendorId, IChipKeypair? nocSigner) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual bool StopDevicePairing (ulong deviceId, out NSError? error) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual bool UnpairDevice (ulong deviceId, out NSError? error) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void UpdateDevice (ulong deviceId, ulong fabricId) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual NSNumber ControllerNodeId => throw new InvalidOperationException (Constants.RemovedFromChip); + public virtual bool IsRunning => throw new InvalidOperationException (Constants.RemovedFromChip); + public static ChipDeviceController SharedController => throw new InvalidOperationException (Constants.RemovedFromChip); + } + + [Register("CHIPLowPower", true)] + public partial class ChipLowPower : ChipCluster { + public override IntPtr ClassHandle { get { throw new InvalidOperationException (Constants.RemovedFromChip); } } + + protected ChipLowPower (NSObjectFlag t) : base (t) => throw new InvalidOperationException (Constants.RemovedFromChip); + + protected internal ChipLowPower (IntPtr handle) : base (handle) => throw new InvalidOperationException (Constants.RemovedFromChip); + + [DesignatedInitializer] + public ChipLowPower (ChipDevice device, ushort endpoint, global::CoreFoundation.DispatchQueue queue) + : base (NSObjectFlag.Empty) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public ChipLowPower (ChipDevice device, byte endpoint, global::CoreFoundation.DispatchQueue queue) + : this (device, (ushort) endpoint, queue) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeClusterRevision (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeClusterRevisionAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void Sleep (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + public virtual Task SleepAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + } + + [Register("CHIPTestCluster", true)] + public partial class ChipTestCluster : ChipCluster { + public override IntPtr ClassHandle { get { throw new InvalidOperationException (Constants.RemovedFromChip); } } + + protected ChipTestCluster (NSObjectFlag t) : base (t) => throw new InvalidOperationException (Constants.RemovedFromChip); + + protected internal ChipTestCluster (IntPtr handle) : base (handle) => throw new InvalidOperationException (Constants.RemovedFromChip); + + [DesignatedInitializer] + public ChipTestCluster (ChipDevice device, ushort endpoint, global::CoreFoundation.DispatchQueue queue) + : base (NSObjectFlag.Empty) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public ChipTestCluster (ChipDevice device, byte endpoint, global::CoreFoundation.DispatchQueue queue) + : this (device, (ushort) endpoint, queue) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeBitmap16 (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeBitmap16Async () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeBitmap32 (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeBitmap32Async () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeBitmap64 (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeBitmap64Async () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeBitmap8 (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeBitmap8Async () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeBoolean (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeBooleanAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeCharString (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeCharStringAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeClusterRevision (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeClusterRevisionAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeEnum16 (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeEnum16Async () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeEnum8 (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeEnum8Async () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeInt16s (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeInt16sAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeInt16u (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeInt16uAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeInt32s (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeInt32sAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeInt32u (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeInt32uAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeInt64s (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeInt64sAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeInt64u (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeInt64uAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeInt8s (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeInt8sAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeInt8u (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeInt8uAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeListInt8u (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeListInt8uAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeListOctetString (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeListOctetStringAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeListStructOctetString (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeListStructOctetStringAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeLongCharString (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeLongCharStringAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeLongOctetString (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeLongOctetStringAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeOctetString (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeOctetStringAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeUnsupported (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeUnsupportedAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void Test (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task TestAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void TestAddArguments (byte arg1, byte arg2, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task TestAddArgumentsAsync (byte arg1, byte arg2) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void TestNotHandled (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task TestNotHandledAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void TestSpecific (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task TestSpecificAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void TestUnknownCommand (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task TestUnknownCommandAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeBitmap16 (ushort value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeBitmap16Async (ushort value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeBitmap32 (uint value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeBitmap32Async (uint value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeBitmap64 (ulong value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeBitmap64Async (ulong value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeBitmap8 (byte value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeBitmap8Async (byte value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeBoolean (byte value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeBooleanAsync (byte value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeBoolean (bool boolValue, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeBooleanAsync (bool boolValue) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeCharString (string value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeCharStringAsync (string value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeEnum16 (ushort value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeEnum16Async (ushort value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeEnum8 (byte value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeEnum8Async (byte value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeInt16s (short value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeInt16sAsync (short value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeInt16u (ushort value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeInt16uAsync (ushort value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeInt32s (int value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeInt32sAsync (int value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeInt32u (uint value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeInt32uAsync (uint value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeInt64s (long value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeInt64sAsync (long value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeInt64u (ulong value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeInt64uAsync (ulong value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeInt8s (sbyte value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeInt8sAsync (sbyte value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeInt8u (byte value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeInt8uAsync (byte value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeLongCharString (string value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeLongCharStringAsync (string value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeLongOctetString (NSData value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeLongOctetStringAsync (NSData value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeOctetString (NSData value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeOctetStringAsync (NSData value) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeUnsupported (bool boolValue, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeUnsupportedAsync (bool boolValue) => throw new InvalidOperationException (Constants.RemovedFromChip); + } + + [Register("CHIPGeneralCommissioning", true)] + public partial class ChipGeneralCommissioning : ChipCluster { + public override IntPtr ClassHandle { get { throw new InvalidOperationException (Constants.RemovedFromChip); } } + + protected ChipGeneralCommissioning (NSObjectFlag t) : base (t) => throw new InvalidOperationException (Constants.RemovedFromChip); + + protected internal ChipGeneralCommissioning (IntPtr handle) : base (handle) => throw new InvalidOperationException (Constants.RemovedFromChip); + + [DesignatedInitializer] + public ChipGeneralCommissioning (ChipDevice device, ushort endpoint, global::CoreFoundation.DispatchQueue queue) + : base (NSObjectFlag.Empty) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public ChipGeneralCommissioning (ChipDevice device, byte endpoint, global::CoreFoundation.DispatchQueue queue) + : this (device, (ushort) endpoint, queue) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ArmFailSafe (ushort expiryLengthSeconds, ulong breadcrumb, uint timeoutMs, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ArmFailSafeAsync (ushort expiryLengthSeconds, ulong breadcrumb, uint timeoutMs) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void CommissioningComplete (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task CommissioningCompleteAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeBasicCommissioningInfoList (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeBasicCommissioningInfoListAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeBreadcrumb (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeBreadcrumbAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void ReadAttributeClusterRevision (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task ReadAttributeClusterRevisionAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + [Obsolete ("This method is removed.", false)] + public virtual void ReadAttributeFabricId (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + [Obsolete ("This method is removed.", false)] + public virtual Task ReadAttributeFabricIdAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void SetRegulatoryConfig (byte location, string countryCode, ulong breadcrumb, uint timeoutMs, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task SetRegulatoryConfigAsync (byte location, string countryCode, ulong breadcrumb, uint timeoutMs) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual void WriteAttributeBreadcrumb (ulong value, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); + + public virtual Task WriteAttributeBreadcrumbAsync (ulong value) + => throw new InvalidOperationException (Constants.RemovedFromChip); + } } #endif // !NET diff --git a/src/HomeKit/HMCompat.cs b/src/HomeKit/HMCompat.cs index 6b6872336b..fc62ee20ca 100644 --- a/src/HomeKit/HMCompat.cs +++ b/src/HomeKit/HMCompat.cs @@ -11,11 +11,15 @@ using System; using System.Threading.Tasks; using Foundation; using CoreFoundation; +using ObjCRuntime; #if !NET +using NativeHandle = System.IntPtr; +#endif + #nullable enable namespace HomeKit { - +#if !NET [Obsolete ("Use 'HMFetchRoomHandler' instead.")] public delegate void FetchRoomHandler (NSArray rooms, NSError error); @@ -26,19 +30,19 @@ namespace HomeKit { [Register ("HMCHIPServiceRequestHandler", SkipRegistration = true)] public class HMChipServiceRequestHandler : NSObject, INSExtensionRequestHandling { - public override IntPtr ClassHandle => throw new InvalidOperationException (); + public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit); - public HMChipServiceRequestHandler () => throw new InvalidOperationException (); - protected HMChipServiceRequestHandler (NSObjectFlag t) => throw new InvalidOperationException (); - protected HMChipServiceRequestHandler (IntPtr handle) => throw new InvalidOperationException (); + public HMChipServiceRequestHandler () => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + protected HMChipServiceRequestHandler (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + protected HMChipServiceRequestHandler (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); - public virtual void BeginRequestWithExtensionContext (NSExtensionContext context) => throw new InvalidOperationException (); - public virtual void ConfigureAccessory (string accessoryName, HMChipServiceRoom accessoryRoom, Action completion) => throw new InvalidOperationException (); - public virtual Task ConfigureAccessoryAsync (string accessoryName, HMChipServiceRoom accessoryRoom) => throw new InvalidOperationException (); - public virtual void FetchRooms (HMChipServiceHome home, FetchRoomHandler completion) => throw new InvalidOperationException (); - public virtual Task> FetchRoomsAsync (HMChipServiceHome home) => throw new InvalidOperationException (); - public virtual void PairAccessory (HMChipServiceHome home, string onboardingPayload, Action completion) => throw new InvalidOperationException (); - public virtual Task PairAccessoryAsync (HMChipServiceHome home, string onboardingPayload) => throw new InvalidOperationException (); + public virtual void BeginRequestWithExtensionContext (NSExtensionContext context) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual void ConfigureAccessory (string accessoryName, HMChipServiceRoom accessoryRoom, Action completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual Task ConfigureAccessoryAsync (string accessoryName, HMChipServiceRoom accessoryRoom) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual void FetchRooms (HMChipServiceHome home, FetchRoomHandler completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual Task> FetchRoomsAsync (HMChipServiceHome home) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual void PairAccessory (HMChipServiceHome home, string onboardingPayload, Action completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual Task PairAccessoryAsync (HMChipServiceHome home, string onboardingPayload) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); } /* class HMChipServiceRequestHandler */ @@ -46,16 +50,16 @@ namespace HomeKit { [Register ("HMCHIPServiceTopology", SkipRegistration = true)] public class HMChipServiceTopology : NSObject, INSCoding, INSCopying, INSSecureCoding { - public override IntPtr ClassHandle => throw new InvalidOperationException (); + public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit); - protected HMChipServiceTopology (IntPtr handle) => throw new InvalidOperationException (); - public HMChipServiceTopology (NSCoder coder) => throw new InvalidOperationException (); - protected HMChipServiceTopology (NSObjectFlag t) => throw new InvalidOperationException (); - public HMChipServiceTopology (HMChipServiceHome[] homes) => throw new InvalidOperationException (); + protected HMChipServiceTopology (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public HMChipServiceTopology (NSCoder coder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + protected HMChipServiceTopology (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public HMChipServiceTopology (HMChipServiceHome[] homes) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); - public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException (); - public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (); - public virtual HMChipServiceHome[] Homes => throw new InvalidOperationException (); + public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual HMChipServiceHome[] Homes => throw new InvalidOperationException (Constants.RemovedFromHomeKit); } /* class HMChipServiceTopology */ @@ -63,17 +67,17 @@ namespace HomeKit { [Register("HMCHIPServiceRoom", SkipRegistration = true)] public class HMChipServiceRoom : NSObject, INSCoding, INSCopying, INSSecureCoding { - public override IntPtr ClassHandle => throw new InvalidOperationException (); + public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit); - protected HMChipServiceRoom (IntPtr handle) => throw new InvalidOperationException (); - public HMChipServiceRoom (NSCoder coder) => throw new InvalidOperationException (); - protected HMChipServiceRoom (NSObjectFlag t) => throw new InvalidOperationException (); - public HMChipServiceRoom (NSUuid uuid, string name) => throw new InvalidOperationException (); + protected HMChipServiceRoom (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public HMChipServiceRoom (NSCoder coder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + protected HMChipServiceRoom (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public HMChipServiceRoom (NSUuid uuid, string name) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); - public virtual NSObject Copy (NSZone? zone)=> throw new InvalidOperationException (); - public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (); - public virtual string Name => throw new InvalidOperationException (); - public virtual NSUuid Uuid => throw new InvalidOperationException (); + public virtual NSObject Copy (NSZone? zone)=> throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual string Name => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual NSUuid Uuid => throw new InvalidOperationException (Constants.RemovedFromHomeKit); } /* class HMChipServiceRoom */ @@ -81,29 +85,44 @@ namespace HomeKit { [Register("HMCHIPServiceHome", SkipRegistration = true)] public partial class HMChipServiceHome : NSObject, INSCoding, INSCopying, INSSecureCoding { - public override IntPtr ClassHandle => throw new InvalidOperationException (); + public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit); - protected HMChipServiceHome (IntPtr handle) => throw new InvalidOperationException (); - public HMChipServiceHome (NSCoder coder) => throw new InvalidOperationException (); - protected HMChipServiceHome (NSObjectFlag t) => throw new InvalidOperationException (); + protected HMChipServiceHome (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public HMChipServiceHome (NSCoder coder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + protected HMChipServiceHome (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); - public HMChipServiceHome (NSUuid uuid, string name) => throw new InvalidOperationException (); - public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException (); + public HMChipServiceHome (NSUuid uuid, string name) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); - public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (); - public virtual string Name => throw new InvalidOperationException (); - public virtual NSUuid Uuid => throw new InvalidOperationException (); + public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual string Name => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual NSUuid Uuid => throw new InvalidOperationException (Constants.RemovedFromHomeKit); } /* class HMChipServiceHome */ public partial class HMAccessorySetupManager { #pragma warning disable CS0618 // HMChipServiceTopology and HMErrorHandler is obsolete - public virtual void AddAndSetUpAccessories (HMChipServiceTopology topology, HMErrorHandler completion) => throw new InvalidOperationException (); - public virtual Task AddAndSetUpAccessoriesAsync (HMChipServiceTopology topology) => throw new InvalidOperationException (); + public virtual void AddAndSetUpAccessories (HMChipServiceTopology topology, HMErrorHandler completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual Task AddAndSetUpAccessoriesAsync (HMChipServiceTopology topology) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); #pragma warning restore CS0618 // HMChipServiceTopology and HMErrorHandler is obsolete - - } /* class HMAccessorySetupManager */ - -} + } #endif // !NET + +#if __IOS__ && !__MACCATALYST__ + public unsafe partial class HMAccessorySetupManager : NSObject { + public override NativeHandle ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + + public HMAccessorySetupManager () : base (NSObjectFlag.Empty) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + protected HMAccessorySetupManager (NSObjectFlag t) : base (t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + protected internal HMAccessorySetupManager (NativeHandle handle) : base (handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + + public virtual void AddAndSetUpAccessories (HMMatterTopology topology, Action completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual Task AddAndSetUpAccessoriesAsync (HMMatterTopology topology) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual void PerformAccessorySetup (HMAccessorySetupRequest request, Action completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual Task PerformAccessorySetupAsync (HMAccessorySetupRequest request) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual void PerformMatterEcosystemAccessorySetup (HMAccessorySetupRequest request, HMMatterTopology topology, Action completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + public virtual Task PerformMatterEcosystemAccessorySetupAsync (HMAccessorySetupRequest request, HMMatterTopology topology) => throw new InvalidOperationException (Constants.RemovedFromHomeKit); + } +#endif +} diff --git a/src/ObjCRuntime/ObsoleteConstants.cs b/src/ObjCRuntime/ObsoleteConstants.cs index 02f5124912..3bb1c4aa45 100644 --- a/src/ObjCRuntime/ObsoleteConstants.cs +++ b/src/ObjCRuntime/ObsoleteConstants.cs @@ -32,6 +32,9 @@ namespace ObjCRuntime { internal const string ChipRemoved = "The CHIP framework has been removed from iOS."; internal const string BrokenBinding = "This API was incorrectly bound and does not work correctly. Use the new version indicated in the associated Obsolete attribute."; + + internal const string RemovedFromHomeKit = "This API has been removed from the 'HomeKit' framework."; + internal const string ApiRemovedGeneral = "This API has been removed from the framework."; } } diff --git a/src/chip.cs b/src/chip.cs index 4996309802..540b5b0b82 100644 --- a/src/chip.cs +++ b/src/chip.cs @@ -1096,67 +1096,6 @@ namespace Chip { void ReadAttributeClusterRevision (ChipResponseHandler responseHandler); } - [Obsoleted (PlatformName.iOS, 16,0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.TvOS, 16, 0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.MacCatalyst, 16, 0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.MacOSX, 13, 0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.WatchOS, 9, 0, message: Constants.ChipRemoved)] - [Mac (12,0), Watch (8,0), TV (15,0), iOS (15,0), MacCatalyst (15,0)] - [BaseType (typeof (ChipCluster), Name="CHIPGeneralCommissioning")] - [DisableDefaultCtor] - interface ChipGeneralCommissioning - { - [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - [Export ("initWithDevice:endpoint:queue:")] - [DesignatedInitializer] - NativeHandle Constructor (ChipDevice device, ushort endpoint, DispatchQueue queue); - -#if !NET - [Deprecated (PlatformName.iOS, 15, 2)] - [Deprecated (PlatformName.TvOS, 15, 2)] - [Deprecated (PlatformName.WatchOS, 8, 3)] - [Deprecated (PlatformName.MacOSX, 12, 1)] - [Deprecated (PlatformName.MacCatalyst, 15, 2)] - [Wrap ("this (device, (ushort) endpoint, queue)")] - NativeHandle Constructor (ChipDevice device, byte endpoint, DispatchQueue queue); -#endif - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("armFailSafe:breadcrumb:timeoutMs:responseHandler:")] - void ArmFailSafe (ushort expiryLengthSeconds, ulong breadcrumb, uint timeoutMs, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("commissioningComplete:")] - void CommissioningComplete (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("setRegulatoryConfig:countryCode:breadcrumb:timeoutMs:responseHandler:")] - void SetRegulatoryConfig (byte location, string countryCode, ulong breadcrumb, uint timeoutMs, ChipResponseHandler responseHandler); - -#if !NET - [Obsolete ("This method is removed.")] - [Wrap ("throw new InvalidOperationException (Constants.RemovedFromChip)", IsVirtual = true)] - [Async (ResultTypeName = "ChipReadAttributeResult")] - void ReadAttributeFabricId (ChipResponseHandler responseHandler); -#endif - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeBreadcrumbWithResponseHandler:")] - void ReadAttributeBreadcrumb (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeBreadcrumbWithValue:responseHandler:")] - void WriteAttributeBreadcrumb (ulong value, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeBasicCommissioningInfoListWithResponseHandler:")] - void ReadAttributeBasicCommissioningInfoList (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeClusterRevisionWithResponseHandler:")] - void ReadAttributeClusterRevision (ChipResponseHandler responseHandler); - } - [Obsoleted (PlatformName.iOS, 16,0, message: Constants.ChipRemoved)] [Obsoleted (PlatformName.TvOS, 16, 0, message: Constants.ChipRemoved)] [Obsoleted (PlatformName.MacCatalyst, 16, 0, message: Constants.ChipRemoved)] @@ -1373,40 +1312,6 @@ namespace Chip { void ReadAttributeClusterRevision (ChipResponseHandler responseHandler); } - [Obsoleted (PlatformName.iOS, 16,0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.TvOS, 16, 0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.MacCatalyst, 16, 0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.MacOSX, 13, 0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.WatchOS, 9, 0, message: Constants.ChipRemoved)] - [Mac (12,0), Watch (8,0), TV (15,0), iOS (15,0), MacCatalyst (15,0)] - [BaseType (typeof (ChipCluster), Name="CHIPLowPower")] - [DisableDefaultCtor] - interface ChipLowPower - { - [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - [Export ("initWithDevice:endpoint:queue:")] - [DesignatedInitializer] - NativeHandle Constructor (ChipDevice device, ushort endpoint, DispatchQueue queue); - -#if !NET - [Deprecated (PlatformName.iOS, 15, 2)] - [Deprecated (PlatformName.TvOS, 15, 2)] - [Deprecated (PlatformName.WatchOS, 8, 3)] - [Deprecated (PlatformName.MacOSX, 12, 1)] - [Deprecated (PlatformName.MacCatalyst, 15, 2)] - [Wrap ("this (device, (ushort) endpoint, queue)")] - NativeHandle Constructor (ChipDevice device, byte endpoint, DispatchQueue queue); -#endif - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("sleep:")] - void Sleep (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeClusterRevisionWithResponseHandler:")] - void ReadAttributeClusterRevision (ChipResponseHandler responseHandler); - } - [Obsoleted (PlatformName.iOS, 16,0, message: Constants.ChipRemoved)] [Obsoleted (PlatformName.TvOS, 16, 0, message: Constants.ChipRemoved)] [Obsoleted (PlatformName.MacCatalyst, 16, 0, message: Constants.ChipRemoved)] @@ -2090,249 +1995,6 @@ namespace Chip { void ReadAttributeClusterRevision (ChipResponseHandler responseHandler); } - [Obsoleted (PlatformName.iOS, 16,0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.TvOS, 16, 0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.MacCatalyst, 16, 0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.MacOSX, 13, 0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.WatchOS, 9, 0, message: Constants.ChipRemoved)] - [Mac (12,0), Watch (8,0), TV (15,0), iOS (15,0), MacCatalyst (15,0)] - [BaseType (typeof (ChipCluster), Name="CHIPTestCluster")] - [DisableDefaultCtor] - interface ChipTestCluster - { - [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - [Export ("initWithDevice:endpoint:queue:")] - [DesignatedInitializer] - NativeHandle Constructor (ChipDevice device, ushort endpoint, DispatchQueue queue); - -#if !NET - [Deprecated (PlatformName.iOS, 15, 2)] - [Deprecated (PlatformName.TvOS, 15, 2)] - [Deprecated (PlatformName.WatchOS, 8, 3)] - [Deprecated (PlatformName.MacOSX, 12, 1)] - [Deprecated (PlatformName.MacCatalyst, 15, 2)] - [Wrap ("this (device, (ushort) endpoint, queue)")] - NativeHandle Constructor (ChipDevice device, byte endpoint, DispatchQueue queue); -#endif - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("test:")] - void Test (ChipResponseHandler responseHandler); - - [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("testAddArguments:arg2:responseHandler:")] - void TestAddArguments (byte arg1, byte arg2, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("testNotHandled:")] - void TestNotHandled (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("testSpecific:")] - void TestSpecific (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("testUnknownCommand:")] - void TestUnknownCommand (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeBooleanWithResponseHandler:")] - void ReadAttributeBoolean (ChipResponseHandler responseHandler); - -#if !NET - [Deprecated (PlatformName.iOS, 15, 2)] - [Deprecated (PlatformName.TvOS, 15, 2)] - [Deprecated (PlatformName.WatchOS, 8, 3)] - [Deprecated (PlatformName.MacOSX, 12, 1)] - [Deprecated (PlatformName.MacCatalyst, 15, 2)] - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Wrap ("WriteAttributeBoolean (Convert.ToBoolean(value), responseHandler)", IsVirtual = true)] - void WriteAttributeBoolean (byte value, ChipResponseHandler responseHandler); -#endif - - [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeBooleanWithValue:responseHandler:")] - void WriteAttributeBoolean (bool boolValue, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeBitmap8WithResponseHandler:")] - void ReadAttributeBitmap8 (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeBitmap8WithValue:responseHandler:")] - void WriteAttributeBitmap8 (byte value, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeBitmap16WithResponseHandler:")] - void ReadAttributeBitmap16 (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeBitmap16WithValue:responseHandler:")] - void WriteAttributeBitmap16 (ushort value, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeBitmap32WithResponseHandler:")] - void ReadAttributeBitmap32 (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeBitmap32WithValue:responseHandler:")] - void WriteAttributeBitmap32 (uint value, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeBitmap64WithResponseHandler:")] - void ReadAttributeBitmap64 (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeBitmap64WithValue:responseHandler:")] - void WriteAttributeBitmap64 (ulong value, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeInt8uWithResponseHandler:")] - void ReadAttributeInt8u (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeInt8uWithValue:responseHandler:")] - void WriteAttributeInt8u (byte value, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeInt16uWithResponseHandler:")] - void ReadAttributeInt16u (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeInt16uWithValue:responseHandler:")] - void WriteAttributeInt16u (ushort value, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeInt32uWithResponseHandler:")] - void ReadAttributeInt32u (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeInt32uWithValue:responseHandler:")] - void WriteAttributeInt32u (uint value, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeInt64uWithResponseHandler:")] - void ReadAttributeInt64u (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeInt64uWithValue:responseHandler:")] - void WriteAttributeInt64u (ulong value, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeInt8sWithResponseHandler:")] - void ReadAttributeInt8s (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeInt8sWithValue:responseHandler:")] - void WriteAttributeInt8s (sbyte value, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeInt16sWithResponseHandler:")] - void ReadAttributeInt16s (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeInt16sWithValue:responseHandler:")] - void WriteAttributeInt16s (short value, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeInt32sWithResponseHandler:")] - void ReadAttributeInt32s (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeInt32sWithValue:responseHandler:")] - void WriteAttributeInt32s (int value, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeInt64sWithResponseHandler:")] - void ReadAttributeInt64s (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeInt64sWithValue:responseHandler:")] - void WriteAttributeInt64s (long value, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeEnum8WithResponseHandler:")] - void ReadAttributeEnum8 (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeEnum8WithValue:responseHandler:")] - void WriteAttributeEnum8 (byte value, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeEnum16WithResponseHandler:")] - void ReadAttributeEnum16 (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeEnum16WithValue:responseHandler:")] - void WriteAttributeEnum16 (ushort value, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeOctetStringWithResponseHandler:")] - void ReadAttributeOctetString (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeOctetStringWithValue:responseHandler:")] - void WriteAttributeOctetString (NSData value, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeListInt8uWithResponseHandler:")] - void ReadAttributeListInt8u (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeListOctetStringWithResponseHandler:")] - void ReadAttributeListOctetString (ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeListStructOctetStringWithResponseHandler:")] - void ReadAttributeListStructOctetString (ChipResponseHandler responseHandler); - - [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeLongOctetStringWithResponseHandler:")] - void ReadAttributeLongOctetString (ChipResponseHandler responseHandler); - - [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeLongOctetStringWithValue:responseHandler:")] - void WriteAttributeLongOctetString (NSData value, ChipResponseHandler responseHandler); - - [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeCharStringWithResponseHandler:")] - void ReadAttributeCharString (ChipResponseHandler responseHandler); - - [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeCharStringWithValue:responseHandler:")] - void WriteAttributeCharString (string value, ChipResponseHandler responseHandler); - - [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeLongCharStringWithResponseHandler:")] - void ReadAttributeLongCharString (ChipResponseHandler responseHandler); - - [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeLongCharStringWithValue:responseHandler:")] - void WriteAttributeLongCharString(string value, ChipResponseHandler responseHandler); - - [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeUnsupportedWithResponseHandler:")] - void ReadAttributeUnsupported (ChipResponseHandler responseHandler); - - [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("writeAttributeUnsupportedWithValue:responseHandler:")] - void WriteAttributeUnsupported (bool boolValue, ChipResponseHandler responseHandler); - - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("readAttributeClusterRevisionWithResponseHandler:")] - void ReadAttributeClusterRevision (ChipResponseHandler responseHandler); - } - [Obsoleted (PlatformName.iOS, 16,0, message: Constants.ChipRemoved)] [Obsoleted (PlatformName.TvOS, 16, 0, message: Constants.ChipRemoved)] [Obsoleted (PlatformName.MacCatalyst, 16, 0, message: Constants.ChipRemoved)] @@ -2552,96 +2214,6 @@ namespace Chip { void OnAddressUpdated ([NullAllowed] NSError error); } - [Obsoleted (PlatformName.iOS, 16,0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.TvOS, 16, 0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.MacCatalyst, 16, 0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.MacOSX, 13, 0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.WatchOS, 9, 0, message: Constants.ChipRemoved)] - [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - delegate void ChipDeviceConnectionCallback ([NullAllowed] ChipDevice device, [NullAllowed] NSError error); - - [Obsoleted (PlatformName.iOS, 16,0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.TvOS, 16, 0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.MacCatalyst, 16, 0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.MacOSX, 13, 0, message: Constants.ChipRemoved)] - [Obsoleted (PlatformName.WatchOS, 9, 0, message: Constants.ChipRemoved)] - [Mac (12,0), Watch (8,0), TV (15,0), iOS (15,0), MacCatalyst (15,0)] - [BaseType (typeof (NSObject), Name="CHIPDeviceController")] - [DisableDefaultCtor] - interface ChipDeviceController - { - [Export ("isRunning")] - bool IsRunning { get; } - -#if !NET - [Obsolete ("This method is removed.")] - [Wrap ("true ? throw new InvalidOperationException (Constants.RemovedFromChip) : false", IsVirtual = true)] - [NoMac] // fails on macOS 12 beta 6 - bool PairDevice (ulong deviceId, ushort discriminator, uint setupPinCode, [NullAllowed] out NSError error); -#endif - - [NoMac, Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - [Export ("pairDevice:discriminator:setupPINCode:csrNonce:error:")] - bool PairDevice (ulong deviceID, ushort discriminator, uint setupPINCode, [NullAllowed] NSData csrNonce, [NullAllowed] out NSError error); - - [Export ("pairDevice:address:port:discriminator:setupPINCode:error:")] - bool PairDevice (ulong deviceId, string address, ushort port, ushort discriminator, uint setupPinCode, [NullAllowed] out NSError error); - - [Export ("pairDeviceWithoutSecurity:address:port:error:")] - bool PairDeviceWithoutSecurity (ulong deviceId, string address, ushort port, [NullAllowed] out NSError error); - - [Export ("pairDevice:onboardingPayload:onboardingPayloadType:error:")] - bool PairDevice (ulong deviceId, string onboardingPayload, ChipOnboardingPayloadType onboardingPayloadType, [NullAllowed] out NSError error); - - [Export ("setListenPort:")] - void SetListenPort (ushort port); - - [Export ("unpairDevice:error:")] - bool UnpairDevice (ulong deviceId, [NullAllowed] out NSError error); - - [Export ("stopDevicePairing:error:")] - bool StopDevicePairing (ulong deviceId, [NullAllowed] out NSError error); - - [Export ("updateDevice:fabricId:")] - void UpdateDevice (ulong deviceId, ulong fabricId); - - [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - [Export ("isDevicePaired:error:")] - bool IsDevicePaired (ulong deviceID, [NullAllowed] out NSError error); - - [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - [Async (ResultTypeName = "ChipReadAttributeResult")] - [Export ("getConnectedDevice:queue:completionHandler:")] - bool GetConnectedDevice (ulong deviceID, DispatchQueue queue, ChipDeviceConnectionCallback completionHandler); - - [Export ("getPairedDevice:error:")] - [return: NullAllowed] - ChipDevice GetPairedDevice (ulong deviceId, [NullAllowed] out NSError error); - - [Static] - [Export ("sharedController")] - ChipDeviceController SharedController { get; } - - [Export ("getControllerNodeId")] - NSNumber ControllerNodeId { get; } - - [Export ("setPairingDelegate:queue:")] - void SetPairingDelegate (IChipDevicePairingDelegate @delegate, DispatchQueue queue); - -#if !NET - [Obsolete ("This method is removed.")] - [Wrap ("true ? throw new InvalidOperationException (Constants.RemovedFromChip) : false", IsVirtual = true)] - bool Startup ([NullAllowed] IChipPersistentStorageDelegate storageDelegate); -#endif - - [Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] - [Export ("startup:vendorId:nocSigner:")] - bool Startup ([NullAllowed] IChipPersistentStorageDelegate storageDelegate, ushort vendorId, [NullAllowed] IChipKeypair nocSigner); - - [Export ("shutdown")] - bool Shutdown (); - } - interface IChipKeypair {} [Obsoleted (PlatformName.iOS, 16,0, message: Constants.ChipRemoved)] diff --git a/src/homekit.cs b/src/homekit.cs index fbdc39eb2a..464270a5a1 100644 --- a/src/homekit.cs +++ b/src/homekit.cs @@ -1921,37 +1921,20 @@ namespace HomeKit { } - [iOS (15,2), NoWatch, NoTV, NoMacCatalyst] - [BaseType (typeof (NSObject))] - interface HMAccessorySetupManager - { - [Async] - [iOS (15,4)] - [Export ("performAccessorySetupUsingRequest:completionHandler:")] - void PerformAccessorySetup (HMAccessorySetupRequest request, Action completion); - - [Async] - [iOS (15,4)] - [Export ("performMatterEcosystemAccessorySetupUsingRequest:topology:completionHandler:")] - void PerformMatterEcosystemAccessorySetup (HMAccessorySetupRequest request, HMMatterTopology topology, Action completion); - - [Deprecated (PlatformName.iOS, 15, 4, message: "Use 'PerformAccessorySetup' instead.")] - [Async] - [Export ("addAndSetUpAccessoriesForTopology:completionHandler:")] - void AddAndSetUpAccessories (HMMatterTopology topology, Action completion); - } - [iOS (15,2), Watch (8,3), TV (15,2), MacCatalyst (15,2)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] interface HMMatterHome : NSCopying, NSSecureCoding { + [Wrap ("true ? throw new InvalidOperationException (Constants.RemovedFromHomeKit) : false", IsVirtual = true)] [Export ("uuid", ArgumentSemantic.Strong)] NSUuid Uuid { get; } + [Wrap ("true ? throw new InvalidOperationException (Constants.RemovedFromHomeKit) : false", IsVirtual = true)] [Export ("name", ArgumentSemantic.Strong)] string Name { get; } + [Wrap ("true ? throw new InvalidOperationException (Constants.RemovedFromHomeKit) : false", IsVirtual = true)] [Export ("initWithUUID:name:")] [DesignatedInitializer] NativeHandle Constructor (NSUuid uuid, string name); @@ -1981,12 +1964,15 @@ namespace HomeKit { [DisableDefaultCtor] interface HMMatterRoom : NSCopying, NSSecureCoding { + [Wrap ("true ? throw new InvalidOperationException (Constants.RemovedFromHomeKit) : false", IsVirtual = true)] [Export ("uuid", ArgumentSemantic.Strong)] NSUuid Uuid { get; } + [Wrap ("true ? throw new InvalidOperationException (Constants.RemovedFromHomeKit) : false", IsVirtual = true)] [Export ("name", ArgumentSemantic.Strong)] string Name { get; } + [Wrap ("true ? throw new InvalidOperationException (Constants.RemovedFromHomeKit) : false", IsVirtual = true)] [Export ("initWithUUID:name:")] [DesignatedInitializer] NativeHandle Constructor (NSUuid uuid, string name); @@ -1997,9 +1983,11 @@ namespace HomeKit { [DisableDefaultCtor] interface HMMatterTopology : NSCopying, NSSecureCoding { + [Wrap ("true ? throw new InvalidOperationException (Constants.RemovedFromHomeKit) : false", IsVirtual = true)] [Export ("initWithHomes:")] NativeHandle Constructor (HMMatterHome [] homes); + [Wrap ("true ? throw new InvalidOperationException (Constants.RemovedFromHomeKit) : false", IsVirtual = true)] [Export ("homes", ArgumentSemantic.Copy)] HMMatterHome [] Homes { get; } } diff --git a/src/uikit.cs b/src/uikit.cs index 5fa35c04ab..afb40b0f7f 100644 --- a/src/uikit.cs +++ b/src/uikit.cs @@ -19469,6 +19469,8 @@ namespace UIKit { [Export ("simulateFocusUpdateRequestFromEnvironment:")] IUIFocusDebuggerOutput SimulateFocusUpdateRequest (IUIFocusEnvironment environment); + // Removed from headers in Xcode 14 + [Wrap ("true ? throw new InvalidOperationException (Constants.ApiRemovedGeneral) : false", IsVirtual = true)] [TV (15,0), NoWatch, iOS (15,0), MacCatalyst (15,0)] [Static] [Export ("checkFocusGroupTreeForEnvironment:")] diff --git a/tests/introspection/iOS/iOSApiCtorInitTest.cs b/tests/introspection/iOS/iOSApiCtorInitTest.cs index 6b2dba0f4f..d8a72d27ea 100644 --- a/tests/introspection/iOS/iOSApiCtorInitTest.cs +++ b/tests/introspection/iOS/iOSApiCtorInitTest.cs @@ -251,6 +251,9 @@ namespace Introspection { return true; break; #endif + case "HMAccessorySetupManager": + // Selector fails submission test in Xcode 14.0 timeframe + return true; } return base.Skip (type); } diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-HomeKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/iOS-HomeKit.ignore new file mode 100644 index 0000000000..658616c9dd --- /dev/null +++ b/tests/xtro-sharpie/api-annotations-dotnet/iOS-HomeKit.ignore @@ -0,0 +1,5 @@ +# These performMatterEcosystemAccessorySetupUsingRequest:topology:completionHandler: now fails submission tests +# And the type was stubbed away as it was not usable +!missing-selector! HMAccessorySetupManager::performAccessorySetupUsingRequest:completionHandler: not bound +!missing-selector! HMAccessorySetupManager::performMatterEcosystemAccessorySetupUsingRequest:topology:completionHandler: not bound +!missing-type! HMAccessorySetupManager not bound \ No newline at end of file diff --git a/tests/xtro-sharpie/iOS-HomeKit.ignore b/tests/xtro-sharpie/iOS-HomeKit.ignore index 5c2849efd5..e3fbd323b6 100644 --- a/tests/xtro-sharpie/iOS-HomeKit.ignore +++ b/tests/xtro-sharpie/iOS-HomeKit.ignore @@ -1,2 +1,8 @@ # This is deprecated in Xcode 13.3 and its companion member is deprecated on 15.4 !deprecated-attribute-wrong! HMHome::addAndSetupAccessoriesWithPayload:completionHandler: has 15.4 not 15.0 on [Deprecated] attribute + +# These performMatterEcosystemAccessorySetupUsingRequest:topology:completionHandler: now fails submission tests +# And the type was stubbed away as it was not usable +!missing-selector! HMAccessorySetupManager::performAccessorySetupUsingRequest:completionHandler: not bound +!missing-selector! HMAccessorySetupManager::performMatterEcosystemAccessorySetupUsingRequest:topology:completionHandler: not bound +!missing-type! HMAccessorySetupManager not bound \ No newline at end of file diff --git a/tests/xtro-sharpie/macOS-CHIP.ignore b/tests/xtro-sharpie/macOS-CHIP.ignore index d7e49b89e0..61fe527eed 100644 --- a/tests/xtro-sharpie/macOS-CHIP.ignore +++ b/tests/xtro-sharpie/macOS-CHIP.ignore @@ -644,11 +644,16 @@ !missing-selector! CHIPDescriptorClusterDeviceType::setRevision: not bound !missing-selector! CHIPDescriptorClusterDeviceType::setType: not bound !missing-selector! CHIPDescriptorClusterDeviceType::type not bound +!missing-selector! CHIPDeviceController::getConnectedDevice:queue:completionHandler: not bound !missing-selector! CHIPDeviceController::getDeviceBeingCommissioned:error: not bound +!missing-selector! CHIPDeviceController::isRunning not bound !missing-selector! CHIPDeviceController::openPairingWindow:duration:error: not bound !missing-selector! CHIPDeviceController::openPairingWindowWithPIN:duration:discriminator:setupPIN:error: not bound !missing-selector! CHIPDeviceController::pairDevice:discriminator:setupPINCode:error: not bound !missing-selector! CHIPDeviceController::pairDevice:onboardingPayload:error: not bound +!missing-selector! CHIPDeviceController::setPairingDelegate:queue: not bound +!missing-selector! CHIPDeviceController::shutdown not bound +!missing-selector! CHIPDeviceController::stopDevicePairing:error: not bound !missing-selector! CHIPDiagnosticLogs::readAttributeAttributeListWithCompletionHandler: not bound !missing-selector! CHIPDiagnosticLogs::retrieveLogsRequestWithParams:completionHandler: not bound !missing-selector! CHIPDiagnosticLogsClusterRetrieveLogsRequestParams::init not bound