Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,4 @@ paket-files/

#SoundCloud
*.sonarqube/
.sonarlint
25 changes: 25 additions & 0 deletions nanoFramework.System.Net/NetworkInformation/IPGlobalProperties.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// Copyright (c) .NET Foundation and Contributors
// See LICENSE file in the project root for full license information.
//

using System.Runtime.CompilerServices;

namespace System.Net.NetworkInformation
{
/// <summary>
/// Provides information about the network connectivity of the local computer.
/// </summary>
public static class IPGlobalProperties
{
/// <summary>
/// Gets the IP address of the network interface.
/// </summary>
/// <returns>An <see cref="IPAddress"/> if a valid IP address is available; otherwise, an <see cref="IPAddress.Any"/>.</returns>
/// <remarks>
/// This method is exclusive of .NET nanoFramework.
/// </remarks>
[MethodImpl(MethodImplOptions.InternalCall)]
public extern static IPAddress GetIPAddress();
}
}
19 changes: 13 additions & 6 deletions nanoFramework.System.Net/NetworkInformation/NetworkInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public class NetworkInterface
[Flags]
internal enum UpdateOperation : byte
{
Invalid = 0x00,
Dns = 0x01,
Dhcp = 0x02,
DhcpRenew = 0x04,
DhcpRelease = 0x08,
Mac = 0x10,
Invalid = 0x00,
Dns = 0x01,
Dhcp = 0x02,
DhcpRenew = 0x04,
DhcpRelease = 0x08,
Mac = 0x10,
}

private readonly int _interfaceIndex;
Expand All @@ -53,6 +53,13 @@ internal enum UpdateOperation : byte

private NetworkInterfaceType _networkInterfaceType;

/// <summary>
/// Indicates whether any network connection is available.
/// </summary>
/// <returns><see langword="true"/> if a network connection is available; otherwise, <see langword="false"/>.</returns>
[MethodImpl(MethodImplOptions.InternalCall)]
public extern static bool GetIsNetworkAvailable();

/// <summary>
/// Initializes a new instance of the <see cref="NetworkInterface"/> class.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion nanoFramework.System.Net/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

////////////////////////////////////////////////////////////////
// update this whenever the native assembly signature changes //
[assembly: AssemblyNativeVersion("100.1.3.1")]
[assembly: AssemblyNativeVersion("100.1.3.2")]
////////////////////////////////////////////////////////////////

// Setting ComVisible to false makes the types in this assembly not visible
Expand Down
44 changes: 43 additions & 1 deletion nanoFramework.System.Net/System.Net.nfproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,51 @@
<NF_GenerateStubsDirectory>bin\$(Configuration)\Stubs</NF_GenerateStubsDirectory>
<NF_GenerateSkeletonProjectName>sys_net_native</NF_GenerateSkeletonProjectName>
<Name>System.Net</Name>
<CodeAnalysisRuleSet>..\.sonarlint\nanoframework_lib-nanoframework.system.netcsharp.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<NFMDP_PE_ExcludeClassByName Include="ThisAssembly">
<InProject>false</InProject>
</NFMDP_PE_ExcludeClassByName>
<NFMDP_PE_ExcludeClassByName Include="NetworkInformationOptions">
<InProject>false</InProject>
</NFMDP_PE_ExcludeClassByName>
<NFMDP_PE_ExcludeClassByName Include="PhyProtocols">
<InProject>false</InProject>
</NFMDP_PE_ExcludeClassByName>
<NFMDP_PE_ExcludeClassByName Include="SslProtocols">
<InProject>false</InProject>
</NFMDP_PE_ExcludeClassByName>
<NFMDP_PE_ExcludeClassByName Include="SslVerification">
<InProject>false</InProject>
</NFMDP_PE_ExcludeClassByName>
<NFMDP_PE_ExcludeClassByName Include="AddressFamily">
<InProject>false</InProject>
</NFMDP_PE_ExcludeClassByName>
<NFMDP_PE_ExcludeClassByName Include="ProtocolFamily">
<InProject>false</InProject>
</NFMDP_PE_ExcludeClassByName>
<NFMDP_PE_ExcludeClassByName Include="ProtocolType">
<InProject>false</InProject>
</NFMDP_PE_ExcludeClassByName>
<NFMDP_PE_ExcludeClassByName Include="SelectMode">
<InProject>false</InProject>
</NFMDP_PE_ExcludeClassByName>
<NFMDP_PE_ExcludeClassByName Include="SocketError">
<InProject>false</InProject>
</NFMDP_PE_ExcludeClassByName>
<NFMDP_PE_ExcludeClassByName Include="SocketFlags">
<InProject>false</InProject>
</NFMDP_PE_ExcludeClassByName>
<NFMDP_PE_ExcludeClassByName Include="SocketOptionLevel">
<InProject>false</InProject>
</NFMDP_PE_ExcludeClassByName>
<NFMDP_PE_ExcludeClassByName Include="SocketOptionName">
<InProject>false</InProject>
</NFMDP_PE_ExcludeClassByName>
<NFMDP_PE_ExcludeClassByName Include="SocketType">
<InProject>false</InProject>
</NFMDP_PE_ExcludeClassByName>
</ItemGroup>
<ItemGroup>
<NFMDP_PE_LoadHints Include="..\packages\nanoFramework.CoreLibrary.1.10.1-preview.11\lib\mscorlib.dll">
Expand All @@ -57,6 +97,7 @@
<Compile Include="IPEndPoint.cs" />
<Compile Include="IPHostEntry.cs" />
<Compile Include="NetworkInformation\AuthenticationType.cs" />
<Compile Include="NetworkInformation\IPGlobalProperties.cs" />
<Compile Include="NetworkInformation\RadioType.cs" />
<Compile Include="NetworkInformation\EncryptionType.cs" />
<Compile Include="NetworkInformation\NetworkInformationOptions.cs" />
Expand Down Expand Up @@ -93,6 +134,7 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="..\.sonarlint\nanoframework_lib-nanoframework.system.net\CSharp\SonarLint.xml" Link="SonarLint.xml" />
<Content Include="README.txt" />
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -122,4 +164,4 @@
</PropertyGroup>
<Error Condition="!Exists('..\packages\Nerdbank.GitVersioning.3.1.91\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Nerdbank.GitVersioning.3.1.91\build\Nerdbank.GitVersioning.targets'))" />
</Target>
</Project>
</Project>
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.6.3-preview.{height}",
"version": "1.6.4-preview.{height}",
"assemblyVersion": {
"precision": "revision"
},
Expand Down