user459908
user459908

Reputation: 1

Detect external hardware which is connectd to iPhone

I need to detect an external hardware which is connected to the iPhone. Let say when the camera is running in our application and user plugss an external hardware device which is a camera and default behavior is propagated to the external hardware. In that scenarios how does the program know that the external hardware is plugged? Simply its detecting a external device notification as I suppose. How does it work.

Update: Also note that once I do that I need to interact with that camera. Let say if its a 2nd generation iPod how will I do that. Please help me.

Upvotes: 0

Views: 819

Answers (2)

manishnath
manishnath

Reputation: 444

I have just tried the demo porvided by Apple know as EADemo. I am giving you the link. I think it is sufficient enough to understand External Accessory Identification through 30 pin dock or Bluetooth. The link is http://developer.apple.com/library/ios/#samplecode/EADemo/Introduction/Intro.html

Upvotes: 1

Brad Larson
Brad Larson

Reputation: 170317

As hotpaw2 and Aaron indicated, you can only detect this connection if the hardware is compliant with Apple's Made for iPod program and it publishes a protocol for interaction through the External Accessories framework.

If that hardware meets those specifications, you can listen for the appropriate notifications: EAAccessoryDidConnectNotification and EAAccessoryDidDisconnectNotification.

I highly recommend watching the WWDC 2010 video session 201 - "Developing Applications that work with iPhone OS Accessories" and reading the above-linked documentation. Communication with these devices is reasonably simple to do, but it's up to the hardware vendor to make them easy to interact with. There is no generic protocol for handling data from an accessory that is a camera, so you'll need to work with the vendor to understand the data stream it provides.

Upvotes: 2

Related Questions