# manawyrm/sdrsharp-plutosdr architecture

> Architecture diagram of the GitHub repository manawyrm/sdrsharp-plutosdr, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manawyrm/sdrsharp-plutosdr
- Repository: https://github.com/manawyrm/sdrsharp-plutosdr

## Overview

##### Project type and purpose
- This is a .NET-based plugin (driver) for the SDRSharp (SDR#) host application.
- Its purpose is to enable communication and control of the Analog Devices ADALM-PlutoSDR hardware from within SDR#.

##### File structure
- Top-level:
- SDRSharp.PlutoSDR.sln (Visual Studio solution)
- SDRSharp.PlutoSDR.csproj (plugin project)
- PlutoSDR/ – C# source files for the plugin
– PlutoSDRDevice.cs (core device logic implementing the SDR# plugin interface)
– PlutoSDRIO.cs (entry point to register with SDR#)
– IIOHelper.cs (helper functions for libiio-based I/O)
– NativeMethods.cs (PInvoke declarations for the libiio DLL)
– PlutoSDRControllerDialog.* (Windows Forms dialog UI to configure device)
- Configuration/deployment:
- FrontEnds.xml (in SDR# installation directory; modified to register this plugin)
- Native “libiio” DLLs loaded via PInvoke

##### README for additional insights
- Confirms it is an SDR# front-end plugin.
- Installation involves:
1. Installing Windows USB drivers for PlutoSDR
2. Copying plugin assembly and native DLLs into SDR# directory
3. Editing FrontEnds.xml to add a plugin entry
- Relies on the SDR# plugin system and the ADALM-PlutoSDR firmware + libiio library

##### Summary: Capture every architectural element
- Host–plugin boundary
- Plugin’s internal layered structure
- Native vs. managed code interactions
- Configuration registration point
- Hardware I/O path

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Configuration
    FrontEnds["FrontEnds.xml"]:::config
    Registration["Registration.txt"]:::config
    README["README.md"]:::config

    %% Host Application
    subgraph "SDR# Host Application"
        Host["SDR# Host"]:::host
        PluginLoader["Plugin Loader"]:::host
    end

    %% Plugin Solution & Project
    Solution["SDRSharp.PlutoSDR.sln"]:::managed
    ProjectFile["SDRSharp.PlutoSDR.csproj"]:::managed

    %% Plugin Managed Code
    subgraph "PlutoSDR Plugin (Managed Code)"
        entry["PlutoSDRIO"]:::managed
        device["PlutoSDRDevice"]:::managed
        assembly["Properties/AssemblyInfo.cs"]:::managed

        subgraph "UI Layer"
            dialogLogic["PlutoSDRControllerDialog.cs"]:::managed
            dialogDesigner["PlutoSDRControllerDialog.Designer.cs"]:::managed
            dialogResx["PlutoSDRControllerDialog.resx"]:::managed
        end

        helper["IIOHelper.cs"]:::managed
        nativeMethods["NativeMethods.cs"]:::managed
    end

    %% Native Library
    libiio["libiio.dll"]:::native

    %% External Hardware
    usb["USB Driver"]:::external
    hardware["PlutoSDR Hardware"]:::external

    %% Relationships
    FrontEnds -->|discovers plugin| PluginLoader
    Registration -->|instructions| FrontEnds
    PluginLoader -->|loads assembly| Solution
    Solution --> ProjectFile
    ProjectFile --> entry
    entry --> device
    device --> helper
    helper --> nativeMethods
    nativeMethods --> libiio
    libiio --> hardware
    hardware --> libiio
    libiio --> nativeMethods
    nativeMethods --> device
    device -->|streams I/Q samples| Host

    Host -->|invoke UI| dialogLogic
    dialogLogic --> device

    %% Click Events
    click Solution "https://github.com/manawyrm/sdrsharp-plutosdr/blob/master/SDRSharp.PlutoSDR.sln"
    click ProjectFile "https://github.com/manawyrm/sdrsharp-plutosdr/blob/master/PlutoSDR/SDRSharp.PlutoSDR.csproj"
    click entry "https://github.com/manawyrm/sdrsharp-plutosdr/blob/master/PlutoSDR/PlutoSDRIO.cs"
    click device "https://github.com/manawyrm/sdrsharp-plutosdr/blob/master/PlutoSDR/PlutoSDRDevice.cs"
    click dialogLogic "https://github.com/manawyrm/sdrsharp-plutosdr/blob/master/PlutoSDR/PlutoSDRControllerDialog.cs"
    click dialogDesigner "https://github.com/manawyrm/sdrsharp-plutosdr/blob/master/PlutoSDR/PlutoSDRControllerDialog.Designer.cs"
    click dialogResx "https://github.com/manawyrm/sdrsharp-plutosdr/blob/master/PlutoSDR/PlutoSDRControllerDialog.resx"
    click helper "https://github.com/manawyrm/sdrsharp-plutosdr/blob/master/PlutoSDR/IIOHelper.cs"
    click nativeMethods "https://github.com/manawyrm/sdrsharp-plutosdr/blob/master/PlutoSDR/NativeMethods.cs"
    click assembly "https://github.com/manawyrm/sdrsharp-plutosdr/blob/master/PlutoSDR/Properties/AssemblyInfo.cs"
    click Registration "https://github.com/manawyrm/sdrsharp-plutosdr/blob/master/PlutoSDR/Registration.txt"
    click README "https://github.com/manawyrm/sdrsharp-plutosdr/blob/master/README.md"

    %% Styles
    classDef host fill:#d3d3d3,stroke:#000
    classDef managed fill:#add8e6,stroke:#000
    classDef native fill:#ffff99,stroke:#000
    classDef external fill:#90ee90,stroke:#000
    classDef config fill:#ffe4b5,stroke:#000
```
