Sponsored Content
Operating Systems OS X (Apple) Detect active usb device used by app Post 303037958 by dallas88 on Monday 19th of August 2019 11:09:59 PM
Old 08-20-2019
Detect active usb device used by app

I've searched a number of sites but thought I'd post it here. I'm want to a detect certain usb device (external camera) that is actively being used by an app on a mac.
My search has led me through looking at the system events log to see if there is a ProductID indicator logged. The device is plugged into the same so researching on how to check any output from the port.
Anyone thoughts on additional ways to tackle this? am i in the right place> appreciate any feedback

So for I have a bash script that detects the usb devices on a mac
Code:
# USB Devices detected 
log "List of USB Devices " 
log ""
USB=`ioreg -p IOUSB -w0 | sed 's/[^o]*o //; s/@.*$//' | grep -v '^Root.*'`
log "$USB"


The following usb devices detected and written to a log file:
Code:
AppleUSBEHCI Root Hub Simulation
IOUSBHostDevice
IOUSBHostDevice
Apple Internal Keyboard / Trackpad
IR Receiver
BRCM20702 Hub
Bluetooth USB Host Controller
Keyboard Hub
Apple Keyboard
AppleUSBXHCI Root Hub Simulation


Last edited by dallas88; 08-20-2019 at 12:16 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Can't detect usb thumbdrive anymore

hey everyone! i have a Solaris 8 box with me, and i had been using my usb thrumbdrive on it all the time. one day, i was in a rush and i pulled out the thumbdrive without ejecting it or anything. and now i can't detect any thumbdrives at all. i had tried using another thumbdrive, but with no... (2 Replies)
Discussion started by: feef
2 Replies

2. Windows & DOS: Issues & Discussions

How to detect if a Windows app dies??

Hello All: I hope this is the right category... I have a application (this app runs under java and jboss) that runs under Windows, it's started as a service. If that application should become disabled, crash or no longer function, what would be the best method for determining it is no longer... (6 Replies)
Discussion started by: jimmyc
6 Replies

3. Linux

mounting usb device

Hi Folks, I want to know how to mount usb device (cd,dvd etc) in linux, Regards, Manoj (4 Replies)
Discussion started by: manoj.solaris
4 Replies

4. Solaris

Usb Device

AM TRYING TO CONNECT A USB EXTERNAL DRIVE FOR BACKUP,THE USB SLOT IS AVAILABLE,BUT I DONT KNOW IF IT IS READY WHEN I CONNECT IT,AND WHAT COMMANDS DO I NEED. tHANKS (10 Replies)
Discussion started by: tomjones
10 Replies

5. Programming

How to detect usb storage arrival and its mount path from C

Hi, I am a newbi to linux, i wana to write a program in C that can detect arrival of a usb flash memory. I want also to find the actual mount point of new inserted flash disk. can anyone help me? thanks a lot (6 Replies)
Discussion started by: aghashahi
6 Replies

6. Shell Programming and Scripting

BASH Script to Detect and List USB Flash Drives

Hello. This is my first post to this forum. I've read many of the posts over the last two or three years and I've learned a lot. I'm creating a live Linux distribution using the Linux Live Scripts -- just as a hobby project -- and I'm wanting to create an automated way for a user to copy the... (7 Replies)
Discussion started by: godzillarama
7 Replies

7. Shell Programming and Scripting

Detect USB keyboard and other peripherals

Hi there, I have a Debian machine without any peripherals (no screen, no keyboard, etc.). I'd like to be able to detect and log when someone plugs a USB keyboard. Something like : 2009-07-04 12:21 warning: keyboard pluged! Is that possible? I see two ways : 1. Either actively react to the... (4 Replies)
Discussion started by: chebarbudo
4 Replies

8. Shell Programming and Scripting

script to detect a file from inserted usb and puts into a Variable

There is a same named log file that I have on my 2 different android phones. When I plug it into my computer, it appears in the media folder, For example the first android phone: /media/F6BA-0AF5/folder/A.log I want to put that into a variable to be manipulated.... (3 Replies)
Discussion started by: tobenguyen
3 Replies

9. UNIX for Advanced & Expert Users

USB Device Identification

In linux system when a pnp usb device is plugged in then how does the system gets a notification of it? I mean to say in linux usb system there is usb host controller above which is host controller driver above which is usb core. So does the host controller/usb core keeps on polling the usb bus... (1 Reply)
Discussion started by: rupeshkp728
1 Replies

10. UNIX for Advanced & Expert Users

Tar on usb device

Hi, i am developing an application on an ARM 7 architatcure with a small Linux. i want to run tar on a usb device (~10 Mb) but it runs realy slow. the command only takes 1% of cpu usage. is there a way to improve the tar command or is the USB-Connection the bottleneck here? (4 Replies)
Discussion started by: louisk
4 Replies
hubd(7D)							      Devices								  hubd(7D)

NAME
hubd - USB hub driver SYNOPSIS
hub@unit-address DESCRIPTION
The hubd is a USBA (Solaris USB Architecture) compliant client driver that supports USB hubs conforming to the Universal Serial Bus Speci- fication 2.0. The hubd driver supports bus-powered and self-powered hubs. The driver supports hubs with individual port power, ganged power and no power switching. When a device is attached to a hub port, the hubd driver enumerates the device by determining its type and assigning an address to it. For multi-configuration devices, hubd sets the preferred configuration (refer to cfgadm_usb(1M) to select a configuration). The hubd driver attaches a driver to the device if one is available for the default or selected configuration. When the device is disconnected from the hub port, the hubd driver offlines any driver instance attached to the device. FILES
/kernel/drv/hubd 32- bit x86 ELF kernel module /kernel/drv/amd64/hubd 64- bit x86 ELF kernel module /kernel/drv/sparcv9/hubd 64-bit SPARC ELF kernel module ATTRIBUTES
See attributes(5) for a description of the following attributes: +-----------------------------+------------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+------------------------------+ |Architecture |SPARC, x86, PCI-based systems | +-----------------------------+------------------------------+ |Availability |SUNWusb | +-----------------------------+------------------------------+ SEE ALSO
cfgadm_usb(1M), attributes(5), usba(7D) Writing Device Drivers Universal Serial Bus Specification 2.0 System Administration Guide: Basic Administration http://www.sun.com/io DIAGNOSTICS
In addition to being logged, the following messages may also appear on the system console. Messages are formatted in the following manner: WARNING: <device path> <hubd<instance number>): Message... where <instance number> is the instance number of hubd and <device path> is the physical path to the device in /devices directory. Messages from the root hub are displayed with a usb<instance number> prefix instead of hub<instance number> as the root hub is an integrated part of the host controller. Connecting device on port <number> failed. The driver failed to enumerate the device connected on port <number> of hub. If enumeration fails, disconnect and re-connect. Use of a USB 1.0 hub behind a high speed port may cause unexpected failures. Devices connected to a USB 1.0 hub which are in turn connected to an external USB 2.0 hub, may misbehave unexpectedly or suddenly go offline. This is due to a documented incompatibility between USB 1.0 hubs and USB 2.0 hub Transaction Translators. Please use only USB 2.0 or USB 1.1 hubs behind high-speed ports. Connecting a high speed device to a non-high speed hub (port x) will result in a loss of performance. Please connect the device to a high speed port to get the maximum performance. USB 2.0 devices connected to USB 1.0 or 1.1 hubs cannot run at their highest speed, even when the hub is in turn connected to a high- speed port. For best performance, reconnect without going through a USB 1.0 or 1.1 hub. Cannot access <device>. Please reconnect. This hub has been disconnected because a device other than the original one has been inserted. The driver informs you of this fact by displaying the name of the original device. Port <n> overcurrent. An overcurrent condition was detected. Please remove the device on this port. Devices not identical to the previous one on this port. Please disconnect and reconnect. Same condition as described above; however in this case, the driver is unable to identify the original device with a name string. Hub driver supports max of <n> ports on hub. Hence, using the first <number of physical ports> of <n> ports available. The current hub driver supports hubs that have <n> ports or less. A hub with more than <n> ports has been plugged in. Only the first <n> out of the total <number of physical ports> ports are usable. Hub global over current condition, please disconnect the devices connected to the hub to clear the condition. You may need to re-connect the hub if the ports do not work. An overcurrent condition was detected on the hub. This means that the aggregate current being drawn by the devices on the down- stream ports exceeds a preset value. Refer to section 7.2.1.2 and 11.13 of the Universal Serial Bus Specification 2.0. If this message continues to display, you may need to remove downstream devices to eliminate the problem. If any port does not work after the overcur- rent condition is cleared, re-connect the hub to re-enable the ports. Root hub over current condition, please check your system to clear the condition as soon as possible. You may need to reboot the system if the root hub does not recover automatically. An overcurrent condition was detected on the root hub, indicating that malfunctioning devices on the downstream ports are drawing too much current. Please disconnect the problematic downstream devices to eliminate the problem. If the root hub doesn't work after the overcurrent condition is cleared, you may need to reboot the system. The following messages may be logged into the system log. They are formatted in the following manner: <device path><hubd<instance number>): message... Local power has been lost, please disconnect hub. A USB self-powered hub has lost external power. All USB devices connected down-stream from this hub will cease to function. Disconnect the hub, plug in the external power-supply and then plug in the hub again. Local power has been lost, the hub could draw <x> mA power from the USB bus. A USB self/bus-powered hub has lost external power. Some USB devices connected down-stream from this hub may cease to func- tion. Disconnect the external power-supply and then plug in the hub again. Two bus-powered hubs cannot be concatenated. A bus-powered hub was connected to a bus powered hub port. Please remove this bus-powered hub and connect it to a self-powered hub or a root hub port. Configuration <n> for device <device> at port <m> exceeds power available for this port. Please re-insert your device into another hub port which has enough power. The device requires more power than is available on this port. Port <n> in over current condition, please check the attached device to clear the condition. The system will try to recover the port, but if not successful, you need to re-connect the hub or reboot the system to bring the port back to work. An overcurrent condition was detected on port <n>. This means the device connected to the port is drawing more current than the hub can supply. If this message continues to display, please disconnect the device to eliminate the problem. If the port doesn't work after the overcurrent condition is cleared, please re-connect the hub or reboot the system to enable the port again. SunOS 5.11 6 July 2006 hubd(7D)
All times are GMT -4. The time now is 11:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy