Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting hardware on USB port




Check /Developer/Examples/IOKit/USB/

Mac OS X USB User Space Sample Code

This directory contains three example ProjectBuilder projects for writing USB drivers which operate in User Space.

USBSimpleExample

This project shows the basics of how to connect to and communicate with a USB device from User Space. It is written as a standard Unix tool.

USBNotificationExample

This project shows how to use the IOKit notification mechanism to register to be notified when devices come and go. It uses the Cypress/Anchor EZ-USB chip. (Look at the following example for another way to get notified when a device is unplugged).

Another USB Notification Example

Another sample that demonstrates how to use IOKitLib and IOUSBLib to set up asynchronous callbacks when a USB device is attached to or removed from the system is located at:

http://developer.apple.com/samplecode/Sample_Code/Devices_and_Hardware/USB/USBPrivateDataSample.htm

It also shows how to associate arbitrary data with each device instance (which can be used to distinguish between identical devices).


Ciaó!

TIFF image


Ron Fondo, Product & Development Manager
The Printing House, Inc.
1-800-277-7687 ext. 3149
email@hidden
http://rde.theprintinghouse.net/
AIM: ronfondo

"Oh do pay attention 007. In the wrong hands, this Dual 2.5GHz Power Mac G5 could be very dangerous."


On Mar 8, 2005, at 1:23 PM, Bernardo Hoehl wrote:

Hi List,


This is a very simple one:

I have a special hardware that I use as a Input-Output device.

I can see the hardware on Apple System Profiler as:

IO-Warrior24:

Vendor Name: Code Mercenaries
Product ID: 5377 ($1501)
Speed: Up to 1.5 Mb/sec
Serial Number: 0000061E
Bus Power (mA): 500


Question:

Is there a simple way to detect when the hardware is plugged in the USB port and launch my own app automatically?

I mean like it happens when you plug in an iPod or camera, iTunes or iPhoto is launched automatically.

I greatly appreciate your comments...


Best regards,


Bernardo Höhl
Rio de Janeiro - Brazil
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden

References: 
 >Detecting hardware on USB port (From: Bernardo Hoehl <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.