Skip to content

Commit

Permalink
Merge pull request #583 from WildernessLabs/version_bump
Browse files Browse the repository at this point in the history
Add listener proc exception catch + minor cleanup + version bump
  • Loading branch information
ctacke authored Jul 3, 2024
2 parents 42a6ff4 + 29057a0 commit ce9b1ff
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Source/v2/Meadow.Cli/Meadow.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Authors>Wilderness Labs, Inc</Authors>
<Company>Wilderness Labs, Inc</Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageVersion>2.0.51.0</PackageVersion>
<PackageVersion>2.0.52.0</PackageVersion>
<Platforms>AnyCPU</Platforms>
<PackageProjectUrl>http://developer.wildernesslabs.co/Meadow/Meadow.CLI/</PackageProjectUrl>
<RepositoryUrl>https://github.com/WildernessLabs/Meadow.CLI</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion Source/v2/Meadow.Cli/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ namespace Meadow.CLI;

public static class Constants
{
public const string CLI_VERSION = "2.0.51.0";
public const string CLI_VERSION = "2.0.52.0";
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;

namespace Meadow.Hcom
namespace Meadow.Hcom
{
public partial class SerialConnection
{
Expand Down Expand Up @@ -94,6 +92,11 @@ private async Task ListenerProc()
}
goto read;
}
catch (Exception ex)
{
Debug.WriteLine($"Error reading from port: {ex.Message}");
await Task.Delay(1000);
}

Debug.WriteLine($"Received {receivedLength} bytes");

Expand Down Expand Up @@ -315,7 +318,6 @@ private async Task ListenerProc()
}
catch (IOException ioe)
{

FileException?.Invoke(this, ioe);
// attempt to read timed out (i.e. there's just no data)
// NOP
Expand Down
4 changes: 3 additions & 1 deletion Source/v2/Meadow.Hcom/Connections/SerialConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1284,13 +1284,15 @@ public override async Task StartDebugging(int port, ILogger? logger, Cancellatio
}
}

public override async Task SendDebuggerData(byte[] debuggerData, uint userData, CancellationToken? cancellationToken)
public override Task SendDebuggerData(byte[] debuggerData, uint userData, CancellationToken? cancellationToken)
{
var command = RequestBuilder.Build<DebuggerDataRequest>(userData);
command.DebuggerData = debuggerData;

_lastRequestConcluded = null;

EnqueueRequest(command);

return Task.CompletedTask;
}
}
2 changes: 1 addition & 1 deletion Source/v2/Meadow.Hcom/Debugging/DebuggingServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public async Task StartListening(CancellationToken cancellationToken)
_listener.Start();
_logger?.LogInformation($"Listening for Visual Studio to connect");

// This call will wait for the client to connect, before continuing. We shouldn't need a loop.
// This call will wait for the client to connect, before continuing.
var tcpClient = await _listener.AcceptTcpClientAsync();
_activeClient = CreateActiveClient(tcpClient);
}
Expand Down

0 comments on commit ce9b1ff

Please sign in to comment.