Skip to content

Commit

Permalink
Merge pull request WildernessLabs#411 from WildernessLabs/v1.6.0
Browse files Browse the repository at this point in the history
Release 1.6.0
  • Loading branch information
jorgedevs authored Dec 7, 2023
2 parents aa01b4f + 4e01e52 commit ca2636c
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 46 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Main Build
on:
workflow_dispatch:
pull_request:
branches: [ main ]
push:
branches: [ main ]

Expand All @@ -28,4 +29,4 @@ jobs:
run: dotnet workload restore Meadow.Core/source/Meadow.Core.sln

- name: Build Meadow.Core
run: dotnet build -c Release Meadow.Core/source/Meadow.Core.sln
run: dotnet build -c Release Meadow.Core/source/Meadow.Core.sln
8 changes: 4 additions & 4 deletions source/Meadow.Core/Meadow.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\icon.png" Link="icon.png" Pack="true" PackagePath="" />
<PackageReference Include="Meadow.Contracts" Version="1.5.0" />
<PackageReference Include="Meadow.Modbus" Version="1.5.0" />
<PackageReference Include="Meadow.MQTT" Version="1.5.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Meadow.Contracts" Version="1.6.0" />
<PackageReference Include="Meadow.Modbus" Version="1.6.0" />
<ProjectReference Include="..\..\..\MQTTnet\Source\MQTTnet\MQTTnet.csproj" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="NetEscapades.Configuration.Yaml" Version="2.2.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion source/Tests/Core.Unit.Tests/Core.Unit.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageReference Include="coverlet.collector" Version="1.2.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow" Version="1.5.0" />
<PackageReference Include="Meadow" Version="1.6.0" />
</ItemGroup>
<ItemGroup>
<None Update="app.config.envizor.yaml">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,10 @@ private static void CellSetState (CellNetworkState CellState)
/// </summary>
/// <param name="timeout">Timeout to check signal quality.</param>
/// <returns>A decimal number (0-31) representing the Cell Signal Quality (CSQ), or 99 if unavailable.</returns>
public double GetSignalQuality(int timeout = 30)
public double GetSignalQuality(int timeout)
{
Resolver.Log.Trace("Fetching cellular signal quality... It might take a few minutes and temporary disconnect you from the cellular network.");

string csqPattern = @"\+CSQ:\s+(\d+),\d+";
_at_cmds_output = string.Empty;

Expand Down Expand Up @@ -316,8 +318,10 @@ public double GetSignalQuality(int timeout = 30)
/// </summary>
/// <param name="timeout">The scan timeout duration in seconds.</param>
/// <returns>An array of CellNetwork objects representing available networks.</returns>
public CellNetwork[] ScanForAvailableNetworks(int timeout = 180)
public CellNetwork[] ScanForAvailableNetworks(int timeout)
{
Resolver.Log.Trace("Scanning for available cellular networks... It might take a few minutes and temporary disconnect you from the cellular network.");

CellSetState(CellNetworkState.ScanningNetworks);
_at_cmds_output = string.Empty;

Expand Down Expand Up @@ -347,9 +351,9 @@ public CellNetwork[] ScanForAvailableNetworks(int timeout = 180)
/// </summary>
/// <param name="resultTypes">An array of supported GNSS result types for data processing.</param>
/// <returns>A string containing combined output from GNSS-related AT commands, including NMEA sentences.</returns>
public string FetchGnssAtCmdsOutput(IGnssResult[] resultTypes, int timeout = 300)
public string FetchGnssAtCmdsOutput(IGnssResult[] resultTypes, int timeout)
{
Resolver.Log.Trace("Retrieving GPS location... It might take 3-5 minutes and temporary disconnect you from the cellular network.");
Resolver.Log.Trace("Retrieving GPS location... It might take a few minutes and temporary disconnect you from the cellular network.");
_at_cmds_output = string.Empty;

// TODO: Take into consideration the GNSS result types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ namespace Meadow.Hardware
/// </summary>
public class I2cBus : II2cBus
{
private readonly bool _showI2cDebug = false;
private readonly SemaphoreSlim _busSemaphore = new SemaphoreSlim(1, 1);
private readonly SemaphoreSlim _busSemaphore = new(1, 1);

private IMeadowIOController IOController { get; }
internal int BusNumber { get; set; } = 1;
Expand All @@ -25,25 +24,14 @@ public class I2cBus : II2cBus
public I2cBusSpeed BusSpeed { get; set; }

/// <summary>
/// Default constructor for the I2cBus class. This is private to prevent the
/// developer from calling it.
/// Default constructor for the I2cBus class. This is private to prevent the developer from calling it.
/// </summary>
private I2cBus(
IMeadowIOController ioController,
IPin clock,
II2cChannelInfo clockChannel,
IPin data,
II2cChannelInfo dataChannel,
I2cBusSpeed busSpeed,
ushort transactionTimeout = 100)
I2cBusSpeed busSpeed)
{
IOController = ioController;
BusSpeed = busSpeed;

#if !DEBUG
// ensure this is off in release (in case a dev sets it to true and forgets during check-in
_showI2cDebug = false;
#endif
}

private void Disable()
Expand Down Expand Up @@ -83,7 +71,7 @@ public static I2cBus From(IMeadowIOController ioController, IPin clock, IPin dat
success &= ioController.DeviceChannelManager.ReservePin(clock, ChannelConfigurationType.I2C).Item1;
success &= ioController.DeviceChannelManager.ReservePin(data, ChannelConfigurationType.I2C).Item1;

return new I2cBus(ioController, clock, clockChannel, data, dataChannel, busSpeed, transactionTimeout);
return new I2cBus(ioController, busSpeed);
}

/// <summary>
Expand Down Expand Up @@ -208,19 +196,14 @@ public unsafe void Exchange(byte peripheralAddress, Span<byte> writeBuffer, Span

private void DecipherI2cError(Nuttx.ErrorCode ec)
{
switch (ec)
throw ec switch
{
case (Nuttx.ErrorCode)125:
throw new NativeException("Communication error. Verify address and that SCL and SDA are not reversed.");
case (Nuttx.ErrorCode)116:
throw new NativeException("Communication error. Verify device is powered and that SCL is Connected.");
case (Nuttx.ErrorCode)112:
throw new NativeException("Communication error. No device found at requested address.");
case Nuttx.ErrorCode.TryAgain:
throw new NativeException("Communication error. Verify SDA Is Connected.");
default:
throw new NativeException($"Communication error. Error code {(int)ec}");
}
(Nuttx.ErrorCode)125 => new NativeException("Communication error. Verify address and that SCL and SDA are not reversed."),
(Nuttx.ErrorCode)116 => new NativeException("Communication error. Verify device is powered and that SCL is Connected."),
(Nuttx.ErrorCode)112 => new NativeException("Communication error. No device found at requested address."),
Nuttx.ErrorCode.TryAgain => new NativeException("Communication error. Verify SDA Is Connected."),
_ => new NativeException($"Communication error. Error code {(int)ec}"),
};
}

/// <inheritdoc/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static unsafe CellNetwork[] MeadowCellNetworkScanner()

try
{
Resolver.Log.Info("Scanning cell networks...");
Resolver.Log.Info("Scanning cell networks, it might take a few minutes...");
var len = meadow_cell_scanner(buffer);
if (len > 0)
{
Expand Down
2 changes: 1 addition & 1 deletion source/implementations/f7/Meadow.F7/Meadow.F7.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
<None Include="..\..\..\icon.png" Link="icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow" Version="1.5.0" />
<PackageReference Include="Meadow" Version="1.6.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.IO.Ports" Version="7.0.0" />
<PackageReference Include="Meadow" Version="1.5.0" />
<PackageReference Include="Meadow" Version="1.6.0" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\icon.png" Link="icon.png" Pack="true" PackagePath="" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Meadow.Simulation" Version="1.5.0" />
<PackageReference Include="Meadow.Simulation" Version="1.6.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="System.IO.Ports" Version="7.0.0" />
<PackageReference Include="System.Net.WebSockets" Version="4.3.0" />
<PackageReference Include="Meadow" Version="1.5.0" />
<PackageReference Include="Meadow" Version="1.6.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<ItemGroup>
<PackageReference Include="System.IO.Ports" Version="7.0.0" />
<PackageReference Include="System.Net.WebSockets" Version="4.3.0" />
<PackageReference Include="Meadow" Version="1.5.0" />
<PackageReference Include="Meadow" Version="1.6.0" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\icon.png" Link="icon.png" Pack="true" PackagePath="" />
Expand Down
2 changes: 1 addition & 1 deletion source/ui/Meadow.Avalonia/Meadow.Avalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
</ItemGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<PackageReference Include="Meadow" Version="1.5.0" />
<PackageReference Include="Meadow" Version="1.6.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion source/ui/Meadow.Maui/Meadow.Maui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<PackageReference Include="Meadow.Windows" Version="1.5.0" />
<PackageReference Include="Meadow.Windows" Version="1.6.0" />
</ItemGroup>
</Project>

0 comments on commit ca2636c

Please sign in to comment.