Which USB port is my device plugged into?

My application program needs to read a USB joystick on a Solaris 8 system.
How can my program find out which usb port it is using other than:
   system("ls -l /dev/usb | awk '$0~""input""{print$9}' > file")and then reading that file? Thank you.
Scott B. Klein
Northrop Grumman Electronic Sensors
Baltimore, Maryland 21203-0746
Telephone (410) 765-0910
[email protected]

Hello.
If the "system" variant provides the information you need I would use the "readdir" functions (opendir, readdir, closedir; see manpages) to read out the directory contents of /dev/usb. This is way more efficient than starting multiple processes (ls and awk).
To get extended information (information you get by the "-l" argument of "ls" ) call stat() for each file.
Martin

Similar Messages

  • I have had IPhones since their inception.  Last phone was the 5.  A few months ago, I upgraded to the 6 Plus. Here is my issue. On my 5, my car radio (which has USB port) allowed me to plug in and listen to radio or music from my phone and the bonus

    I have had IPhones since their inception.  Last phone was the 5.  A few months ago, I upgraded to the 6 Plus.
    Here is my issue.
    On my 5, my car radio (which has USB port) allowed me to plug in and listen to radio or music from my phone and the bonus was it charged the phone as well. All worked great.
    Now with the 6 Plus, neither of things work.  The message on the radio (Kenwood) says I Pod error.  The message on my phone say's "this device is supported".
    I have called on this before and was told you are aware and that the issue will be addressed in a future update.  There have been several updates on IOS 8 and the issue remains.

    I have a Kenwood KDC-X695. When I purchased this stereo and had it installed, I had an ATT iPhone 4.
    It worked with the stereo, but had a few issues. I had purchased a few audio books that I would listen to while driving. When I plugged it in it would immediately begin to play the book from the beginning or if I had been listening to music, it would start playing the song that was at the top of the song list.
    The stereo came equipped with Firmware version 3.05. I upgraded to the iPhone 5 a year later. I had that phone for approximately 2 years. The song or book issue remained the same.
    I just recently upgraded to the iPhone 6 and the Bluetooth function still works, however the USB port on the stereo that the phone plugs into to allow files on the phone to play through the stereo no longer works.
    I contacted the service provider (Verizon) and after speaking to several different technical support technicians, they provided me the phone numbers for Kenwood and Apple because they were unable to help me.
    I spoke with Kenwood technical support the following day and after a few fumbling miscues from the technical advisor, it was suggested that I upgrade the firmware, even though the Kenwood literature warns against this if the Bluetooth portion is working, because if there is a problem with the upgrade, it can render the Bluetooth useless and non-functional. The advisor did suggest the latest firmware on the second or third attempt, after I pointed out what I was able to glean from my initial search.
    Later that day, I went back to the Kenwood site (from their homepage) and by using their selection tools, discovered that this particular model was only ever intended to be used with the iPhone 4S (the technical advisor was not aware of this, even though I mentioned this during my phone call earlier in the day). According to the Firmware selection tool, my iPhone 5 should not have worked with it.
    I performed the Firmware upgrade, and it took 13 minutes. This was less than the 15 minutes that was forecast in the Kenwood literature. The Bluetooth still works but the USB cable connection still causes the unsupported device message that I received prior to the upgrade. I am incredibly annoyed and disappointed.
    By upgrading to the iPhone 6, I have three choices; (1) only use the Bluetooth for phone calls without the ability to play other files from my iPhone 6 (2) forced obsolescence of my stereo, requires buying a new stereo (3) return my iPhone 6 and go back to my iPhone 5.
    I do not believe that I should have to be a software/Firmware/hardware engineer, vetting every single device that I own; prior to upgrading a cell phone.
    I am incredibly annoyed with Apple at the moment.
    I have a separate Bluetooth headset that worked with both my iPhone 4 and iPhone 5 that the iPhone 6 simply does not recognize. That is another story for another time.
    Currently, I am incredibly underwhelmed with Apple.

  • I have one HDMI port on my television that is currently used for my hard drive/free view box.  What kind of adaptor can I buy so I can have the hard drive and my apple tv device plugged into the same HDMI PORT?

    I have one HDMI port on my television that is currently used for my hard drive/free view box.  What kind of adaptor can I buy so I can have the hard drive and my apple tv device plugged into the same HDMI PORT? Is it a switch or a splitter?  And where is it best to buy one?  Thanks!

    Welcome to the Apple Community.
    You need an HDMI switch.

  • Keep receiving "USB Over Current Notices" since updating to OSX 10.6.8. I have no devices plugged into my Imac and running everything wireless. SMB/PRAM resetting did not work. Does anyone have some advice or can help?

    Keep receiving "USB Over Current Notices" since updating to OSX 10.6.8. I have no devices plugged into my Imac and running everything wireless. SMC/PRAM resetting did not work. Does anyone have some advice or can help?

    Hi Melissa,
    Pretty strange, but...
    Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, does it happen in Safe Mode? Reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)

  • Can i use USB 2.00 or USB 3.00 with my laptop? How do I know which USB ports my laptop has? MacBookPro7,1 Processor Name:     Intel Core 2 D

    Can i use USB 2.00 or USB 3.00 with my laptop? How do I know which USB ports my laptop has? MacBookPro7,1 Processor Name:
    Intel Core 2 D

    MacBookPro7,1
    Your computer has USB 2.0 ports. You can use USB 3.0 devices with it, but at the speed of USB 2.0.
    (103917)

  • My problem is that one of the USB ports and the device does not detect this and inactive but can not find how to reactivate.Help me please! greetings thanks!

    Hello good evening, I have a MacBook Pro and my problem is that one of the USB ports and the device does not detect this and inactive but can not find how to reactivate.
    Help me please! greetings thanks!

    Do you have the Firefox new tab page but the actual sites are missing, or do you have some other page?
    If you have some different page, try the quick fix in Fred McD's reply.
    If the sites are missing, did you use the Reset feature? That will clear the storage associated with the new tab page. I'm not sure it's possible to recover from that; you probably need to rebuild your page from scratch as you browse.
    For possible future reference, here is how to access the hidden setting for the page to display on new tabs:
    (1) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (2) In the search box above the list, type or paste '''newtab''' and pause while the list is filtered
    (3) Double-click the '''browser.newtab.url''' preference and enter your preferred page:
    * ''Page thumbnails (default)'' => about:newtab
    * ''Blank tab'' => about:blank
    * ''Built-in Firefox home page'' => about:home
    * ''Any other page'' => full URL to the page
    Press Ctrl+t to open a new tab and verify that it worked. Fixed?
    Some gotchas:
    ''If Firefox won't let you edit this setting:'' you may have something called SearchProtect on your system.
    ''If Firefox lets you save your change but ignores it:'' one of your extensions may be overriding it. You can review, disable, and/or remove extensions on the add-ons page:
    "3-bar" menu button (or Tools menu) > Add-ons > ''in the left column click'' Extensions
    ''If the change works during your session, but at the next startup is back to an unwanted page:'' you might have a user.js file in your personal Firefox settings folder (your Firefox profile folder). This article describes how to track down and remove the file: [[How to fix preferences that won't save]].
    Any luck?

  • I just bought a new portable battery. It uses 2 USB ports to charge devices, a 1 amp port and a 2 amp port. My question is which port do I plug my iPhone 5s into and which do I use for my iPad 2?

    It's a 10,000 mAh external battery. I got this for traveling and because I go to disneyland a lot. My phone wont last all day there and unlike some people, I would never plug my phone into their outlets (I watched a girls phone spark and practically melt once), their voltage is way too high. I have other batteries, but when I saw that this one can charge the 5s fully 3-5 times, I new it was a must. Online, there were wonderful reviews about it and that it charges the 5s and the iPad 2 wonderfully. However when I opened the package and read the directions it listed that there were 2 USB ports, a 1 amp and a 2 amp and to match your device to the port. Now it's been a while since I've studied about volts, amps, etc. so the first thing I do is google it. I know that the iPhone 5s uses 1 amp and the iPad 2 uses 2 amps, and from what I read, you can use the iPad charger to charge the iPhone (which I didn't know there were conflicts about this, I've always used my iPad charger for my phone). There are a lot of articles with people going back and forth about charging techniques, but I want to make sure I'm not going to damage any of my devices if I plug it into the wrong port.
    Any responses will be appreciated as this isn't an area where I am very knowledgeable! Thank you!!!

    The iPhone and iPad draw whatever charging current they require. The iPad draws more.

  • Flashing Folder when USB device plugged into 3rd USB port

    Model: Intel iMac, 2008, 2GB
    Problem: Anytime I plug in any USB device into the third USB port from the left, next to the firewire port, I get a flashing folder.
    If I boot into an install disc, it does not recognize or see the hard drive.
    If I unplug the device from that specific port, the computer will boot and run fine.
    I managed to zero out the hard drive and reinstall Leopard. I have reset PRAM and all that.

    So if you plug in, say a printer, scanner, mouse or keyboard does it act the same?
    The flashing folder tells you that the Mac cannot find a bootable OSX device (volume).
    You stated in the original post "I have reset PRAM and all that"
    Is resetting SMC included in the "everything like that" category? If you have not tried resetting the SMC then do that.
    http://support.apple.com/kb/HT1411

  • USB Ports - Mass Storage Devices - Unknown Device

    Model: Satellite A135-S2276
    OS: Vista
    I recently tried plugging in my media card reader that I've had for several years now and has worked many dozens of times.   Windows responded with an 'Unknown Device'  response.  I thought this was odd, so I changed and tried each USB port.  To no avail the device wasn't recognized.  I tried it in another computer and it worked fine. 
    I began to try two other mass storage devices that I know used to work, up until recently, on the laptop.  Both now are 'Unknown Devices'.   I now have a strong feeling that someting was wrong with windows vista.  So I search around and find methods to force the driver (inf) cache to reset which should reload any corrupted drivers.   Tried many methods, nothing worked, same results.  I saw that Vista Service Pack 2 just came out, I installed that hoping that it would fix.  Nope.  
    I gave up on it being a software issue after I did a fresh reinstall of the OS and with the base OS with no other software installed same results. 
    Is there a way to diagnose if the USB is malfunctioning from a hardware standpoint?  Is it possible the USB, even thought windows recognizes it, is dead on the motherobard?  If so, how do I get this fixed?  Motherboard replacement?
    Help!!

    It sounds like it is working enough that it can recognize that soemthign is plugged into it.
    You say you did a fresh install of Windows.  Did you use the recovery disk or a retail Windows copy.  If oyu didn't use the recovery disk then maybe you are missing a driver.  Best woudl be to use the recovery disk.  If a USB mouse doesn't work after that then the hardware has an issue.  Assuming the BIOS is OK.
    This signature left intentionally blank.

  • How many USB-powered 1TB can you plug into an HP G71 Notebook

    I'm using Windows 7 (service pack 1).  I have 3 USB ports, one of which I've extended with a 4-slot extension. 
    I bought a Western Digital Elements and an I Omega 1 TB USB portable hard drive (each nominally clocks in at 930 gigabytes).  I plugged one into one side of the laptop and another into the 4-slot USB port extension. 
    These worked great, except I filled 'em up too fast.  So I needed another one.  I bought another Western Digital Elements drive, exactly like the first one.
    The laptop will make a sound when I plug in the third hard drive ... a positive sound that it makes when I plug in the other two.  However, the window that pops up for the other two does not pop up for this third.  Also, the USB port extension begins chiming ... just a little sound, but it's annoying, and doesn't stop until I unplug the drive.  Additionally, the third hard drive is not assigned a drive letter in Windows Explorer.  I can, though, unplug the first WD drive and plug in the second WD and the laptop will recognize the drive and assign it a drive letter.
    In short, I cannot have all three of the drives up and running at the same time and visible in Windows Explorer, which would allow me to switch files between them.
    Is there anyway I can get all three visible and working?  Or is there something wrong with the new WD Elements drive?  (I think the drive is okay.  I copied files to it and used those files just fine).
    Any help would be appreciated.
    Thanks.

    Sorry ... none of that exists on my drive.  In fact, when looking for a portable hard drive, I specifically sought out drives that had nothing but open space on them.  The I-Omega and the Western Digital Element were the two that I found that met that criteria.  Nothing in the very thin documentation even suggested that there were hidden files let alone program files for backing up, or partitioning, or whatever.
    As for the Disk Management screen ... Yes.  I have that.  I click on "Computer" in the "Start" menu.  However, as you can see (if I've embedded the jpg correctly), even with the second WD drive plugged in, you cannot see it in this menu.
    The only place you where you can tell it the computer "sees" it is when I click on the "Remove Hardware Safely" icon.  All three connected portable hard drives are listed in that menu, but no drive letter is associated with the second WD.  Also, in this screen there is only one thing you can do and that's to disconnect one of the drives.  I've tried to right mouse click and get a drop down menu, but no luck.
    Okay ... I was wrong ... you can see it under "Devices," but the second WD is a little different.  The I-Omega and the first WD get a tool bar that lists Add a Device, Add a Printer, Autoplay, Browse Files, and Eject.  The second WD -- as you can see -- does not get the Autoplay and Browse options.  Also, I've tried "Add a Device" and the computer did not find the drive.  Oh, by the way, when right clicking the second WD for Properties the pop up menu says that the drive is working properly.
    So ... you can see my frustration and confusion.  I'm beginning to wonder if the computer simply doesn't like the fact that I have two WD drives that are exactly the same.
    Hope there are some other ideas to try ....
    Thanks

  • TS1538 On Windows Vista, everything works through the USB ports except IOS devices.  This just started and I can't get things to work.  Help!

    The past few days I find my IOS devices don't show up in "My Computer" and they don't show up in iTunes.  All other USB devices work well.  I am using Windows Vista.  I have tried several troubleshooting things, including unintalling and reinstalling iTunes, stopping and starting the Apple monitors, etc.  Nothing is working.  Ideas?

    It's really great that you're taking the time to help me.  I did several of the tests you recommend over the last two or three days.  It always shows that the iPod/iPhone/iPad isn't present.  Here's more.  I got a Norton tech to help me yesterday and it isn't the anti-virus, as we uninstalled everything and it still didn't work.  I went deeper into the system through the control panel, and found the device detected on the appropriate USB port, but it won't show up in "My Computer".  Two of the three devices show up on another PC, (I didn't test the third) so I'm leaning to something in iTunes because every other USB device I plug into the Vista ports shows up quickly and works perfectly (thumb drives, wireless mouse, camera, etc).  I already unistalled all Apple software and downloaded new, but the problem still exists.  I have restarted, unplugged, you name it and the devices aren't showing up.  I can't wirelessly sync either because one has to set that up through iTunes prior to doing it.

  • Splitting the Time Capsule USB port for 2 devices ??

    So if i have and external HD plugged into tc usb port and I also need to plug in a netflix ready blue ray player to the same port- is there a splitter I can buy to do this or what other options do i have?
    I have an extra airport extreme I am not using-could I run an ethernet cord to it and use that usb port for my second device without and problems?
    Thx

    First, yes it is possible to attach multiple devices to the TC's USB port. You will need a USB hub though. Some users have discovered that not all hubs are compatible with the TCs USB port. So you may need to shop around if the first one doesn't work.
    However, the USB port on the TC is designed primarily to handle external HDs or printers. That is, it is designed to make them available to your local network, not to the internet. So I have doubts that the BR player will be able to have full interest access via the TCs USB port.
    See this KB article:
    http://support.apple.com/kb/HT2421
    Hope this clarifies things a bit. Cheers!

  • I am trying to communicat​e with third party instrument via usb but I dont know how to do it even in Ni-max I am not able to see usb port symbol in Devices and Interface section.

    hello,
    I am tring to communicate my Powersupply which is not from Ni via USB cable ,but I am not able to see my connection or usb symbole in Ni-max .
    first time I am using this will you please guide me,and is there any driver i need to download for that?here I put one attachment regarding to this.
    Thanks in advance.
    Solved!
    Go to Solution.
    Attachments:
    usb is not detected.png ‏182 KB

    ya I know that,
    thats y i asked you that y it is so because i am not able to see that usb port here i can see that much only.
    thats y i got confused.
    and I can see my hameg connection in my control panel and also in device manager.
    http://www.hameg.com/drivers.0.html?&no_cache=1
    this is website for hameg driver in that product select  hmp4040 than hmp4000 list will open in that i have download third one in which plug and play is given.
    or here i send my vi it might be helpful.
    Attachments:
    hmp4040 Output DC Volts.vi ‏17 KB

  • Lion and USB ports and flash devices

    I noticed a curious thing today, when endeavouring to update my NavMan satnav via Parallels 6/ Win XP and USB under Lion. Basically, the satnav (which has internal flash memory) isn't recognised by the NavDesk software, WinXP or Parallels.
    Booting the iMac back into my SL clone, all works as expected - the device is recognised by WinXP and communicates. It also mounts the flash drive on the Mac desktop until it's captured by Parallels.
    Booting the iMac back into Lion, same Parallels pvm, the device doesn't mount on the Mac desktop, and is not detected by Parallels/WinXP.
    So I look into it further: in Lion, under 'About this Mac', the device does NOT show up under USB hubs, on any of the USB ports on the iMac. However, if I attach the satnav to my standard Apple wired keyboard, it IS recognised on the keyboard hub, but still doesn't mount, or is able to be detected by Parallels. I should mention that I also tested this out with other flash drives, which performed as expected, and on another iMac running Lion that also did not recognise or mount the drive.
    Not quite sure what to make of all this: works OK under SL, but not under Lion on the same hardware, so it would seem to be a USB driver issue, with Lion not playing nice with what is still a current-shipping third-party device and rendering it incompatible.

    I'm not sure I totally agree about Parallels 7.
    From the actual Parallels website:
    http://www.parallels.com/au/support/pdfm6/
    "Parallels worked closely with Apple during the development of its Lion operating system. Our testing has shown that the latest built of PDFM6 supports Lion but does not take advantage of new Lion features."
    If you do a little digging, there suuposed advantages of 7 over 6 might not be worth the upgrade cost for some. I'm not really interested in Parallels using the new Lion features like 'enhanced full screen support', new gestures and mission control interface, AES-NI encryption and Mac-on-Mac virtualisation.
    I would recommend anyone debating the issue have a Google around and also read the following link, at the end of the day for me the $50 buck upgrade isn't worth it and I will wait for Mountain Lion (OS X 10.8) and the eventual Parallels 8 before I need an upgrade.
    http://www.infoworld.com/d/virtualization/parallels-desktop-7-mac-upgrade-you-ca n-skip-172055

  • Which USB port connects to which USB controller ?

    On 875P Neo, I have 6 USB Ports on the mainboard slot and these 2 additional USB2 Ports, which I  can access from the front.
    The connection from the additional USB2 controller to these 2 USB2 ports are clear.
    But there are 4 USB controller for these 6 USB ports on the mainboard slot. - I did not find which port connects to which controller.
    That's important for me, because one of these controllers shared an IRQ with my TV card on PCI slot 4 and if the USB-ISDN modem is connected to a port of this USB controller, I get sometimes this nice error message "can't locate TV tuner" an so on...
    How can I figure out which of these 6 USB port connects to which of these 4 USB controller ???

    I guess the only way is to manually connect your device and see which USB xHCI it maps to that conflicts with your TV card IRQ.
    With the 876P (and 865PE) you have 8 USB 2.0 ports which gets mapped into 4 Universal Host Controllers (2 USB1.x ports per UHCI) and a single Enhanced Host Controller (all 8 USB2.0 ports). Find out where each of your host controllers gets mapped into when you connect a USB1.x device.
    Unfortunately, there doesn't seem to be a way to control how each PCI card gets an IRQ on the 875P Neo (but the 865PE Neo2 does seem to have such an option)

Maybe you are looking for

  • TS3212 I am getting a error 7 when trying to install Itunes stating that there is a missing .dll file

    I am getting an itunes.exe system error stating that it cannot start because the MSVCR80.dll is missing.  Could you help please

  • Help!! how to use ms office chart in jsp

    I want to use ms office chart in jsp for getting real time statistical chart. but I don't know how to satart. give me an example please,(including the code is better) thanks

  • Creative Zen MicroPhoto Error (8

    Hi, I'm from the UK but purchase a Zen MicroPhoto from the USA brand new. I've had it around 3 weeks and its been great but the other day when i went to turn it on the screen froze and it wouldn't boot up the the menu like usual. It is the Creative l

  • I can't see some of the message body

    Hi guys, When I open some messages in Microsoft Outlook 2003 I can't see some parts of the message body. With Outlook Express is all ok. We use Sun Java(tm) System Messaging Server 6.2 (built Dec 2 2004) with Messaging Express as webmail. The same pr

  • Apple account security

    I have received an email saying my Apple account has been frozen and that I should click on the link to activate my account.  Is this genuine or is it a phishing email?