C#/.NET 10 class libraries that implement a Kermit-style serial file transfer stack for Windows and Linux.
Shared protocol and transport layer.
Includes:
- Kermit packet models
- protocol constants and negotiation options
- packet encoding/decoding
- block check support
- serial transport abstraction
- shared session base class
- common events and event args
- shared
NLoglogging setup
Client-side transfer library.
Includes:
- upload files to a remote server
- request files from a remote server
- list remote folders with
ls - get remote working directory with
pwd - change remote directory with
cd - remove remote files and directories with
rm - create remote directories with
mkdir - progress events
- per-command events for packet activity
Server-side transfer library.
Includes:
- receive files from a client
- send files to a client
- handle
get <file>generic command - handle
ls [folder]generic command - handle
pwdgeneric command - handle
cd <path>generic command - handle
rm <path>generic command - handle
mkdir <path>generic command - handle
delete <file>remote command - progress events
- per-command events for packet activity
- .NET 10 (
net10.0)
- Windows
- Linux
The transport uses System.IO.Ports, so matching serial device names must be used on each OS.
Examples:
- Windows:
COM1,COM2,COM3 - Linux:
/dev/ttyS0,/dev/ttyUSB0,/dev/ttyACM0
- serial port transport
- asynchronous packet processing
- full-duplex session loop
- shared protocol base for client and server
- typed events for major Kermit commands
- shared logging with
NLog - file upload and download flows
Implemented core packet flow:
SEND-INITFILEATTRDATAEOFBREAKACKNAKERROR- generic command packets
- remote command packets
Supported generic commands currently include:
get <file>lsls <folder>pwdcd <path>cd ..cd /rm <path>mkdir <path>
This repository currently provides a strong protocol foundation, but not every advanced Kermit feature is present yet.
Examples of future enhancements:
- long packets
- sliding windows larger than 1
- repeat-count compression
- fuller remote command set
- stricter interoperability with historical Kermit variants
KermitCommon configures NLog if no configuration already exists.
Client and server libraries reuse the same logging setup through the common project.
From the workspace root:
dotnet build Kermit.slnxSee:
var entries = await client.ListRemoteDirectoryAsync(".");
foreach (var entry in entries)
{
Console.WriteLine($"{(entry.IsDirectory ? "<DIR>" : "FILE ")} {entry.Name} {entry.Size}");
}var remotePath = await client.GetRemoteWorkingDirectoryAsync();
Console.WriteLine(remotePath);using KermitClient;
using KermitCommon;
var transport = new SerialPortTransport("COM2", 115200);
var client = new KermitClientSession(
transport,
new KermitClientOptions
{
DownloadDirectory = Path.Combine(Environment.CurrentDirectory, "downloads")
});
await client.OpenAsync();
await client.SendFileAsync(@"C:\temp\sample.txt");
await client.CloseAsync();
await client.DisposeAsync();using KermitCommon;
using KermitServer;
var transport = new SerialPortTransport("COM1", 115200);
var server = new KermitServerSession(
transport,
new KermitServerOptions
{
RootDirectory = Path.Combine(Environment.CurrentDirectory, "storage")
});
await server.OpenAsync();KermitCommon/KermitClient/KermitServer/clientused.mdserverused.md
The solution builds successfully and is ready for further protocol expansion, testing, and integration into applications that need serial Kermit transfers.