Find the answer to your Linux question:
Results 1 to 7 of 7
Hi I am trying to write a file to a USB device using C program.. When i try to open the USB port, i find the foll error "open_port: unable ...
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    3

    Unhappy Need help with USB programming

    Hi
    I am trying to write a file to a USB device using C program..
    When i try to open the USB port, i find the foll error

    "open_port: unable to open usbdev2.1_ep81: No such file or directory"

    The command to open the USB port:

    sprintf(portfile,"/dev/usbdev2.1_ep81");
    if((fd=open(portfile, O_RDWR | O_NOCTTY | O_NDELAY))==-1)
    perror("open_port: unable to open usbdev2.1_ep81");

    Please provide some inputs/help

    Thanks,
    Priya

  2. #2
    Linux User
    Join Date
    Jul 2004
    Location
    Poland
    Posts
    368
    This might sound silly, but is the file really sitting on the file system, i.e. did you check that there's really a file called /dev/usbdev2.1_ep81 ?
    "I don't know what I'm running from
    And I don't know where I'm running to
    There's something deep and strange inside of me I see"

  3. #3
    Just Joined!
    Join Date
    Sep 2007
    Posts
    3

    Unhappy

    Hi

    Ya actually i wanna access any of the USB ports available in /dev/
    and write file to it.
    Please help me out with this..
    Thanks in advance

  4. #4
    Linux User
    Join Date
    Jul 2004
    Location
    Poland
    Posts
    368
    What do you want do do with this ports? Generally, you need a driver to access a device.
    "I don't know what I'm running from
    And I don't know where I'm running to
    There's something deep and strange inside of me I see"

  5. #5
    Just Joined!
    Join Date
    Sep 2007
    Posts
    3

    Unhappy

    Quote Originally Posted by kyku View Post
    What do you want do do with this ports? Generally, you need a driver to access a device.
    I wanted to send data to USB Port using a C Program..

  6. #6
    Just Joined!
    Join Date
    Aug 2007
    Posts
    9
    It might present it self as a tty port.


    ttyUSB0 or something

  7. #7
    Linux User
    Join Date
    Jul 2004
    Location
    Poland
    Posts
    368
    Quote Originally Posted by just4priya View Post
    I wanted to send data to USB Port using a C Program..
    Take a look at the libusb library. There are some tutorials to it floating around the web. You just need to google them. Good luck!
    "I don't know what I'm running from
    And I don't know where I'm running to
    There's something deep and strange inside of me I see"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...