diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..1b1d40e --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,57 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${workspaceFolder}/bin/Debug//.dll", + "args": [], + "cwd": "${workspaceFolder}", + "console": "internalConsole", + "stopAtEntry": false, + "internalConsoleOptions": "openOnSessionStart" + }, + { + "name": ".NET Core Launch (web)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${workspaceFolder}/bin/Debug//.dll", + "args": [], + "cwd": "${workspaceFolder}", + "stopAtEntry": false, + "internalConsoleOptions": "openOnSessionStart", + "launchBrowser": { + "enabled": true, + "args": "${auto-detect-url}", + "windows": { + "command": "cmd.exe", + "args": "/C start ${auto-detect-url}" + }, + "osx": { + "command": "open" + }, + "linux": { + "command": "xdg-open" + } + }, + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "sourceFileMap": { + "/Views": "${workspaceFolder}/Views" + } + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..a914fef --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,17 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet build", + "type": "shell", + "group": "build", + "presentation": { + "reveal": "silent" + }, + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/Docs/Radios/Yaesu/FT818/Yaesu-FT-818nd-manual-FT818.pdf b/Docs/Radios/Yaesu/FT818/Yaesu-FT-818nd-manual-FT818.pdf new file mode 100644 index 0000000..56ac168 Binary files /dev/null and b/Docs/Radios/Yaesu/FT818/Yaesu-FT-818nd-manual-FT818.pdf differ diff --git a/Serial.cs b/Serial.cs new file mode 100644 index 0000000..47bda93 --- /dev/null +++ b/Serial.cs @@ -0,0 +1,90 @@ +using System; +using System.IO.Ports; +using System.Threading; + +namespace SharpCAT +{ + public class Serial + { + private SerialPort _serialPort; + + public string[] PortNames { get => SerialPort.GetPortNames(); } + public static int[] BaudRates { get; } = new int[] { 1200, 4800, 9600, 19200, 38400 }; + + public static int[] DataBits { get; } = new int[] { 7, 8 }; + + public enum Parity + { + Even = System.IO.Ports.Parity.Even, + Mark = System.IO.Ports.Parity.Mark, + None = System.IO.Ports.Parity.None, + Odd = System.IO.Ports.Parity.Odd, + Space = System.IO.Ports.Parity.Space + } + + public enum StopBits + { + None = System.IO.Ports.StopBits.None, + One = System.IO.Ports.StopBits.One, + OnePointFive = System.IO.Ports.StopBits.OnePointFive, + Two = System.IO.Ports.StopBits.Two + } + + public enum Handshake + { + None = System.IO.Ports.Handshake.None, + RequestToSend = System.IO.Ports.Handshake.RequestToSend, + RequestToSendXOnXOff = System.IO.Ports.Handshake.RequestToSendXOnXOff, + XOnXOff = System.IO.Ports.Handshake.XOnXOff + } + + public Serial(string portname, int baudrate, Parity parity, StopBits bits, Handshake handshake) + { + _serialPort = new SerialPort + { + ReadTimeout = 500, + WriteTimeout = 500, + PortName = portname, + BaudRate = baudrate, + Parity = (System.IO.Ports.Parity)parity, + StopBits = (System.IO.Ports.StopBits)bits, + Handshake = (System.IO.Ports.Handshake)handshake + }; + + _serialPort.DataReceived += new SerialDataReceivedEventHandler(SerialDataReceived); + _serialPort.ErrorReceived += new SerialErrorReceivedEventHandler(SerialErrorReceived); + + } + + private void SerialErrorReceived(object sender, SerialErrorReceivedEventArgs e) + { + + } + + private void SerialDataReceived(object sender, SerialDataReceivedEventArgs e) + { + + } + + public void Read() + { + + try + { + string message = _serialPort.ReadLine(); + //Console.WriteLine(message); + } + catch (TimeoutException) { } + } + + public void GetRXStatus() + { + + } + + public void GetFreqAndMode() + { + + } + } +} \ No newline at end of file diff --git a/SharpCAT.cs b/SharpCAT.cs new file mode 100644 index 0000000..df60149 --- /dev/null +++ b/SharpCAT.cs @@ -0,0 +1,15 @@ +namespace SharpCAT +{ + public class SharpCAT + { + private string CatCmdStr { get; set; } + + private Serial _serial; + + public SharpCAT() + { + //_serial = new Serial(); + + } + } +} \ No newline at end of file diff --git a/SharpCAT.csproj b/SharpCAT.csproj new file mode 100644 index 0000000..ef38117 --- /dev/null +++ b/SharpCAT.csproj @@ -0,0 +1,20 @@ + + + + netstandard2.0 + + + + + + + + + MSBuild:Compile + + + MSBuild:Compile + + + + diff --git a/SharpCAT.sln b/SharpCAT.sln new file mode 100644 index 0000000..082ccd9 --- /dev/null +++ b/SharpCAT.sln @@ -0,0 +1,47 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.421 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpCAT", "SharpCAT.csproj", "{C3A9288A-CE33-46F7-83EA-9534B8DC4A31}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{3C050B74-ACBA-427C-B3F4-069D6E23BD67}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Radios", "Radios", "{7D1D7F1D-8AC1-4309-BBFB-D8B12363A347}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Yaesu", "Yaesu", "{4B0F6F9A-A9EB-45D9-B70F-AD49D0C6AD5F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FT818", "FT818", "{9657A3C4-B6F9-4E2D-A65E-DAE55A6DBEF2}" + ProjectSection(SolutionItems) = preProject + Docs\Radios\Yaesu\FT818\Yaesu-FT-818nd-manual-FT818.pdf = Docs\Radios\Yaesu\FT818\Yaesu-FT-818nd-manual-FT818.pdf + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpCATForms", "..\SharpCATForms\SharpCATForms.csproj", "{3483B368-338A-4BE3-AEB9-460E374B2C99}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C3A9288A-CE33-46F7-83EA-9534B8DC4A31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C3A9288A-CE33-46F7-83EA-9534B8DC4A31}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C3A9288A-CE33-46F7-83EA-9534B8DC4A31}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C3A9288A-CE33-46F7-83EA-9534B8DC4A31}.Release|Any CPU.Build.0 = Release|Any CPU + {3483B368-338A-4BE3-AEB9-460E374B2C99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3483B368-338A-4BE3-AEB9-460E374B2C99}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3483B368-338A-4BE3-AEB9-460E374B2C99}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3483B368-338A-4BE3-AEB9-460E374B2C99}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {7D1D7F1D-8AC1-4309-BBFB-D8B12363A347} = {3C050B74-ACBA-427C-B3F4-069D6E23BD67} + {4B0F6F9A-A9EB-45D9-B70F-AD49D0C6AD5F} = {7D1D7F1D-8AC1-4309-BBFB-D8B12363A347} + {9657A3C4-B6F9-4E2D-A65E-DAE55A6DBEF2} = {4B0F6F9A-A9EB-45D9-B70F-AD49D0C6AD5F} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4BF99AE0-6109-48CE-955C-F4F31BA0D9BA} + EndGlobalSection +EndGlobal diff --git a/Yaesu FT818.cs b/Yaesu FT818.cs new file mode 100644 index 0000000..eead5fc --- /dev/null +++ b/Yaesu FT818.cs @@ -0,0 +1,79 @@ +namespace SharpCAT.Yaesu +{ + internal class FT818 + { + public struct LOCK + { + private static readonly string ON = "00"; + private static readonly string OFF = "80"; + } + + public struct PTT + { + private static readonly string ON = "08"; + private static readonly string OFF = "88"; + } + + public struct CLAR + { + private static readonly string ON = "05"; + private static readonly string OFF = "85"; + } + + public struct SPLIT + { + private static readonly string ON = "02"; + private static readonly string OFF = "82"; + } + + public struct POWER + { + private static readonly string ON = "0F"; + private static readonly string OFF = "8F"; + } + + public struct OpModes + { + private static readonly string LSB = "00"; + private static readonly string USB = "01"; + private static readonly string CW = "02"; + private static readonly string CWR = "03"; + private static readonly string AM = "04"; + private static readonly string FM = "08"; + private static readonly string DIG = "0A"; + private static readonly string PKT = "0C"; + } + + public void SetLock() + { + } + + public void SetPTT() + { + } + + public void SetCLAR() + { + } + + public void SetSPLIT() + { + } + + public void SetPOWER() + { + } + + public void SetFreq(double freq) + { + } + + public void SetOpMode(string opmode) + { + } + + public void SetVFO() + { + } + } +} \ No newline at end of file