Sending data to USB Device C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anujsharma1983
    New Member
    • Sep 2008
    • 2

    Sending data to USB Device C#

    hi,
    Can anyone tell me how to send data to the USB Device. when i install the drivers of the device, it dosen't fall under HID or Port devices, but generates its own kind. I can detect the VID and PID of the device, but can't find the path. Can anyone tell me how to send data to that device in C# using CreateFile. Thanks for any help.
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    "Send data to a device"... Maybe I'm wrong here but I would think that in order to help we need to know the kind of data and the kind of device.

    Saving a file to a USB thumb drive is a lot different than sending a jpg to a USB camera with the intent being to save it in its on-board card, is a lot different than sending a file to a USB iPhone, is different than to a USB microscope.

    Comment

    • anujsharma1983
      New Member
      • Sep 2008
      • 2

      #3
      thanks for the reply. Basically its a USB CAN Adapter, where CAN stands for Controller Area Network. I need to send data to this device via C# application. I can detect the device, and can find the device id, product id, vendor id, serial number using the management class, but the main problem is that how i can send data to the same. More over the way i m making a test case is: I am using two CAN Adapters, connecting both to seperate USB Port, and connecting both adapters by the connecting cord and what i have to do is; send the data to one usb device and receive the same from the other. If some one have any idea, kindly tell me. thanks for all. check the image of the device manager (attachment).
      Attached Files

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        You will need to get the API/SDK for that device from the people who make it, and import it using say DllImport or something

        Comment

        • tlhintoq
          Recognized Expert Specialist
          • Mar 2008
          • 3532

          #5
          Originally posted by anujsharma1983
          thanks for the reply. Basically its a USB CAN Adapter, where CAN stands for Controller Area Network. I need to send data to this device via C# application. I can detect the device, and can find the device id, product id, vendor id, serial number using the management class, but the main problem is that how i can send data to the same. More over the way i m making a test case is: I am using two CAN Adapters, connecting both to seperate USB Port, and connecting both adapters by the connecting cord and what i have to do is; send the data to one usb device and receive the same from the other. If some one have any idea, kindly tell me. thanks for all. check the image of the device manager (attachment).
          So you are connecting computers via a string and two CANs.

          As the other person mentioned, you will have to use the API provided by the maker. It isn't as simple as just 'sending data', as if there were only one protocol used for every device by every maker.

          Comment

          Working...