Find the answer to your Linux question:
Results 1 to 3 of 3
Hi I m new to linux. I just want to check that if something is connected to my machine's serial port & USB port through C program using ioctl command. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2006
    Posts
    5

    Question Howto get status of serial & USB port


    Hi
    I m new to linux. I just want to check that if something is connected to my machine's serial port & USB port through C program using ioctl command. I searched a lot and got lot of material but still not clear that what specific data can tell me that something is connected or not.
    plz send ur suggestions for the same.

    Regards
    Pradeep

  2. #2
    Linux Enthusiast KenJackson's Avatar
    Join Date
    Jun 2006
    Location
    Maryland, USA
    Posts
    510

    libusb

    You need to use libusb and libusb-devel. The API has functions like usb_open() and usb_get_string_simple().

    I'm having difficulty in that area right now. AVRDUDE includes a file named usb_libusb.c which uses these commands to access the Atmel AVRISPmkII programmer via USB. But it can't get permission to access USB, and I don't know how to set the permissions.

    Hey, also note that command-line tools 'usbview' and 'lsusb', if installed, will tell you what USB devices are connected.

  3. #3
    Just Joined!
    Join Date
    Jun 2006
    Posts
    5
    thanx ken !

Posting Permissions

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