Linux USB programming in C

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • msaeedi
    New Member
    • May 2010
    • 1

    Linux USB programming in C

    I'm working on a c project in Linux. This project contains two components, one transmitter and one receiver each one should be executed on a different PC. Hence, two PCs should be communicated. To do so, USB port have to be used. Hence, my question is how to use USB programming in Linux to send data from one PC and receive data in another one and vice versa. I read some examples about libusb and checked them. currently, I used my flash disk as a USB device and I tried to open it and send some bytes (in bulk mode). However, I think I should buy a USB data cable (bridge cable?) first to connect both PCs. Then, I should set configurations of both USB ports as desired (in both PCs, is it possible or I cannot to re-set them?) and after that I can use usblib functions to send and receive data. Am I right or I missed something? I tried to set my flash configuration previously and I encountered a problem, i.e., device is busy and so on. Please help. I appreciate your time and effort.

    Mehdi
  • newb16
    Contributor
    • Jul 2008
    • 687

    #2
    Start with googling for 'pc as a slave usb' . Not every USB controller can serve as an USB slave, and it may require a special cable with electronics to connect them.

    Comment

    Working...