C# API for USB 3.0 API ??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • metscore
    Junior Member
    • May 2020
    • 6

    #1

    C# API for USB 3.0 API ??

    Hello,

    We recently purchased a number of USB3 loopback test plugs. Since we use the .NET framework for writing our applications I was wondering if someone has developed the API in C# as opposed to C++ ?

    I can of course write one of my own. but if something is available it would save me some time.

    King regards
    Magnus
  • David (PassMark)
    Administrator
    • Jan 2003
    • 11099

    #2
    We only have a C++ example and command line console application for the API.

    Comment

    • metscore
      Junior Member
      • May 2020
      • 6

      #3
      Ah, okay thanks for the answer.

      Well, I found something on Cypress homepage so I'll take a look at that !

      Comment

      • metscore
        Junior Member
        • May 2020
        • 6

        #4
        David (PassMark) ,

        Do you have any intention of looking into writing a .NET interface for your USB test plug? It would be very convenient to have for some of us.

        FYI - I've managed to send data back and fourth but your console application does some driver specific stuff, such as SendVendorCommand that is most likely important to get higher throughput.

        I've tried start out myself with an easy thing, reading the voltage from the device, but unfortunately there is probably more to it since I can't get an answer even though I think I mimic your C++ console application fairly well. Most likely the issue resides somewhere in the Cypress C# implementation, but it is rather hard to figure out why just an empty buffer (only zeros) is returned.

        Thanks in advance,
        Magnus

        Comment

        • David (PassMark)
          Administrator
          • Jan 2003
          • 11099

          #5
          .NET isn't the best option for writing low level code. So, no we don't have any plans to write .NET example code.
          .NET framework is kind of dead, killed like so many other frameworks that Microsoft promoted then killed (MFC, Silverlight, Winforms, UWP, etc....)

          Comment

          • metscore
            Junior Member
            • May 2020
            • 6

            #6
            I agree that .NET might not be the best option for writing low level code, but that is not what we are talking about here anyway, is it?

            I respectfully disagree that .NET framework is dead, but it might be true that it does not have a future in the long run. If you want to be able to support more elegant frameworks the .NET Core platform might be something to consider IMHO.

            But, never mind. I got really nice help from Cypress technical support and without almost any effort I wrote a C# wrapper around their stuff. No, it is not low level and Yes and it works great with your USB 3.0 Loopback plug. My C# (console) application essentially does the same job as your USB3Console and even has a slightly better, or on par, performance. And of course, not being C++ it doesn't look so ugly, but that is obviously a matter of personal preference...

            Thanks for all your support !

            Comment

            • David (PassMark)
              Administrator
              • Jan 2003
              • 11099

              #7
              Feel free to post a Zip file with the C# code if you like. Someone else might get some use from it oneday.

              Comment

              • metscore
                Junior Member
                • May 2020
                • 6

                #8
                Here is something that hopefully someone might be able to use someday....

                It contains a small console test application and the "driver" around the.Cypress lib (which is included)
                (Compiles using VS2019 and it downloads appropriate packages using NuGet package manager)

                King regards
                Magnus
                Attached Files
                Last edited by metscore; Jun-01-2020, 03:28 PM. Reason: Added additional information

                Comment

                • metscore
                  Junior Member
                  • May 2020
                  • 6

                  #9
                  Cypress Developer Community 3.0
                  https://community.cypress.com/message/233780#233780

                  Comment

                  Working...