C#, .NET Standard based ham radio CAT/CIV control library.
Find a file
Erick Kinnee 2c83ce3791
Merge pull request #24 from ekinnee/copilot/fix-afb7dc88-de08-4e38-937f-79124626152a
Add SerialController with GET /api/serial/ports endpoint
2025-08-06 22:32:56 -05:00
.vscode Rename SharpCAT directory to Library and update all references 2025-08-07 00:09:27 +00:00
Client Add SharpCAT.Client library with full API implementation 2025-08-07 03:06:27 +00:00
Library Rename SharpCAT directory to Library and update all references 2025-08-07 00:09:27 +00:00
Server Add SerialController with GET /api/serial/ports endpoint 2025-08-07 03:17:42 +00:00
.editorconfig Add VS Code configuration and remove Visual Studio files 2025-08-06 21:31:09 +00:00
.gitattributes Add .gitignore and .gitattributes. 2019-03-06 08:41:49 -06:00
.gitignore Add VS Code configuration and remove Visual Studio files 2025-08-06 21:31:09 +00:00
LICENSE Create LICENSE 2019-03-08 10:01:22 -06:00
README.md Rename SharpCAT directory to Library and update all references 2025-08-07 00:09:27 +00:00
SharpCAT.sln Add SharpCAT.Client library with full API implementation 2025-08-07 03:06:27 +00:00

SharpCAT

SharpCAT is a C#/.NET cross-platform library and Web API server for CAT (Computer Aided Transceiver) radio control. It supports serial port CAT operations, modern async programming, and provides a REST API for remote radio control.


Features

  • Core Library: .NET Standard-based, works with .NET Core and .NET Framework
  • Cross-platform Server: ASP.NET Core Web API server, works on Windows, Linux, and macOS
  • REST API: Endpoints for serial port management and sending arbitrary CAT commands
  • Swagger/OpenAPI: Interactive API docs and testing interface
  • Async/Await: Modern async support for non-blocking IO
  • Extensible: Designed for adding radios and protocols (FT818, ID-4100A, TH-D74A, etc.)
  • Built-in Logging and Error Handling

Quick Start

Prerequisites

Running the Web API Server

cd Server/SharpCAT.Server
dotnet run

The server listens on http://localhost:5188 by default.
Open http://localhost:5188 in your browser for the Swagger UI.


Usage Examples

List Available Serial Ports

curl http://localhost:5188/api/cat/ports

Open a Serial Port

curl -X POST http://localhost:5188/api/cat/open \
  -H "Content-Type: application/json" \
  -d '{"portName": "COM3", "baudRate": 9600}'

Send a CAT Command

curl -X POST http://localhost:5188/api/cat/command \
  -H "Content-Type: application/json" \
  -d '{"command": "FA;"}'

Project Structure

Library/                # Core CAT library (cross-platform)
Server/SharpCAT.Server/  # ASP.NET Core Web API server

Development

Build Everything

dotnet build

Build Just the Core Library

dotnet build Library/Library.csproj

VS Code Tasks

This repo includes VS Code tasks for building, cleaning, restoring, publishing, and watching changes.


Roadmap & Ideas

  • Implement generic IRadio interface and radio-specific drivers
  • Support multiple concurrent radios
  • Fully async serial operations
  • Remote sharing of serial ports
  • Implement flrig protocol support
  • Potential AGWPE integration
  • Service/daemon operation support
  • Additional radio protocols (CAT, CI-V, etc.)

Why?

While Hamlib and HamLibSharp exist, there is a need for a modern, pure .NET CAT control library and server for direct integration with C# projects, without C++/PInvoke dependencies.


Contributing

Contributions are very welcome! Please open issues, submit PRs, or share your ideas.


License

This project follows the same license as the parent SharpCAT project.


Credits

  • Inspired by FT818, ID-4100A, TH-D74A, Yaesu FT991a, and others
  • Thanks to all open source contributors and radio amateurs for protocol documentation and ideas

If you wish to help, let me know or create a pull request. I'm not a pro developer, just a hobbyist building tools for myself and others.