-
Notifications
You must be signed in to change notification settings - Fork 514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CHIP] Updates for Xcode13.2 beta 1 #13884
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b016e73
[CHIP] Updates for Xcode13.2 beta 1
rachelkang a11fc96
Update based on feedback
rachelkang 48d4cea
Merge branch 'main' into xcode13.2-chip-b1
rachelkang f42c90b
Update based on feedback and intro test failure
rachelkang 61c4eab
Update xtro .todo files
rachelkang 1fb2d43
Fix some breaking API changes
rachelkang 893a031
Merge branch 'main' into xcode13.2-chip-b1
rachelkang d11a0de
Merge branch 'main' into xcode13.2-chip-b1
rachelkang 6927264
Delete silly typos
rachelkang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
// | ||
// ChipCompat.cs | ||
// | ||
// Authors: | ||
// Rachel Kang <[email protected]> | ||
//com | ||
// Copyright (C) Microsoft Corporation. All rights reserved. | ||
// | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
using Foundation; | ||
using CoreFoundation; | ||
using ObjCRuntime; | ||
|
||
#nullable enable | ||
|
||
#if !NET | ||
namespace Chip { | ||
|
||
#if !MONOMAC | ||
public partial class ChipReadAttributeResult { } | ||
#endif // !MONOMAC | ||
|
||
[Obsolete ("This class is removed.")] | ||
[Register ("CHIPError", SkipRegistration = true)] | ||
public class ChipError : NSObject { | ||
|
||
public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
|
||
protected ChipError (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
protected ChipError (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
|
||
public virtual int ConvertToChipErrorCode (NSError errorCode) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
public virtual NSError? Create (int errorCode) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
|
||
} /* class ChipError */ | ||
|
||
#if !MONOMAC | ||
[Obsolete ("This class is removed, use 'ChipContentLauncher' instead.")] | ||
[Register ("CHIPContentLaunch", SkipRegistration = true)] | ||
public class ChipContentLaunch : NSObject { | ||
|
||
public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
|
||
protected ChipContentLaunch (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
protected ChipContentLaunch (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
public ChipContentLaunch (ChipDevice device, byte endpoint, DispatchQueue queue) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
|
||
public virtual void LaunchContent (byte autoPlay, string data, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
public virtual Task<ChipReadAttributeResult> LaunchContentAsync (byte autoPlay, string data) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
public virtual void LaunchUrl (string contentUrl, string displayString, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
public virtual Task<ChipReadAttributeResult> LaunchUrlAsync (string contentUrl, string displayString) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
public virtual void ReadAttributeAcceptsHeaderList (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
public virtual Task<ChipReadAttributeResult> ReadAttributeAcceptsHeaderListAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
public virtual void ReadAttributeSupportedStreamingTypes (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
public virtual Task<ChipReadAttributeResult> ReadAttributeSupportedStreamingTypesAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
public virtual void ReadAttributeClusterRevision (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
public virtual Task<ChipReadAttributeResult> ReadAttributeClusterRevisionAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
|
||
} /* class ChipContentLaunch */ | ||
#endif // !MONOMAC | ||
|
||
#if !MONOMAC | ||
[Obsolete ("This class is removed.")] | ||
[Register ("CHIPTrustedRootCertificates", SkipRegistration = true)] | ||
public class ChipTrustedRootCertificates : NSObject | ||
{ | ||
public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
|
||
protected ChipTrustedRootCertificates (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
protected ChipTrustedRootCertificates (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
public ChipTrustedRootCertificates (ChipDevice device, byte endpoint, DispatchQueue queue) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
|
||
public virtual void AddTrustedRootCertificate (NSData rootCertificate, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
public virtual Task<ChipReadAttributeResult> AddTrustedRootCertificateAsync (NSData rootCertificate) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
public virtual void RemoveTrustedRootCertificate (NSData trustedRootIdentifier, ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
public virtual Task<ChipReadAttributeResult> RemoveTrustedRootCertificateAsync (NSData trustedRootIdentifier) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
public virtual void ReadAttributeClusterRevision (ChipResponseHandler responseHandler) => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
public virtual Task<ChipReadAttributeResult> ReadAttributeClusterRevisionAsync () => throw new InvalidOperationException (Constants.RemovedFromChip); | ||
|
||
} | ||
#endif // !MONOMAC | ||
|
||
public partial class ChipWindowCovering { | ||
|
||
#if !MONOMAC | ||
static bool CheckSystemVersion () | ||
{ | ||
#if NET || IOS || __MACCATALYST__ || TVOS | ||
return SystemVersion.CheckiOS (15, 2); | ||
#elif WATCH | ||
return SystemVersion.CheckwatchOS (8, 3); | ||
#else | ||
#error Unknown platform | ||
#endif | ||
} | ||
#endif | ||
|
||
#if !MONOMAC | ||
public virtual void GoToLiftValue (ushort liftValue, ChipResponseHandler responseHandler) | ||
{ | ||
if (CheckSystemVersion ()) | ||
_OldGoToLiftValue (liftValue, responseHandler); | ||
else | ||
_NewGoToLiftValue (liftValue, responseHandler); | ||
} | ||
#endif | ||
|
||
#if !MONOMAC | ||
public virtual Task<ChipReadAttributeResult> GoToLiftValueAsync (ushort liftValue) | ||
{ | ||
if (CheckSystemVersion ()) | ||
return _OldGoToLiftValueAsync (liftValue); | ||
else | ||
return _NewGoToLiftValueAsync (liftValue); | ||
} | ||
#endif | ||
|
||
#if !MONOMAC | ||
public virtual void GoToTiltValue (ushort tiltValue, ChipResponseHandler responseHandler) | ||
{ | ||
if (CheckSystemVersion ()) | ||
_OldGoToTiltValue (tiltValue, responseHandler); | ||
else | ||
_NewGoToTiltValue (tiltValue, responseHandler); | ||
} | ||
#endif | ||
|
||
#if !MONOMAC | ||
public virtual Task<ChipReadAttributeResult> GoToTiltValueAsync (ushort tiltValue) | ||
{ | ||
if (CheckSystemVersion ()) | ||
return _OldGoToTiltValueAsync (tiltValue); | ||
else | ||
return _NewGoToTiltValueAsync (tiltValue); | ||
} | ||
#endif | ||
|
||
} | ||
} | ||
#endif // !NET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,27 @@ | ||||
// | ||||
// ChipKeypair.cs | ||||
// | ||||
// Authors: | ||||
// Rachel Kang <[email protected]> | ||||
//com | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
// Copyright (C) Microsoft Corporation. All rights reserved. | ||||
// | ||||
|
||||
using System; | ||||
using Security; | ||||
|
||||
#nullable enable | ||||
|
||||
namespace Chip { | ||||
public partial class ChipKeypair { | ||||
|
||||
#if !NET | ||||
[Mac (12,1), Watch (8,3), TV (15,2), iOS (15,2), MacCatalyst (15,2)] | ||||
#endif | ||||
static public SecKey? GetPubKey () | ||||
{ | ||||
var key = GetPubKeyRef (); | ||||
return key == IntPtr.Zero ? null : new SecKey (key, true); | ||||
} | ||||
} | ||||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.