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

Project split #454

Merged
merged 11 commits into from
Feb 9, 2024
39 changes: 0 additions & 39 deletions Source/v2/Meadow.CLI.Core/Meadow.CLI.Core.csproj

This file was deleted.

30 changes: 24 additions & 6 deletions Source/v2/Meadow.CLI.v2.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Meadow.UsbLib", "Meadow.Usb
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Meadow.UsbLibClassic", "Meadow.UsbLibClassic\Meadow.UsbLibClassic.csproj", "{42F3A4D2-CBF9-4DF3-8ADC-BF775101F34A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Meadow.CLI.Core", "Meadow.CLI.Core\Meadow.CLI.Core.csproj", "{677B1C15-8936-4807-8A4F-4F5219BBDB7C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Meadow.Cloud.Client", "Meadow.Cloud.Client\Meadow.Cloud.Client.csproj", "{A71A3C98-2B11-46FE-AB7A-EAD9271862AA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Meadow.UsbLib.Core", "Meadow.UsbLib.Core\Meadow.UsbLib.Core.csproj", "{F02ADBEF-4D52-4A71-9D95-74F45D68B43B}"
Expand All @@ -36,6 +34,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Meadow.SoftwareManager.Inte
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Meadow.Cloud.Client.Unit.Tests", "Tests\Meadow.Cloud.Client.Unit.Tests\Meadow.Cloud.Client.Unit.Tests.csproj", "{E5DD4338-135A-4906-B67D-3EF2C44C96D9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Meadow.Linker", "Meadow.Linker\Meadow.Linker.csproj", "{335A8E39-FBCB-4B4E-BF83-6EBBBC1F0C45}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Meadow.Dfu", "Meadow.Dfu\Meadow.Dfu.csproj", "{6AE8C9EA-87AF-49AC-A63B-9A9416DD76E0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Meadow.Package", "Meadow.Package\Meadow.Package.csproj", "{E34A4BFA-1E92-4951-A5F9-B847EAAB05F8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meadow.Firmware", "Meadow.Firmware\Meadow.Firmware.csproj", "{D2274F30-A001-482A-99E3-0AB1970CF695}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -78,10 +84,6 @@ Global
{42F3A4D2-CBF9-4DF3-8ADC-BF775101F34A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42F3A4D2-CBF9-4DF3-8ADC-BF775101F34A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{42F3A4D2-CBF9-4DF3-8ADC-BF775101F34A}.Release|Any CPU.Build.0 = Release|Any CPU
{677B1C15-8936-4807-8A4F-4F5219BBDB7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{677B1C15-8936-4807-8A4F-4F5219BBDB7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{677B1C15-8936-4807-8A4F-4F5219BBDB7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{677B1C15-8936-4807-8A4F-4F5219BBDB7C}.Release|Any CPU.Build.0 = Release|Any CPU
{A71A3C98-2B11-46FE-AB7A-EAD9271862AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A71A3C98-2B11-46FE-AB7A-EAD9271862AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A71A3C98-2B11-46FE-AB7A-EAD9271862AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -106,6 +108,22 @@ Global
{E5DD4338-135A-4906-B67D-3EF2C44C96D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5DD4338-135A-4906-B67D-3EF2C44C96D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5DD4338-135A-4906-B67D-3EF2C44C96D9}.Release|Any CPU.Build.0 = Release|Any CPU
{335A8E39-FBCB-4B4E-BF83-6EBBBC1F0C45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{335A8E39-FBCB-4B4E-BF83-6EBBBC1F0C45}.Debug|Any CPU.Build.0 = Debug|Any CPU
{335A8E39-FBCB-4B4E-BF83-6EBBBC1F0C45}.Release|Any CPU.ActiveCfg = Release|Any CPU
{335A8E39-FBCB-4B4E-BF83-6EBBBC1F0C45}.Release|Any CPU.Build.0 = Release|Any CPU
{6AE8C9EA-87AF-49AC-A63B-9A9416DD76E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6AE8C9EA-87AF-49AC-A63B-9A9416DD76E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6AE8C9EA-87AF-49AC-A63B-9A9416DD76E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6AE8C9EA-87AF-49AC-A63B-9A9416DD76E0}.Release|Any CPU.Build.0 = Release|Any CPU
{E34A4BFA-1E92-4951-A5F9-B847EAAB05F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E34A4BFA-1E92-4951-A5F9-B847EAAB05F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E34A4BFA-1E92-4951-A5F9-B847EAAB05F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E34A4BFA-1E92-4951-A5F9-B847EAAB05F8}.Release|Any CPU.Build.0 = Release|Any CPU
{D2274F30-A001-482A-99E3-0AB1970CF695}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D2274F30-A001-482A-99E3-0AB1970CF695}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D2274F30-A001-482A-99E3-0AB1970CF695}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2274F30-A001-482A-99E3-0AB1970CF695}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 3 additions & 1 deletion Source/v2/Meadow.CLI/Meadow.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Meadow.CLI.Core\Meadow.CLI.Core.csproj" />
<ProjectReference Include="..\Meadow.Dfu\Meadow.Dfu.csproj" />
<ProjectReference Include="..\Meadow.Linker\Meadow.Linker.csproj" />
<ProjectReference Include="..\Meadow.Package\Meadow.Package.csproj" />
<ProjectReference Include="..\Meadow.UsbLibClassic\Meadow.UsbLibClassic.csproj" />
<ProjectReference Include="..\Meadow.UsbLib\Meadow.UsbLib.csproj" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions Source/v2/Meadow.Cli/AppManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Meadow.Hcom;
using Meadow.Package;
using Meadow.Software;
using Microsoft.Extensions.Logging;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using CliFx.Attributes;
using Meadow.Package;
using Microsoft.Extensions.Logging;

namespace Meadow.CLI.Commands.DeviceManagement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using CliFx.Attributes;

using Meadow.Package;
using Microsoft.Extensions.Logging;

namespace Meadow.CLI.Commands.DeviceManagement;
Expand Down
3 changes: 2 additions & 1 deletion Source/v2/Meadow.Cli/Commands/Current/App/AppRunCommand.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using CliFx.Attributes;
using Meadow.Hcom;
using Meadow.Package;
using Microsoft.Extensions.Logging;

namespace Meadow.CLI.Commands.DeviceManagement;
Expand Down Expand Up @@ -121,7 +122,7 @@ private async Task<bool> TrimApplication(string path, CancellationToken cancella
return true;
}

private async Task<bool> DeployApplication(IMeadowConnection connection, string path, CancellationToken cancellationToken)
private async Task<bool> DeployApplication(IMeadowConnection connection, string path, CancellationToken _)
{
connection.FileWriteProgress += OnFileWriteProgress;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using CliFx.Attributes;
using Meadow.Package;
using Microsoft.Extensions.Logging;

namespace Meadow.CLI.Commands.DeviceManagement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using CliFx.Attributes;
using Meadow.Cloud.Client;
using Meadow.Cloud.Client.Identity;
using Meadow.Package;
using Meadow.Software;
using Microsoft.Extensions.Logging;

Expand Down
3 changes: 2 additions & 1 deletion Source/v2/Meadow.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Meadow.CLI.Commands.DeviceManagement;
using Meadow.Cloud.Client;
using Meadow.Cloud.Client.Identity;
using Meadow.Package;
using Meadow.Software;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
Expand Down Expand Up @@ -61,7 +62,7 @@ public static async Task<int> Main(string[] args)
services.AddSingleton<PackageService>();
services.AddSingleton<ApiTokenService>();
services.AddSingleton<IdentityManager>();
services.AddSingleton<JsonDocumentBindingConverter>();
services.AddSingleton<JsonDocumentBindingConverter>();
services.AddSingleton<IMeadowCloudClient, MeadowCloudClient>();
services.AddSingleton(MeadowCloudUserAgent.Cli);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//using LibUsbDotNet.LibUsb;
using Meadow.Hcom;
using Meadow.Hcom;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using System.ComponentModel;
Expand Down
14 changes: 14 additions & 0 deletions Source/v2/Meadow.Dfu/Meadow.Dfu.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>10</LangVersion>
</PropertyGroup>
adrianstevens marked this conversation as resolved.
Show resolved Hide resolved

<ItemGroup>
<ProjectReference Include="..\Meadow.HCom\Meadow.HCom.csproj" />
</ItemGroup>

</Project>
22 changes: 22 additions & 0 deletions Source/v2/Meadow.Firmware/Meadow.Firmware.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>10</LangVersion>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Meadow.Dfu\Meadow.Dfu.csproj" />
<ProjectReference Include="..\Meadow.HCom\Meadow.HCom.csproj" />
<ProjectReference Include="..\Meadow.UsbLib.Core\Meadow.UsbLib.Core.csproj" />
<ProjectReference Include="..\Meadow.UsbLibClassic\Meadow.UsbLibClassic.csproj" />
<ProjectReference Include="..\Meadow.UsbLib\Meadow.UsbLib.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
</ItemGroup>

</Project>
66 changes: 66 additions & 0 deletions Source/v2/Meadow.HCom/ExtensionMethods.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
namespace Meadow;

/// <summary>
/// ExtensionMethods class
/// </summary>
public static class ExtensionMethods
{
/// <summary>
/// Contains static extention method to check if the pattern exists within the source
/// </summary>
/// <typeparam name="TSource"></typeparam>
/// <param name="source"></param>
/// <param name="pattern"></param>
/// <returns>true if the pattern exists</returns>
// TODO: move this into the `CircularBuffer` class? or is it broadly applicable?
public static bool Contains<TSource>(this IEnumerable<TSource> source, TSource[] pattern)
{
return (source.FirstIndexOf(pattern) != -1);
}

/// <summary>
/// FirstIndexOf static extention method for an IEnumerable
/// </summary>
/// <typeparam name="TSource"></typeparam>
/// <param name="source"></param>
/// <param name="pattern"></param>
/// <returns>the index position of the found pattern</returns>
// TODO: move this into the `CircularBuffer` class? or is it broadly applicable?
public static int FirstIndexOf<TSource>(this IEnumerable<TSource> source, TSource[] pattern)
{
if (pattern == null) throw new ArgumentNullException();

int patternLength = pattern.Length;
int totalLength = source.Count();
TSource firstMatch = pattern[0];

if (firstMatch == null) return -1;

for (int i = 0; i < totalLength; i++)
{
// is this the right equality?
if ((firstMatch.Equals(source.ElementAt(i))) // begin match?
&&
(totalLength - i >= patternLength) // can match exist?
)
{
TSource[] matchTest = new TSource[patternLength];
// copy the potential match into the matchTest array.
// can't use .Skip() and .Take() because it will actually
// enumerate over stuff and can have side effects
for (int x = 0; x < patternLength; x++)
{
matchTest[x] = source.ElementAt(i + x);
}
// if the pattern pulled from source matches our search pattern
// then the pattern exists.
if (matchTest.SequenceEqual(pattern))
{
return i;
}
}
}
// if we go here, doesn't exist
return -1;
}
}
14 changes: 7 additions & 7 deletions Source/v2/Meadow.HCom/Meadow.HCom.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>10</LangVersion>
<LangVersion>10</LangVersion>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\..\..\Meadow.Contracts\Source\Meadow.Contracts\CircularBuffer.cs" Link="CircularBuffer.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="System.IO.Ports" Version="7.0.0" />
<PackageReference Include="System.Text.Json" Version="7.0.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\..\Meadow.Contracts\Source\Meadow.Contracts\Meadow.Contracts.csproj" />
</ItemGroup>


</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private async Task ListenerProc()
throw new Exception("Data received for unknown file");
}

_readFileInfo.FileStream.Write(udp.FileData);
_readFileInfo.FileStream.Write(udp.FileData, 0, udp.FileData.Length);
adrianstevens marked this conversation as resolved.
Show resolved Hide resolved
}
else if (response is UploadCompletedResponse ucr)
{
Expand Down
48 changes: 0 additions & 48 deletions Source/v2/Meadow.Hcom/Firmware/PackageManager.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ internal class DeviceInfoSerialResponse : SerialResponse
internal DeviceInfoSerialResponse(byte[] data, int length)
: base(data, length)
{
var rawFields = RawText.Split('~', StringSplitOptions.RemoveEmptyEntries);
var rawFields = RawText.Split('~', (char)StringSplitOptions.RemoveEmptyEntries);
foreach (var f in rawFields)
{
var pair = f.Split('|', StringSplitOptions.RemoveEmptyEntries);
var pair = f.Split('|', (char)StringSplitOptions.RemoveEmptyEntries);

if ((pair.Length == 2) && !Fields.ContainsKey(pair[0]))
{
Expand Down
Loading
Loading