Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. LibUsbDotNet read write USB Port

LibUsbDotNet read write USB Port

Scheduled Pinned Locked Moved C#
helpcsharp
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mihai123
    wrote on last edited by
    #1

    Hello guys, I am struggling for 3 days now with the problem of reading and writing form/to an usb port. For this I tried to use LibUsbDotNet. The library has a very nice and at first I though useful documentation. My problem is that I cannot reference the UsbDevice object that I want to use. I tried to iterate through the UsbDeviceList but have no success because the List is empty (I cannot understand why) . I tried with different sticks and card reader device and the result is the same the DeviceList is empty obviosly I doing something wrong but I cannot figure what . UsbDeviceList usbDeviceList = new UsbDeviceList(); IEnumerator enumerator = usbDeviceList.GetEnumerator(); while (enumerator.MoveNext()) { usbDevice = enumerator.Current; if (usbDevice.Info.IdVendor == infoDevice.IdVendor) break; } LibUsbDotNew Library[^] Hope some of you worked with this library and cam help me with some useful tips. Thanks

    M 1 Reply Last reply
    0
    • M mihai123

      Hello guys, I am struggling for 3 days now with the problem of reading and writing form/to an usb port. For this I tried to use LibUsbDotNet. The library has a very nice and at first I though useful documentation. My problem is that I cannot reference the UsbDevice object that I want to use. I tried to iterate through the UsbDeviceList but have no success because the List is empty (I cannot understand why) . I tried with different sticks and card reader device and the result is the same the DeviceList is empty obviosly I doing something wrong but I cannot figure what . UsbDeviceList usbDeviceList = new UsbDeviceList(); IEnumerator enumerator = usbDeviceList.GetEnumerator(); while (enumerator.MoveNext()) { usbDevice = enumerator.Current; if (usbDevice.Info.IdVendor == infoDevice.IdVendor) break; } LibUsbDotNew Library[^] Hope some of you worked with this library and cam help me with some useful tips. Thanks

      M Offline
      M Offline
      Mustafa Ismail Mustafa
      wrote on last edited by
      #2

      Try this: http://www.icsharpcode.net/OpenSource/SharpUSBLib/default.aspx[^] but it will need this installed: http://libusb-win32.sourceforge.net/[^] I've tried it in 2 previous projects and it works like a charm. I haven't tried LibUsbDotNet so I can't help you with that one, sorry.

      "Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed. Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler "You're an idiot." John Simmons, THE Outlaw programmer "I realised that all of my best anecdotes started with "So there we were, pissed". Pete O'Hanlon

      M 1 Reply Last reply
      0
      • M Mustafa Ismail Mustafa

        Try this: http://www.icsharpcode.net/OpenSource/SharpUSBLib/default.aspx[^] but it will need this installed: http://libusb-win32.sourceforge.net/[^] I've tried it in 2 previous projects and it works like a charm. I haven't tried LibUsbDotNet so I can't help you with that one, sorry.

        "Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed. Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler "You're an idiot." John Simmons, THE Outlaw programmer "I realised that all of my best anecdotes started with "So there we were, pissed". Pete O'Hanlon

        M Offline
        M Offline
        mihai123
        wrote on last edited by
        #3

        First I did not wnat to use that library but seems that I have no other sollution. The problem with that library is that I didn't find a decent documentation and that it isn't maintained anymore. Also you need to install the LibUSBwin 32 first ... If you have some documentation or if you know a link please send a reply Thanks.

        M 1 Reply Last reply
        0
        • M mihai123

          First I did not wnat to use that library but seems that I have no other sollution. The problem with that library is that I didn't find a decent documentation and that it isn't maintained anymore. Also you need to install the LibUSBwin 32 first ... If you have some documentation or if you know a link please send a reply Thanks.

          M Offline
          M Offline
          Mustafa Ismail Mustafa
          wrote on last edited by
          #4

          Sadly, no. The projects were accomplished by looking at the samples that came with the download, that gave me an idea of what to do. Their object model isn't convoluted at all from what I remember.

          "Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed. Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler "You're an idiot." John Simmons, THE Outlaw programmer "I realised that all of my best anecdotes started with "So there we were, pissed". Pete O'Hanlon

          M 1 Reply Last reply
          0
          • M Mustafa Ismail Mustafa

            Sadly, no. The projects were accomplished by looking at the samples that came with the download, that gave me an idea of what to do. Their object model isn't convoluted at all from what I remember.

            "Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed. Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler "You're an idiot." John Simmons, THE Outlaw programmer "I realised that all of my best anecdotes started with "So there we were, pissed". Pete O'Hanlon

            M Offline
            M Offline
            mihai123
            wrote on last edited by
            #5

            for instance I need to do some basic things reading and writing using the usb port. I cannot find out what endpoint should I put in BulkWrite.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups