未验证 提交 eae8a70b 编写于 作者: P Patrick Grawehr 提交者: GitHub

The call to Dns.GetHostEntry() may fail on MacOS (#1927)

* The call to Dns.GetHostEntry() may fail on MacOS

... only ever seen there.

* Build on one CPU only

Maybe this avoids the concurrency problems?

* Revert "Build on one CPU only"

This reverts commit 7ee8124b4ceb5e31df7f74d7da4e908ad96aaac3.

* Make sure there's only one .csproj per directory

Therefore split up sample folders containing multiple
projects into subfolders. This fixes the macOS build and
also some weird issues on other operating systems (such
as the debugger getting confused about which one to execute)

* Also update the solution files
上级 aef8e764
......@@ -7,7 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Arduino", "Arduino.csproj",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Device.Gpio", "..\..\System.Device.Gpio\System.Device.Gpio.csproj", "{0B90F9D4-7353-4172-A317-714471A06781}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Arduino.sample", "samples\Arduino.sample.csproj", "{2670F7BF-A7C8-49EB-9A99-1719A90D0C67}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Arduino.sample", "samples\ApiChecker\Arduino.sample.csproj", "{2670F7BF-A7C8-49EB-9A99-1719A90D0C67}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bmxx80", "..\Bmxx80\Bmxx80.csproj", "{EEEB0FB8-E1ED-4970-BDF6-DA3D5E2ED074}"
EndProject
......@@ -21,7 +21,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CpuTemperature", "..\CpuTem
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{9E5A25ED-9839-4C1A-9B27-993437D1CB31}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Arduino.Monitor", "samples\Arduino.Monitor.csproj", "{23B4B60C-9594-42BB-9D25-C54983B0F809}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Arduino.Monitor", "samples\Monitor\Arduino.Monitor.csproj", "{23B4B60C-9594-42BB-9D25-C54983B0F809}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CA26B999-4C0E-4E82-A46E-A68AC1B85C10}"
EndProject
......
......@@ -16,10 +16,9 @@
<Compile Include="TestCases.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Bmxx80\Bmxx80.csproj" />
<ProjectReference Include="..\..\Board\Board.csproj" />
<ProjectReference Include="..\..\Common\Common.csproj" />
<ProjectReference Include="..\..\Mcp3xxx\Mcp3xxx.csproj" />
<ProjectReference Include="..\Arduino.csproj" />
<ProjectReference Include="..\..\..\Bmxx80\Bmxx80.csproj" />
<ProjectReference Include="..\..\..\Board\Board.csproj" />
<ProjectReference Include="..\..\..\Mcp3xxx\Mcp3xxx.csproj" />
<ProjectReference Include="..\..\Arduino.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -14,13 +14,12 @@
<Compile Include="Arduino.Monitor.cs" />
</ItemGroup>
<ItemGroup>
<!--Cases used when running in VS, with the solution config either Windows-Debug or Linux-Debug (or -Release) -->
<ProjectReference Include="..\..\Bmxx80\Bmxx80.csproj" />
<ProjectReference Include="..\..\Button\Button.csproj" />
<ProjectReference Include="..\..\Board\Board.csproj" />
<ProjectReference Include="..\..\CharacterLcd\CharacterLcd.csproj" />
<ProjectReference Include="..\..\HardwareMonitor\HardwareMonitor.csproj" />
<ProjectReference Include="..\..\Mcp3xxx\Mcp3xxx.csproj" />
<ProjectReference Include="..\Arduino.csproj" />
<ProjectReference Include="..\..\..\Bmxx80\Bmxx80.csproj" />
<ProjectReference Include="..\..\..\Button\Button.csproj" />
<ProjectReference Include="..\..\..\Board\Board.csproj" />
<ProjectReference Include="..\..\..\CharacterLcd\CharacterLcd.csproj" />
<ProjectReference Include="..\..\..\HardwareMonitor\HardwareMonitor.csproj" />
<ProjectReference Include="..\..\..\Mcp3xxx\Mcp3xxx.csproj" />
<ProjectReference Include="..\..\Arduino.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -10,7 +10,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../Arduino.csproj" />
<ProjectReference Include="..\Arduino.csproj" />
<ProjectReference Include="..\..\..\..\tools\ArduinoCsCompiler\Frontend\Frontend.csproj" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
......
......@@ -5,9 +5,9 @@ VisualStudioVersion = 16.0.31205.134
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{EA121A48-7916-4D9D-94C8-8E59BCDE3A96}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bh1745.Sample", "samples\Bh1745.Sample.csproj", "{24A728CA-F4EF-4DB0-B13F-65FFD772352B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bh1745.Sample", "samples\BH1745\Bh1745.Sample.csproj", "{24A728CA-F4EF-4DB0-B13F-65FFD772352B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bh1745CustomConfiguration.Sample", "samples\Bh1745CustomConfiguration.Sample.csproj", "{F6ED35EA-2FDE-4056-8165-0FAB6CE5DD5E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bh1745CustomConfiguration.Sample", "samples\CustomConfiguration\Bh1745CustomConfiguration.Sample.csproj", "{F6ED35EA-2FDE-4056-8165-0FAB6CE5DD5E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bh1745", "Bh1745.csproj", "{C572C86D-5BB2-4610-84EA-768257758933}"
EndProject
......
......@@ -5,9 +5,9 @@
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Bh1745.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../Bh1745.csproj" />
<ProjectReference Include="../../Bh1745.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>$(DefaultSampleTfms)</TargetFramework>
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>
<ItemGroup>
<Compile Include="Bh1745.CustomConfiguration.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../../Bh1745.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -5,11 +5,11 @@ VisualStudioVersion = 16.0.30011.22
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{3810A23A-DF9E-4956-961F-10272B731209}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bme280.sample", "samples\Bme280.sample.csproj", "{5F20AA65-F5E2-4CD9-8847-1508DA362092}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bme280.sample", "samples\Bme280\Bme280.sample.csproj", "{5F20AA65-F5E2-4CD9-8847-1508DA362092}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bme680.sample", "samples\Bme680.sample.csproj", "{0583C743-4EE5-4150-8886-AABC1EB6A339}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bme680.sample", "samples\Bme680\Bme680.sample.csproj", "{0583C743-4EE5-4150-8886-AABC1EB6A339}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bmp280.sample", "samples\Bmp280.sample.csproj", "{99456915-2483-4C22-8F63-8817A097F2E2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bmp280.sample", "samples\Bmp280\Bmp280.sample.csproj", "{99456915-2483-4C22-8F63-8817A097F2E2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bmxx80", "Bmxx80.csproj", "{D0AA8380-159F-445B-A081-D750B9062ADA}"
EndProject
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>$(DefaultSampleTfms)</TargetFramework>
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>
<ItemGroup>
<None Remove="rpi-bmp280_i2c.fzz" />
<None Remove="rpi-bmp280_i2c.png" />
</ItemGroup>
<ItemGroup>
<Compile Include="Bme280.sample.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Bmxx80.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -5,9 +5,9 @@
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.CustomConfiguration.cs" />
<Compile Include="Bme280.sample.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../Bh1745.csproj" />
<ProjectReference Include="../../Bmxx80.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Device.I2c;
using System.Threading;
using Iot.Device.Bmxx80;
using Iot.Device.Common;
using UnitsNet;
Console.WriteLine("Hello BME680!");
// The I2C bus ID on the Raspberry Pi 3.
const int busId = 1;
// set this to the current sea level pressure in the area for correct altitude readings
Pressure defaultSeaLevelPressure = WeatherHelper.MeanSeaLevel;
I2cConnectionSettings i2cSettings = new(busId, Bme680.DefaultI2cAddress);
I2cDevice i2cDevice = I2cDevice.Create(i2cSettings);
using Bme680 bme680 = new Bme680(i2cDevice, Temperature.FromDegreesCelsius(20.0));
while (true)
{
// reset will change settings back to default
bme680.Reset();
// 10 consecutive measurement with default settings
for (var i = 0; i < 10; i++)
{
// Perform a synchronous measurement
var readResult = bme680.Read();
// Print out the measured data
Console.WriteLine($"Gas resistance: {readResult.GasResistance?.Ohms:0.##}Ohm");
Console.WriteLine($"Temperature: {readResult.Temperature?.DegreesCelsius:0.#}\u00B0C");
Console.WriteLine($"Pressure: {readResult.Pressure?.Hectopascals:0.##}hPa");
Console.WriteLine($"Relative humidity: {readResult.Humidity?.Percent:0.#}%");
if (readResult.Temperature.HasValue && readResult.Pressure.HasValue)
{
var altValue = WeatherHelper.CalculateAltitude(readResult.Pressure.Value, defaultSeaLevelPressure, readResult.Temperature.Value);
Console.WriteLine($"Altitude: {altValue.Meters:0.##}m");
}
if (readResult.Temperature.HasValue && readResult.Humidity.HasValue)
{
// WeatherHelper supports more calculations, such as saturated vapor pressure, actual vapor pressure and absolute humidity.
Console.WriteLine($"Heat index: {WeatherHelper.CalculateHeatIndex(readResult.Temperature.Value, readResult.Humidity.Value).DegreesCelsius:0.#}\u00B0C");
Console.WriteLine($"Dew point: {WeatherHelper.CalculateDewPoint(readResult.Temperature.Value, readResult.Humidity.Value).DegreesCelsius:0.#}\u00B0C");
}
// when measuring the gas resistance on each cycle it is important to wait a certain interval
// because a heating plate is activated which will heat up the sensor without sleep, this can
// falsify all readings coming from the sensor
Thread.Sleep(1000);
}
// change the settings
bme680.TemperatureSampling = Sampling.HighResolution;
bme680.HumiditySampling = Sampling.UltraHighResolution;
bme680.PressureSampling = Sampling.Skipped;
bme680.ConfigureHeatingProfile(Bme680HeaterProfile.Profile2, Temperature.FromDegreesCelsius(280), Duration.FromMilliseconds(80), Temperature.FromDegreesCelsius(24));
bme680.HeaterProfile = Bme680HeaterProfile.Profile2;
// 10 consecutive measurements with custom settings
for (int i = 0; i < 10; i++)
{
// Perform an asynchronous measurement
var readResult = await bme680.ReadAsync();
// Print out the measured data
Console.WriteLine($"Gas resistance: {readResult.GasResistance?.Ohms:0.##}Ohm");
Console.WriteLine($"Temperature: {readResult.Temperature?.DegreesCelsius:0.#}\u00B0C");
Console.WriteLine($"Pressure: {readResult.Pressure?.Hectopascals:0.##}hPa");
Console.WriteLine($"Relative humidity: {readResult.Humidity?.Percent:0.#}%");
if (readResult.Temperature.HasValue && readResult.Pressure.HasValue)
{
var altValue = WeatherHelper.CalculateAltitude(readResult.Pressure.Value, defaultSeaLevelPressure, readResult.Temperature.Value);
Console.WriteLine($"Altitude: {altValue.Meters:0.##}m");
}
if (readResult.Temperature.HasValue && readResult.Humidity.HasValue)
{
// WeatherHelper supports more calculations, such as saturated vapor pressure, actual vapor pressure and absolute humidity.
Console.WriteLine($"Heat index: {WeatherHelper.CalculateHeatIndex(readResult.Temperature.Value, readResult.Humidity.Value).DegreesCelsius:0.#}\u00B0C");
Console.WriteLine($"Dew point: {WeatherHelper.CalculateDewPoint(readResult.Temperature.Value, readResult.Humidity.Value).DegreesCelsius:0.#}\u00B0C");
}
Thread.Sleep(1000);
}
}
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Device.I2c;
using System.Threading;
using Iot.Device.Bmxx80;
using Iot.Device.Common;
using UnitsNet;
Console.WriteLine("Hello BME680!");
// The I2C bus ID on the Raspberry Pi 3.
const int busId = 1;
// set this to the current sea level pressure in the area for correct altitude readings
Pressure defaultSeaLevelPressure = WeatherHelper.MeanSeaLevel;
I2cConnectionSettings i2cSettings = new(busId, Bme680.DefaultI2cAddress);
I2cDevice i2cDevice = I2cDevice.Create(i2cSettings);
using Bme680 bme680 = new Bme680(i2cDevice, Temperature.FromDegreesCelsius(20.0));
while (true)
{
// reset will change settings back to default
bme680.Reset();
// 10 consecutive measurement with default settings
for (var i = 0; i < 10; i++)
{
// Perform a synchronous measurement
var readResult = bme680.Read();
// Print out the measured data
Console.WriteLine($"Gas resistance: {readResult.GasResistance?.Ohms:0.##}Ohm");
Console.WriteLine($"Temperature: {readResult.Temperature?.DegreesCelsius:0.#}\u00B0C");
Console.WriteLine($"Pressure: {readResult.Pressure?.Hectopascals:0.##}hPa");
Console.WriteLine($"Relative humidity: {readResult.Humidity?.Percent:0.#}%");
if (readResult.Temperature.HasValue && readResult.Pressure.HasValue)
{
var altValue = WeatherHelper.CalculateAltitude(readResult.Pressure.Value, defaultSeaLevelPressure, readResult.Temperature.Value);
Console.WriteLine($"Altitude: {altValue.Meters:0.##}m");
}
if (readResult.Temperature.HasValue && readResult.Humidity.HasValue)
{
// WeatherHelper supports more calculations, such as saturated vapor pressure, actual vapor pressure and absolute humidity.
Console.WriteLine($"Heat index: {WeatherHelper.CalculateHeatIndex(readResult.Temperature.Value, readResult.Humidity.Value).DegreesCelsius:0.#}\u00B0C");
Console.WriteLine($"Dew point: {WeatherHelper.CalculateDewPoint(readResult.Temperature.Value, readResult.Humidity.Value).DegreesCelsius:0.#}\u00B0C");
}
// when measuring the gas resistance on each cycle it is important to wait a certain interval
// because a heating plate is activated which will heat up the sensor without sleep, this can
// falsify all readings coming from the sensor
Thread.Sleep(1000);
}
// change the settings
bme680.TemperatureSampling = Sampling.HighResolution;
bme680.HumiditySampling = Sampling.UltraHighResolution;
bme680.PressureSampling = Sampling.Skipped;
bme680.ConfigureHeatingProfile(Bme680HeaterProfile.Profile2, Temperature.FromDegreesCelsius(280), Duration.FromMilliseconds(80), Temperature.FromDegreesCelsius(24));
bme680.HeaterProfile = Bme680HeaterProfile.Profile2;
// 10 consecutive measurements with custom settings
for (int i = 0; i < 10; i++)
{
// Perform an asynchronous measurement
var readResult = await bme680.ReadAsync();
// Print out the measured data
Console.WriteLine($"Gas resistance: {readResult.GasResistance?.Ohms:0.##}Ohm");
Console.WriteLine($"Temperature: {readResult.Temperature?.DegreesCelsius:0.#}\u00B0C");
Console.WriteLine($"Pressure: {readResult.Pressure?.Hectopascals:0.##}hPa");
Console.WriteLine($"Relative humidity: {readResult.Humidity?.Percent:0.#}%");
if (readResult.Temperature.HasValue && readResult.Pressure.HasValue)
{
var altValue = WeatherHelper.CalculateAltitude(readResult.Pressure.Value, defaultSeaLevelPressure, readResult.Temperature.Value);
Console.WriteLine($"Altitude: {altValue.Meters:0.##}m");
}
if (readResult.Temperature.HasValue && readResult.Humidity.HasValue)
{
// WeatherHelper supports more calculations, such as saturated vapor pressure, actual vapor pressure and absolute humidity.
Console.WriteLine($"Heat index: {WeatherHelper.CalculateHeatIndex(readResult.Temperature.Value, readResult.Humidity.Value).DegreesCelsius:0.#}\u00B0C");
Console.WriteLine($"Dew point: {WeatherHelper.CalculateDewPoint(readResult.Temperature.Value, readResult.Humidity.Value).DegreesCelsius:0.#}\u00B0C");
}
Thread.Sleep(1000);
}
}
......@@ -4,14 +4,10 @@
<TargetFramework>$(DefaultSampleTfms)</TargetFramework>
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>
<ItemGroup>
<None Remove="rpi-bmp280_i2c.fzz" />
<None Remove="rpi-bmp280_i2c.png" />
</ItemGroup>
<ItemGroup>
<Compile Include="Bme680.sample.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Bmxx80.csproj" />
<ProjectReference Include="../../Bmxx80.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -4,14 +4,10 @@
<TargetFramework>$(DefaultSampleTfms)</TargetFramework>
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>
<ItemGroup>
<None Remove="rpi-bmp280_i2c.fzz" />
<None Remove="rpi-bmp280_i2c.png" />
</ItemGroup>
<ItemGroup>
<Compile Include="Bmp280.sample.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Bmxx80.csproj" />
<ProjectReference Include="../../Bmxx80.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -10,9 +10,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{499A
samples\README.md = samples\README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Llc200d3sh.Sample", "samples\Llc200d3sh.Sample.csproj", "{6A38157B-7F9E-4003-A346-D898C86AE8FA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Llc200d3sh.Sample", "samples\Llc200d3sh\Llc200d3sh.Sample.csproj", "{6A38157B-7F9E-4003-A346-D898C86AE8FA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiquidLevelSwitch.Sample", "samples\LiquidLevelSwitch.Sample.csproj", "{2675D556-74B1-40DA-B1F8-4CE2733463CF}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiquidLevelSwitch.Sample", "samples\LiquidLevelSwitch\LiquidLevelSwitch.Sample.csproj", "{2675D556-74B1-40DA-B1F8-4CE2733463CF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......
......@@ -4,14 +4,10 @@
<TargetFramework>$(DefaultSampleTfms)</TargetFramework>
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>
<ItemGroup>
<None Remove="rpi-llc200d3sh.fzz" />
<None Remove="rpi-llc200d3sh_bb.png" />
</ItemGroup>
<ItemGroup>
<Compile Include="LiquidLevelSwitch.sample.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LiquidLevel.csproj" />
<ProjectReference Include="../../LiquidLevel.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -4,14 +4,10 @@
<TargetFramework>$(DefaultSampleTfms)</TargetFramework>
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>
<ItemGroup>
<None Remove="rpi-llc200d3sh.fzz" />
<None Remove="rpi-llc200d3sh_bb.png" />
</ItemGroup>
<ItemGroup>
<Compile Include="Llc200d3sh.sample.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LiquidLevel.csproj" />
<ProjectReference Include="../../LiquidLevel.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -255,14 +255,22 @@ namespace Iot.Device.Nmea0183
}
// Check whether the given address is ours (new IPs can be added at runtime, if interfaces go up)
var host = Dns.GetHostEntry(Dns.GetHostName());
if (host.AddressList.Contains(pt.Address))
try
{
_knownSenders.Add(pt.Address, true);
var host = Dns.GetHostEntry(Dns.GetHostName());
if (host.AddressList.Contains(pt.Address))
{
_knownSenders.Add(pt.Address, true);
}
else
{
_knownSenders.Add(pt.Address, false);
}
}
else
catch (SocketException x)
{
_knownSenders.Add(pt.Address, false);
// Dns.GetHostEntry() sometimes throws a SocketException, but only on MacOS.
_parent.FireOnParserError($"Unable to get DNS entry for Host, possibly disconnected?. Error: {x.Message}", NmeaError.None);
}
}
......
......@@ -5,15 +5,15 @@ VisualStudioVersion = 17.2.32505.173
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{A15390DB-F07B-4014-9840-5F792089E026}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seesaw.Sample.BlinkingLights", "samples\Seesaw.Sample.BlinkingLights.csproj", "{413D2811-7A97-44AC-9D82-099209920BBE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seesaw.Sample.BlinkingLights", "samples\BlinkingLights\Seesaw.Sample.BlinkingLights.csproj", "{413D2811-7A97-44AC-9D82-099209920BBE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seesaw.Sample.Capabilities", "samples\Seesaw.Sample.Capabilities.csproj", "{5807BB95-184F-47CC-A8A4-63519079B525}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seesaw.Sample.Capabilities", "samples\Capabilities\Seesaw.Sample.Capabilities.csproj", "{5807BB95-184F-47CC-A8A4-63519079B525}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seesaw.Sample.SoilSensor", "samples\Seesaw.Sample.SoilSensor.csproj", "{164336C0-7E90-4082-B98D-0AEBB60717E3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seesaw.Sample.SoilSensor", "samples\SoilSensor\Seesaw.Sample.SoilSensor.csproj", "{164336C0-7E90-4082-B98D-0AEBB60717E3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seesaw", "Seesaw.csproj", "{F87E6203-1DA1-4648-9A1C-AB39C0CDE7E7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seesaw.Sample.Encoder", "samples\Seesaw.Sample.Encoder.csproj", "{2AF6BC30-E051-45A3-AA35-9CBB7E6352BA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seesaw.Sample.Encoder", "samples\Encoder\Seesaw.Sample.Encoder.csproj", "{2AF6BC30-E051-45A3-AA35-9CBB7E6352BA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......
......@@ -5,9 +5,9 @@
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../Seesaw.csproj" />
<ProjectReference Include="../../Seesaw.csproj" />
<Compile Include="Seesaw.Sample.BlinkingLights.cs" />
<Compile Include="../../../../samples/led-more-blinking-lights/TimeEnvelope.cs" />
<Compile Include="../../../../../samples/led-more-blinking-lights/TimeEnvelope.cs" />
<Compile Include="Volume.cs" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -5,7 +5,7 @@
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../Seesaw.csproj" />
<ProjectReference Include="../../Seesaw.csproj" />
<Compile Include="Seesaw.Sample.Capabilities.cs" />
</ItemGroup>
<ItemGroup>
......
......@@ -8,6 +8,6 @@
<Compile Include="Seesaw.Sample.Encoder.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Seesaw.csproj" />
<ProjectReference Include="../../Seesaw.csproj" />
</ItemGroup>
</Project>
......@@ -5,7 +5,7 @@
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../Seesaw.csproj" />
<ProjectReference Include="../../Seesaw.csproj" />
<Compile Include="Seesaw.Sample.SoilSensor.cs" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -31,7 +31,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{B096
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WeatherStation", "samples\WeatherStation\WeatherStation.csproj", "{599172D6-F472-4D53-BA77-044C0A32A2B3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Arduino.sample", "..\..\src\devices\Arduino\samples\Arduino.sample.csproj", "{C6C5ABC7-8A2C-4127-92A4-6D2471AEB3AA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Arduino.sample", "..\..\src\devices\Arduino\samples\ApiChecker\Arduino.sample.csproj", "{C6C5ABC7-8A2C-4127-92A4-6D2471AEB3AA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mcp3xxx", "..\..\src\devices\Mcp3xxx\Mcp3xxx.csproj", "{A9978931-850E-4E46-9029-1BD82DE4FD6E}"
EndProject
......
......@@ -22,7 +22,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\devices\Arduino\Arduino.csproj" />
<ProjectReference Include="..\..\..\src\devices\Arduino\samples\Arduino.sample.csproj" />
<ProjectReference Include="..\..\..\src\devices\Arduino\samples\ApiChecker\Arduino.sample.csproj" />
<ProjectReference Include="..\ArduinoCsCompiler.csproj" />
</ItemGroup>
</Project>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册