2019-03-06 15:57:01 +01:00
# SharpCAT
2019-03-06 16:14:08 +01:00
2025-08-07 01:58:44 +02:00
**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**
2019-03-06 15:57:01 +01:00
2025-08-07 01:58:44 +02:00
---
2025-08-07 01:26:53 +02:00
2025-08-07 01:58:44 +02:00
## Quick Start
2025-08-07 01:26:53 +02:00
2025-08-07 01:58:44 +02:00
### Prerequisites
- [.NET 8.0 SDK ](https://dotnet.microsoft.com/download ) or later
2025-08-07 01:26:53 +02:00
2025-08-07 01:58:44 +02:00
### Running the Web API Server
2025-08-07 01:26:53 +02:00
```bash
cd Server/SharpCAT.Server
dotnet run
```
2025-08-07 01:58:44 +02:00
The server listens on `http://localhost:5188` by default.
Open [http://localhost:5188 ](http://localhost:5188 ) in your browser for the Swagger UI.
2025-08-07 01:26:53 +02:00
2025-08-07 01:58:44 +02:00
---
2025-08-06 23:31:09 +02:00
2025-08-07 01:58:44 +02:00
## Usage Examples
2025-08-06 23:31:09 +02:00
2025-08-07 01:58:44 +02:00
### List Available Serial Ports
2025-08-06 23:31:09 +02:00
2025-08-07 01:26:53 +02:00
```bash
2025-08-07 01:58:44 +02:00
curl http://localhost:5188/api/cat/ports
2025-08-07 01:26:53 +02:00
```
2025-08-07 01:58:44 +02:00
### Open a Serial Port
2025-08-07 01:26:53 +02:00
```bash
2025-08-07 01:58:44 +02:00
curl -X POST http://localhost:5188/api/cat/open \
-H "Content-Type: application/json" \
-d '{"portName": "COM3", "baudRate": 9600}'
2025-08-07 01:26:53 +02:00
```
2025-08-07 01:58:44 +02:00
### Send a CAT Command
2025-08-06 23:31:09 +02:00
```bash
2025-08-07 01:58:44 +02:00
curl -X POST http://localhost:5188/api/cat/command \
-H "Content-Type: application/json" \
-d '{"command": "FA;"}'
2025-08-06 23:31:09 +02:00
```
2025-08-07 01:58:44 +02:00
---
## Project Structure
```
2025-08-07 02:09:27 +02:00
Library/ # Core CAT library (cross-platform)
2025-08-07 01:58:44 +02:00
Server/SharpCAT.Server/ # ASP.NET Core Web API server
2025-08-06 23:31:09 +02:00
```
2025-08-07 01:58:44 +02:00
---
## Development
### Build Everything
2025-08-06 23:31:09 +02:00
```bash
2025-08-07 01:58:44 +02:00
dotnet build
2025-08-06 23:31:09 +02:00
```
2025-08-07 01:58:44 +02:00
### Build Just the Core Library
```bash
2025-08-07 02:09:27 +02:00
dotnet build Library/Library.csproj
2025-08-07 01:58:44 +02:00
```
2025-08-06 23:31:09 +02:00
2025-08-07 01:58:44 +02:00
### VS Code Tasks
2019-03-06 15:57:01 +01:00
2025-08-07 01:58:44 +02:00
This repo includes VS Code tasks for building, cleaning, restoring, publishing, and watching changes.
2019-03-07 14:49:12 +01:00
2025-08-07 01:58:44 +02:00
---
2019-03-06 16:12:40 +01:00
2025-08-07 01:58:44 +02:00
## Roadmap & Ideas
2019-03-06 16:14:08 +01:00
2025-08-07 01:58:44 +02:00
- 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.)
2019-03-06 16:14:08 +01:00
2025-08-07 01:58:44 +02:00
---
2019-03-06 16:14:08 +01:00
2025-08-07 01:58:44 +02:00
## Why?
2019-03-06 16:14:08 +01:00
2025-08-07 01:58:44 +02:00
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.
2019-03-07 01:50:26 +01:00
2025-08-07 01:58:44 +02:00
---
2019-03-12 18:19:32 +01:00
2025-08-07 01:58:44 +02:00
## Contributing
2019-03-12 18:19:32 +01:00
2025-08-07 01:58:44 +02:00
Contributions are very welcome! Please open issues, submit PRs, or share your ideas.
2019-03-07 14:30:44 +01:00
2025-08-07 01:58:44 +02:00
---
2019-03-07 14:30:44 +01:00
2025-08-07 01:58:44 +02:00
## License
2019-03-07 14:30:44 +01:00
2025-08-07 01:58:44 +02:00
This project follows the same license as the parent SharpCAT project.
2019-03-07 14:30:44 +01:00
2025-08-07 01:58:44 +02:00
---
2019-03-07 14:30:44 +01:00
2025-08-07 01:58:44 +02:00
## Credits
2019-03-12 18:19:32 +01:00
2025-08-07 01:58:44 +02:00
- 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
2019-08-14 01:27:10 +02:00
2025-08-07 01:58:44 +02:00
---
2019-03-12 18:19:32 +01:00
2025-08-07 01:58:44 +02:00
*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.*