Author Topic: Comminicate to DigiUsb from C# (.NET)  (Read 6156 times)

lazarus

  • Newbie
  • *
  • Posts: 4
Comminicate to DigiUsb from C# (.NET)
« on: January 08, 2013, 04:33:10 am »
Hi, is there anyone who can tell me how to initiate communication from .NET to a DigiUSB device?
It works perfect from python but I realy like to keep all my code in C# :)

I guess it must be possible, perhaps via Pinvoke to a windows library or so, but I have never done anything like it.

Thanks
« Last Edit: January 08, 2013, 04:33:10 am by lazarus »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Comminicate to DigiUsb from C# (.NET)
« Reply #1 on: January 08, 2013, 10:28:29 am »
The python and ruby code (and the C uploader) use LibUSB so I\'d start here:

http://sourceforge.net/projects/libusbdotnet/

And then make the equivalent function to the python functions in the arduino folder

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Comminicate to DigiUsb from C# (.NET)
« Reply #2 on: January 08, 2013, 10:28:42 am »
And if you do get an example working please share!

lazarus

  • Newbie
  • *
  • Posts: 4
Comminicate to DigiUsb from C# (.NET)
« Reply #3 on: January 15, 2013, 12:07:55 pm »
Thanks, I made some attempts but with litle success. I was able to open the USB device and print out the name. but reading or writing to a endpoint doesn\'t work yet. I\'ll give it an other go in a few days. :)

SmeeAgain

  • Newbie
  • *
  • Posts: 10
Comminicate to DigiUsb from C# (.NET)
« Reply #4 on: January 19, 2013, 11:35:48 pm »
Hey lazarus,

check out my post here: http://digistump.com/board/index.php?p=/discussion/194/solved-managed-library-c-to-talk-to-digiusb#Item_3

I managed to implement read and write functionality, give it a try and let me know how you\'re getting on.

T

lazarus

  • Newbie
  • *
  • Posts: 4
Comminicate to DigiUsb from C# (.NET)
« Reply #5 on: January 20, 2013, 12:51:01 am »
Thank you very much for sharing your findings. I\'ll give it a try.

thanks again!

BStrauss3

  • Newbie
  • *
  • Posts: 8
Re: Comminicate to DigiUsb from C# (.NET)
« Reply #6 on: January 21, 2013, 12:17:14 pm »