-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # Source/v2/Meadow.Cli/Commands/Current/BaseCommand.cs # Source/v2/Meadow.Cli/Commands/Current/BaseDeviceCommand.cs # Source/v2/Meadow.Hcom/Connections/ConnectionBase.cs # Source/v2/Meadow.Hcom/Connections/SerialConnection.cs # Source/v2/Meadow.Hcom/Connections/TcpConnection.cs # Source/v2/Meadow.Hcom/IMeadowConnection.cs # Source/v2/Meadow.Hcom/IMeadowDevice.cs # Source/v2/Meadow.Hcom/MeadowDevice.cs
- Loading branch information
Showing
58 changed files
with
901 additions
and
443 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
Source/v2/Meadow.Cli/Commands/Current/App/AppDebugCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using CliFx.Attributes; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Meadow.CLI.Commands.DeviceManagement; | ||
|
||
[Command("app debug", Description = "Debugs a running application")] | ||
public class AppDebugCommand : BaseDeviceCommand<AppDebugCommand> | ||
{ | ||
// VS 2019 - 4024 | ||
// VS 2017 - 4022 | ||
// VS 2015 - 4020 | ||
[CommandOption("Port", 'p', Description = "The port to run the debug server on")] | ||
public int Port { get; init; } = 4024; | ||
|
||
public AppDebugCommand(MeadowConnectionManager connectionManager, ILoggerFactory loggerFactory) | ||
: base(connectionManager, loggerFactory) | ||
{ | ||
} | ||
|
||
protected override async ValueTask ExecuteCommand() | ||
{ | ||
if (CurrentConnection != null) | ||
{ | ||
CurrentConnection.DeviceMessageReceived += (s, e) => | ||
{ | ||
Logger?.LogInformation(e.message); | ||
}; | ||
|
||
using (var server = await CurrentConnection.StartDebuggingSession(Port, Logger, CancellationToken)) | ||
{ | ||
if (Console != null) | ||
{ | ||
Logger?.LogInformation("Debugging server started. Press Enter to exit"); | ||
await Console.Input.ReadLineAsync(); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.