Skip to content
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

[network][watchos] Enable Network.framework for watchOS (new in 6.0) #6874

Merged
merged 1 commit into from Aug 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Constants.watch.cs.in
Expand Up @@ -63,6 +63,7 @@ namespace ObjCRuntime {

// WatchOS 6
public const string AuthenticationServicesLibrary = "/System/Library/Frameworks/AuthenticationServices.framework/AuthenticationServices";
public const string NetworkLibrary = "/System/Library/Frameworks/Network.framework/Network";
public const string PushKitLibrary = "/System/Library/Frameworks/PushKit.framework/PushKit";
public const string SoundAnalysisLibrary = "/System/Library/Frameworks/SoundAnalysis.framework/SoundAnalysis";
public const string CoreMediaLibrary = "/System/Library/Frameworks/CoreMedia.framework/CoreMedia";
Expand Down
1 change: 1 addition & 0 deletions src/Network/NWAdvertiseDescriptor.cs
Expand Up @@ -17,6 +17,7 @@

namespace Network {
[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public class NWAdvertiseDescriptor : NativeObject {
public NWAdvertiseDescriptor (IntPtr handle, bool owns) : base (handle, owns)
{ }
Expand Down
3 changes: 3 additions & 0 deletions src/Network/NWConnection.cs
Expand Up @@ -16,6 +16,8 @@
using nw_parameters_t=System.IntPtr;

namespace Network {
[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public enum NWConnectionState {
Invalid = 0,
Waiting = 1,
Expand All @@ -41,6 +43,7 @@ public enum NWConnectionState {
public delegate void NWConnectionReceiveDispatchDataCompletion (DispatchData data, NWContentContext context, bool isComplete, NWError error);

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public class NWConnection : NativeObject {
public NWConnection (IntPtr handle, bool owns) : base (handle, owns) {}

Expand Down
1 change: 1 addition & 0 deletions src/Network/NWContentContext.cs
Expand Up @@ -19,6 +19,7 @@ namespace Network {
// available as static properties on this class
//
[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public class NWContentContext : NativeObject {
bool global;
public NWContentContext (IntPtr handle, bool owns) : base (handle, owns)
Expand Down
3 changes: 3 additions & 0 deletions src/Network/NWEndpoint.cs
Expand Up @@ -17,6 +17,8 @@

namespace Network {

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public enum NWEndpointType {
Invalid = 0,
Address = 1,
Expand All @@ -25,6 +27,7 @@ public enum NWEndpointType {
}

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public class NWEndpoint : NativeObject {
public NWEndpoint (IntPtr handle, bool owns) : base (handle, owns) {}

Expand Down
1 change: 1 addition & 0 deletions src/Network/NWError.cs
Expand Up @@ -15,6 +15,7 @@

namespace Network {
[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public class NWError : NativeObject {
public NWError (IntPtr handle, bool owns) : base (handle, owns)
{
Expand Down
3 changes: 3 additions & 0 deletions src/Network/NWInterface.cs
Expand Up @@ -18,6 +18,7 @@
namespace Network {

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public class NWInterface : NativeObject {
public NWInterface (IntPtr handle, bool owns) : base (handle, owns) {}

Expand All @@ -37,6 +38,8 @@ public class NWInterface : NativeObject {
public uint Index => nw_interface_get_index (GetCheckedHandle ());
}

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public enum NWInterfaceType {
Other = 0,
Wifi = 1,
Expand Down
3 changes: 3 additions & 0 deletions src/Network/NWListener.cs
Expand Up @@ -13,6 +13,8 @@
using CoreFoundation;

namespace Network {
[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public enum NWListenerState {
Invalid = 0,
Waiting = 1,
Expand All @@ -22,6 +24,7 @@ public enum NWListenerState {
}

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public class NWListener : NativeObject {
public NWListener (IntPtr handle, bool owns) : base (handle, owns)
{
Expand Down
3 changes: 3 additions & 0 deletions src/Network/NWParameters.cs
Expand Up @@ -17,6 +17,7 @@

namespace Network {
[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public enum NWMultiPathService {
Disabled = 0,
Handover = 1,
Expand All @@ -25,6 +26,7 @@ public enum NWMultiPathService {
}

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public class NWParameters : NativeObject {
public NWParameters (IntPtr handle, bool owns) : base (handle, owns) {}

Expand Down Expand Up @@ -436,6 +438,7 @@ public void IterateProhibitedInterfaces (Func<NWInterfaceType,bool> callback)
}

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public enum NWParametersExpiredDnsBehavior {
Default = 0,
Allow = 1,
Expand Down
2 changes: 2 additions & 0 deletions src/Network/NWPath.cs
Expand Up @@ -17,6 +17,7 @@ namespace Network {

// this maps to `nw_path_status_t` in Network/Headers/path.h (and not the enum from NetworkExtension)
[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public enum NWPathStatus {
Invalid = 0,
Satisfied = 1,
Expand All @@ -25,6 +26,7 @@ public enum NWPathStatus {
}

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public class NWPath : NativeObject {
public NWPath (IntPtr handle, bool owns) : base (handle, owns) {}

Expand Down
1 change: 1 addition & 0 deletions src/Network/NWPathMonitor.cs
Expand Up @@ -16,6 +16,7 @@
namespace Network {

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public class NWPathMonitor : NativeObject {
public NWPathMonitor (IntPtr handle, bool owns) : base (handle, owns) {}

Expand Down
1 change: 1 addition & 0 deletions src/Network/NWProtocolDefinition.cs
Expand Up @@ -24,6 +24,7 @@ public enum NWIPVersion {
}

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public class NWProtocolDefinition : NativeObject {
public NWProtocolDefinition (IntPtr handle, bool owns) : base (handle, owns) {}

Expand Down
1 change: 1 addition & 0 deletions src/Network/NWProtocolMetadata.cs
Expand Up @@ -36,6 +36,7 @@ public enum NWIPEcnFlag {
}

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public class NWProtocolMetadata : NativeObject {

[DllImport (Constants.NetworkLibrary)]
Expand Down
1 change: 1 addition & 0 deletions src/Network/NWProtocolOptions.cs
Expand Up @@ -19,6 +19,7 @@
namespace Network {

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public class NWProtocolOptions : NativeObject {
public NWProtocolOptions (IntPtr handle, bool owns) : base (handle, owns) {}

Expand Down
1 change: 1 addition & 0 deletions src/Network/NWProtocolStack.cs
Expand Up @@ -21,6 +21,7 @@
namespace Network {

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public class NWProtocolStack : NativeObject {
public NWProtocolStack (IntPtr handle, bool owns) : base (handle, owns) {}

Expand Down
4 changes: 1 addition & 3 deletions src/frameworks.sources
Expand Up @@ -1768,6 +1768,7 @@ COMMON_FRAMEWORKS = \
Compression \
Foundation \
GameKit \
Network \
SceneKit \
SoundAnalysis \
SpriteKit \
Expand Down Expand Up @@ -1827,7 +1828,6 @@ MAC_FRAMEWORKS = \
MobileCoreServices \
ModelIO \
MultipeerConnectivity \
Network \
NaturalLanguage \
NetworkExtension \
NotificationCenter \
Expand Down Expand Up @@ -1924,7 +1924,6 @@ IOS_FRAMEWORKS = \
ModelIO \
MultipeerConnectivity \
NaturalLanguage \
Network \
NetworkExtension \
NewsstandKit \
NotificationCenter \
Expand Down Expand Up @@ -2019,7 +2018,6 @@ TVOS_FRAMEWORKS = \
ModelIO \
MultipeerConnectivity \
NaturalLanguage \
Network \
OpenGLES \
Photos \
PhotosUI \
Expand Down
4 changes: 4 additions & 0 deletions src/network.cs
Expand Up @@ -8,6 +8,7 @@
namespace Network {

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
public enum NWErrorDomain {
Invalid = 0,
[Field ("kNWErrorDomainPOSIX")]
Expand All @@ -19,6 +20,7 @@ public enum NWErrorDomain {
}

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
[Static]
[Internal]
partial interface NWContentContextConstants {
Expand All @@ -33,6 +35,7 @@ partial interface NWContentContextConstants {
}

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
[Static]
[Internal]
partial interface NWConnectionConstants {
Expand All @@ -42,6 +45,7 @@ partial interface NWConnectionConstants {
}

[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
[Static]
[Internal]
partial interface NWParametersConstants {
Expand Down