How to program LimeSDR in C#?

Please forgive me if this forum is not dedicated to programming. I can’t find a good place to ask this question because I can’t find a forum dedicated to SDR programming and stackoverflow is too specific with the questions you can ask.
I am looking to write programs to control the lime SDR with C# on a similar level to what one would use GNU radio and python to do. What is the name of the core library that GNU radio uses? Maybe there is a C# binding?
Not asking anything too specific, but if someone could point me in the right direction of what library to use, I would appreciate that.

Lime Suite is the hardware driver.

gr-limesdr builds on this to provide sink/source blocks in GNU Radio.

But you wouldn’t use this unless you were using GNU Radio and you’d just use Lime Suite instead.

Wrappers have been created for other languages, such as Golang.

https://wiki.myriadrf.org/Limedrv

So this could give some clues as to how you might approach this.

The LimeStream util from lime-tools also serves as a good example for accessing the SDR and setting up streaming.

You could possibly even use this is a very simple “driver”, at least initially perhaps during the early stages of development.

2 Likes

You could probably learn something from reading the SDRsharp-limesdr plugin code. It may not be exactly what you are looking for but it may help, it is C# code.

2 Likes

You can call C routines in dlls directly from C#. Here is a simple example.
You would just need to do the same thing to your SDR library calls.

    [DllImport("NCSA-LIBRARY.dll")]
    public static unsafe extern int writeSDS2D(String nameFile, double* data, int xsize, int ysize, int type, int iflip);

        int ret = 0;
        unsafe
        {
            fixed (double* d = &data[0], last = &data[xsize * ysize - 1])
            {

                ret = writeSDS2D(R2.strData, d, xsize, ysize, 0, 0);
            }
        }
        if (ret != 0)
        {
            WarningBuff = "saveNCSA Error  Writing  File : " + R2.strData + " \n";
            WarningExpression(WarningBuff);
        }
1 Like