diff --git a/Source/v2/Meadow.Cli/Commands/Current/BaseDeviceCommand.cs b/Source/v2/Meadow.Cli/Commands/Current/BaseDeviceCommand.cs index b7ba3310..a94358c0 100644 --- a/Source/v2/Meadow.Cli/Commands/Current/BaseDeviceCommand.cs +++ b/Source/v2/Meadow.Cli/Commands/Current/BaseDeviceCommand.cs @@ -50,7 +50,7 @@ private async Task GetConnection(string? route, bool forceRec } catch (TimeoutException) { - throw new CommandException("Timeout attempting to attach to device on {connection?.Name}", CommandExitCode.ConnectionNotFound); + throw new CommandException($"Timeout attempting to attach to device on {connection?.Name}", CommandExitCode.ConnectionNotFound); } catch (Exception ex) { diff --git a/Source/v2/Meadow.Cli/Meadow.CLI.csproj b/Source/v2/Meadow.Cli/Meadow.CLI.csproj index 188117f2..7b371caf 100644 --- a/Source/v2/Meadow.Cli/Meadow.CLI.csproj +++ b/Source/v2/Meadow.Cli/Meadow.CLI.csproj @@ -10,7 +10,7 @@ Wilderness Labs, Inc Wilderness Labs, Inc true - 2.0.39.0 + 2.0.40.0 AnyCPU http://developer.wildernesslabs.co/Meadow/Meadow.CLI/ https://github.com/WildernessLabs/Meadow.CLI diff --git a/Source/v2/Meadow.Cli/Properties/AssemblyInfo.cs b/Source/v2/Meadow.Cli/Properties/AssemblyInfo.cs index 8e315dc4..b99631b1 100644 --- a/Source/v2/Meadow.Cli/Properties/AssemblyInfo.cs +++ b/Source/v2/Meadow.Cli/Properties/AssemblyInfo.cs @@ -6,5 +6,5 @@ namespace Meadow.CLI; public static class Constants { - public const string CLI_VERSION = "2.0.39.0"; + public const string CLI_VERSION = "2.0.40.0"; } \ No newline at end of file diff --git a/Source/v2/Meadow.Cloud.Client/Meadow.Cloud.Client.csproj b/Source/v2/Meadow.Cloud.Client/Meadow.Cloud.Client.csproj index a113572c..8418bc3a 100644 --- a/Source/v2/Meadow.Cloud.Client/Meadow.Cloud.Client.csproj +++ b/Source/v2/Meadow.Cloud.Client/Meadow.Cloud.Client.csproj @@ -7,6 +7,11 @@ 10 + + true + ..\MeadowCLIKey.snk + + diff --git a/Source/v2/Meadow.Hcom/AssemblyAttributes.cs b/Source/v2/Meadow.Hcom/AssemblyAttributes.cs index 393a02e2..4677a896 100644 --- a/Source/v2/Meadow.Hcom/AssemblyAttributes.cs +++ b/Source/v2/Meadow.Hcom/AssemblyAttributes.cs @@ -1,3 +1,8 @@ using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("Meadow.HCom.Integration.Tests")] \ No newline at end of file +[assembly: InternalsVisibleTo("Meadow.HCom.Integration.Tests,PublicKey=" + +"0024000004800000940000000602000000240000525341310004000001000100792a27a41cf42a" + +"09ac6bb433f2602ac886175eed60cc74ae70adbdc8237b510ae474981420f1d0395ad58cfd459b" + +"6c6ecbe28ec7234761cfe5acadcf7b76e273b25a3547826e16658a474a8e34ec297778130a1781" + +"95a2034e7b1ec591177ce1e87160682d5f8b49d3c63a92aafa9c7f7f5b06763d7a19d96b781099" + +"a39e35d1")] \ No newline at end of file diff --git a/Source/v2/Meadow.Hcom/Connections/SerialConnection.ListenerProc.cs b/Source/v2/Meadow.Hcom/Connections/SerialConnection.ListenerProc.cs index 90fa287d..0f5a8b65 100644 --- a/Source/v2/Meadow.Hcom/Connections/SerialConnection.ListenerProc.cs +++ b/Source/v2/Meadow.Hcom/Connections/SerialConnection.ListenerProc.cs @@ -193,7 +193,7 @@ private async Task ListenerProc() if (_reconnectInProgress) { - _state = ConnectionState.MeadowAttached; + Open(); _reconnectInProgress = false; } else if (_textListComplete != null) @@ -213,18 +213,11 @@ private async Task ListenerProc() else if (response is ReconnectRequiredResponse rrr) { // the device is going to restart - we need to wait for a HCOM_HOST_REQUEST_TEXT_CONCLUDED to know it's back - _state = ConnectionState.Disconnected; - _reconnectInProgress = true; + Close(); - if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - { - if (_port.IsOpen) - { - _port.Close(); - Thread.Sleep(2000); - _port.Open(); - } - } + await Task.Delay(3000); + + Open(); } else if (response is FileReadInitOkResponse fri) { diff --git a/Source/v2/Meadow.Hcom/Connections/SerialConnection.cs b/Source/v2/Meadow.Hcom/Connections/SerialConnection.cs index d99dd0f8..baf0fcb3 100755 --- a/Source/v2/Meadow.Hcom/Connections/SerialConnection.cs +++ b/Source/v2/Meadow.Hcom/Connections/SerialConnection.cs @@ -1230,8 +1230,7 @@ public override async Task StartDebuggingSession(int port, ILog logger?.LogDebug($"Start Debugging on port: {port}"); await Device.StartDebugging(port, logger, cancellationToken); - /* TODO logger?.LogDebug("Reinitialize the device"); - await ReInitializeMeadow(cancellationToken); */ + await WaitForMeadowAttach(cancellationToken); var endpoint = new IPEndPoint(IPAddress.Loopback, port); var debuggingServer = new DebuggingServer(this, Device, endpoint, logger); diff --git a/Source/v2/Meadow.Hcom/Debugging/DebuggingServer.cs b/Source/v2/Meadow.Hcom/Debugging/DebuggingServer.cs index 34b03a7c..997caecc 100644 --- a/Source/v2/Meadow.Hcom/Debugging/DebuggingServer.cs +++ b/Source/v2/Meadow.Hcom/Debugging/DebuggingServer.cs @@ -1,4 +1,5 @@ -using System.Buffers; +using Microsoft.Extensions.Logging; +using System.Buffers; using System.Collections.Concurrent; using System.Net; using System.Net.Sockets; @@ -192,7 +193,13 @@ internal ActiveClient(IMeadowConnection connection, TcpClient tcpClient, ILogger _receiveVsDebugDataTask = Task.Factory.StartNew(SendToMeadowAsync, TaskCreationOptions.LongRunning); _receiveMeadowDebugDataTask = Task.Factory.StartNew(SendToVisualStudio, TaskCreationOptions.LongRunning); - _connection.DebuggerMessageReceived += (s, e) => _debuggerMessages.Add(e); + _connection.DebuggerMessageReceived += MeadowConnection_DebuggerMessageReceived; + } + + private void MeadowConnection_DebuggerMessageReceived(object sender, byte[] e) + { + _logger?.LogDebug("Debugger Message Received, Adding to collection"); + _debuggerMessages.Add(e); } private const int RECEIVE_BUFFER_SIZE = 256; @@ -330,6 +337,11 @@ public void Dispose() _tcpClient.Dispose(); _networkStream.Dispose(); _cts.Dispose(); + + if (_connection != null) + { + _connection.DebuggerMessageReceived -= MeadowConnection_DebuggerMessageReceived; + } Disposed = true; } } diff --git a/Source/v2/Meadow.Hcom/Meadow.HCom.csproj b/Source/v2/Meadow.Hcom/Meadow.HCom.csproj index 92152ab6..6c0525fa 100644 --- a/Source/v2/Meadow.Hcom/Meadow.HCom.csproj +++ b/Source/v2/Meadow.Hcom/Meadow.HCom.csproj @@ -6,6 +6,11 @@ 10 + + true + ..\MeadowCLIKey.snk + + diff --git a/Source/v2/Meadow.Linker/Meadow.Linker.csproj b/Source/v2/Meadow.Linker/Meadow.Linker.csproj index f94cfcd1..e7006ab6 100644 --- a/Source/v2/Meadow.Linker/Meadow.Linker.csproj +++ b/Source/v2/Meadow.Linker/Meadow.Linker.csproj @@ -6,6 +6,11 @@ 10 + + true + ..\MeadowCLIKey.snk + + diff --git a/Source/v2/Meadow.SoftwareManager/AssemblyInfo.cs b/Source/v2/Meadow.SoftwareManager/AssemblyInfo.cs index 95414c89..e4a22f68 100644 --- a/Source/v2/Meadow.SoftwareManager/AssemblyInfo.cs +++ b/Source/v2/Meadow.SoftwareManager/AssemblyInfo.cs @@ -1,2 +1,13 @@ -[assembly: InternalsVisibleTo("Meadow.SoftwareManager.Unit.Tests")] -[assembly: InternalsVisibleTo("Meadow.SoftwareManager.Integration.Tests")] +[assembly: InternalsVisibleTo("Meadow.SoftwareManager.Unit.Tests,PublicKey=" + +"0024000004800000940000000602000000240000525341310004000001000100792a27a41cf42a" + +"09ac6bb433f2602ac886175eed60cc74ae70adbdc8237b510ae474981420f1d0395ad58cfd459b" + +"6c6ecbe28ec7234761cfe5acadcf7b76e273b25a3547826e16658a474a8e34ec297778130a1781" + +"95a2034e7b1ec591177ce1e87160682d5f8b49d3c63a92aafa9c7f7f5b06763d7a19d96b781099" + +"a39e35d1")] + +[assembly: InternalsVisibleTo("Meadow.SoftwareManager.Integration.Tests,PublicKey=" + +"0024000004800000940000000602000000240000525341310004000001000100792a27a41cf42a" + +"09ac6bb433f2602ac886175eed60cc74ae70adbdc8237b510ae474981420f1d0395ad58cfd459b" + +"6c6ecbe28ec7234761cfe5acadcf7b76e273b25a3547826e16658a474a8e34ec297778130a1781" + +"95a2034e7b1ec591177ce1e87160682d5f8b49d3c63a92aafa9c7f7f5b06763d7a19d96b781099" + +"a39e35d1")] \ No newline at end of file diff --git a/Source/v2/Meadow.SoftwareManager/F7FirmwarePackageCollection.cs b/Source/v2/Meadow.SoftwareManager/F7FirmwarePackageCollection.cs index e3be5db9..bbc764ea 100644 --- a/Source/v2/Meadow.SoftwareManager/F7FirmwarePackageCollection.cs +++ b/Source/v2/Meadow.SoftwareManager/F7FirmwarePackageCollection.cs @@ -31,7 +31,7 @@ internal F7FirmwarePackageCollection(IMeadowCloudClient meadowCloudClient) { } - internal F7FirmwarePackageCollection(string rootPath, IMeadowCloudClient meadowCloudClient) + public F7FirmwarePackageCollection(string rootPath, IMeadowCloudClient meadowCloudClient) { _downloadManager = new F7FirmwareDownloadManager(meadowCloudClient); diff --git a/Source/v2/Meadow.SoftwareManager/Meadow.SoftwareManager.csproj b/Source/v2/Meadow.SoftwareManager/Meadow.SoftwareManager.csproj index 42031aa0..daf3e2ec 100644 --- a/Source/v2/Meadow.SoftwareManager/Meadow.SoftwareManager.csproj +++ b/Source/v2/Meadow.SoftwareManager/Meadow.SoftwareManager.csproj @@ -6,6 +6,11 @@ 10 + + true + ..\MeadowCLIKey.snk + + diff --git a/Source/v2/Meadow.Tooling.Core/App/AppManager.cs b/Source/v2/Meadow.Tooling.Core/App/AppManager.cs index a8138c26..bb45beb0 100644 --- a/Source/v2/Meadow.Tooling.Core/App/AppManager.cs +++ b/Source/v2/Meadow.Tooling.Core/App/AppManager.cs @@ -172,7 +172,14 @@ public static async Task DeployApplication( static string GetRelativePath(string relativeTo, string path) { // Determine the difference - var relativePath = path.Substring(relativeTo.Length + 1); + var relativePath = path.Substring(relativeTo.Length); + //remove leading slash + if (relativePath.StartsWith(Path.DirectorySeparatorChar.ToString()) || + relativePath.StartsWith("/") || + relativePath.StartsWith("\\")) + { + relativePath = relativePath.Substring(1); + } return relativePath; } } \ No newline at end of file diff --git a/Source/v2/Meadow.Tooling.Core/Meadow.Tooling.Core.csproj b/Source/v2/Meadow.Tooling.Core/Meadow.Tooling.Core.csproj index b8a06474..a7ccf4dd 100644 --- a/Source/v2/Meadow.Tooling.Core/Meadow.Tooling.Core.csproj +++ b/Source/v2/Meadow.Tooling.Core/Meadow.Tooling.Core.csproj @@ -6,6 +6,11 @@ 10 + + true + ..\MeadowCLIKey.snk + + diff --git a/Source/v2/MeadowCLIKey.snk b/Source/v2/MeadowCLIKey.snk new file mode 100644 index 00000000..fea5c270 Binary files /dev/null and b/Source/v2/MeadowCLIKey.snk differ diff --git a/Source/v2/Tests/Meadow.SoftwareManager.Integration.Tests/Meadow.SoftwareManager.Integration.Tests.csproj b/Source/v2/Tests/Meadow.SoftwareManager.Integration.Tests/Meadow.SoftwareManager.Integration.Tests.csproj index 1487cdea..24c0ff0f 100644 --- a/Source/v2/Tests/Meadow.SoftwareManager.Integration.Tests/Meadow.SoftwareManager.Integration.Tests.csproj +++ b/Source/v2/Tests/Meadow.SoftwareManager.Integration.Tests/Meadow.SoftwareManager.Integration.Tests.csproj @@ -8,6 +8,11 @@ false + + true + ..\..\MeadowCLIKey.snk + + diff --git a/Source/v2/Tests/Meadow.SoftwareManager.Unit.Tests/Meadow.SoftwareManager.Unit.Tests.csproj b/Source/v2/Tests/Meadow.SoftwareManager.Unit.Tests/Meadow.SoftwareManager.Unit.Tests.csproj index 8658c8da..9d86d80e 100644 --- a/Source/v2/Tests/Meadow.SoftwareManager.Unit.Tests/Meadow.SoftwareManager.Unit.Tests.csproj +++ b/Source/v2/Tests/Meadow.SoftwareManager.Unit.Tests/Meadow.SoftwareManager.Unit.Tests.csproj @@ -8,6 +8,11 @@ false + + true + ..\..\MeadowCLIKey.snk + +