Add project files.

master
Jonas Arnold 3 years ago
parent e48a14e4af
commit 4e9d806863
  1. 25
      ProtocolTests.sln
  2. 46
      SerialTestApp/Program.cs
  3. 14
      SerialTestApp/SerialTestApp.csproj

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33424.131
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SerialTestApp", "SerialTestApp\SerialTestApp.csproj", "{25FE0910-9C8A-44CA-BE72-5FED8CD92E2E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{25FE0910-9C8A-44CA-BE72-5FED8CD92E2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{25FE0910-9C8A-44CA-BE72-5FED8CD92E2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{25FE0910-9C8A-44CA-BE72-5FED8CD92E2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{25FE0910-9C8A-44CA-BE72-5FED8CD92E2E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C16A06F1-1290-45E0-8EF9-14A633A6D74D}
EndGlobalSection
EndGlobal

@ -0,0 +1,46 @@
using RJCP.IO.Ports;
using System.Collections.Generic;
namespace SerialTestApp;
internal class Program
{
public static bool QuitRequested { get; private set; }
static void Main(string[] args)
{
while (QuitRequested == false)
{
Console.WriteLine($"----- SERIAL PROTOCOL TEST APP -----");
Console.WriteLine($"Command list:");
Console.WriteLine($"l = list ports");
Console.WriteLine($"c = connect");
Console.WriteLine($"q = quit");
var key = Console.ReadKey();
switch (key.Key)
{
// list com ports
case ConsoleKey.L:
string[] ports = SerialPortStream.GetPortNames();
Console.WriteLine($"Following ports were found: {Environment.NewLine}");
foreach (var port in ports)
{
Console.WriteLine($"-- {port}");
}
break;
case ConsoleKey.Q:
QuitRequested = true;
break;
default:
Console.WriteLine($"{Environment.NewLine}Did not recognize key.. {Environment.NewLine}");
break;
}
}
}
}

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SerialPortStream" Version="2.4.1" />
</ItemGroup>
</Project>
Loading…
Cancel
Save