How can I access the USB on my iPhone via Python / C? - iphone

I was wondering how to get access to the USB (kind of /dev/usb) on my jailbroken iPhone,
and how could I listen what is going on ( when I plug a device on my iPhone ) for a debug purpose (because I try to create a device that I could connect directly on my iPhone).
Thanks.

You need to be a member of the MFi Program to get access to development information for iOS Accessories.

Related

Create an iPad app that can send/receive data via the USB cable?

I want to create an iPad app that connects to another machine, laptop or otherwise, via USB and communicates to some other application I develop running there.
I know that this is easy to achieve via Bluetooth or WiFi but this particular set of solutions must be done via a USB cable.
Is it possible to do so without access to the Apple MFi program? (I am about 5 weeks in and the response is not looking good).
iOS App --> USB Cable --> Mac OSX --> Desktop App (without MFi access)
Thanks
To use USB communication Apple does not provide any API within IOS SDK. The only option right now is MFI. I don't think Apple will allow this in near future.
To use serial communication, you need MFI as you may have discovered. However, there is a poor man's way of achieving this. I have done so during development.
Enable "Internet sharing" on your device and connect to it. Use "ifconfig" on your Mac to find out the interface to use. You do not need to use this as the default connection, but it needs to be active. If I remember correctly, only one end can initiate connections (it was a while so I am sorry that I don't remember the details).
EDIT: I would also like to point out that I did this on an iPhone, not an iPad.
Not over USB but over RS232 (serial port)
Look here: http://www.redpark.com/c2db9.html
But:
The cable uses the old 30 pin connector, but according to them it's compatible with the Lightning adapter
The application won't be accepted on the AppStore, it's for internal use only.
There is a (small) book that explains how to use this cable to connect an iPhone directly to an Arduino, it's been published in late 2011. "iOS Sensor Apps with Arduino Wiring the iPhone and iPad into the Internet of Things" http://shop.oreilly.com/product/0636920021179.do

If a bluetooth device is not in the MFi program, which profiles should it support so that an IPhone app can check it MAC or name?

I would like to build an IPhone app that should check the identity of a BT device, by name or MAC.
If the device is not part of the MFI programme what profiles should the device support in order for an IPhone app to connect to it and validate its MAC or name ?
Cheers,
Ionut
I'm not sure you need to connect to something to get a MAC address or a name. My coworker's iphone seems to see all other bluetooth devices in our work area and displays the names, it just won't connect to them. And I'm sure it gets the MAC before it gets the name, but avoids displaying it to the user because names are a lot more friendly.
I do know that with android and blackberry, you actually use MAC addreses as your basic internal identifier, and only pull out the name when you want to identify your remote devices to the user.
If you really do need to make a connection from iOS to non MFi bluetooth radio, the advanced audio distribution profile (A2DP) would do what you want. There's a product out there I've seen that is a bluetooth controlled power board, and it used audio pulses being transmitted over A2DP to get around MFi requirements. Though you should reconsider this approach because it's problematic for a non audio device to advertise an audio profile. And this fake audio device will get seen by by a lot more than your application.
If you're happy to only work with iphone 4s and above, I've also heard rumours that bluetooth LE(4.0?) devices are not required to have the apple verification chip... but haven't really looked into it

iPhone UDP ad hoc datas transfert

I'm trying to make an iPhone application to communicate with an other wireless device.
The other device can send datas via UDP sockets. I just want to know if it is possible to receive the informations on the iPhone, without access point on the network (just an iPhone and the wireless device), and how if it is.
I was looking at UDPecho, by apple, and I think it could be useful.
If anyone had some idea, just let me know what you're thinking about
iPhone 4 with iOS 4.3 can create a Wi-Fi network using the Personal Hotspot feature, which your "other device" could join.
A Verizon iPhone with 4.2.6 may also be able to do this.
Earlier iPhone models can't use the Personal Hotspot feature, regardless of the version of iOS.

iPhone interaction between PC app and iPhone app using USB

I know since the 3.0 SDK we can use accessories, so my question is simple, what is the process to make an iPhone app and PC (or Mac) app interact, using the USB ?
I don't ask you any code, but just the paths and the keys for making that work.
Have I to access the iPhone disk through SSH and work with files ?
Or can I send data from the iPhone app and intercept (get) it on the PC app (and send data from PC to iPhone) ?
Thanks, and if this question is stupid, just tell me, I didn't find on Dev Center (I don't really know what I have to looking for...) !
Edit : I read some news from Microids, they will synchronize PC and iPhone games (i.g here), and somewhere (I can't find it again) they say connecting the iPhone on the USB, so I think this is possible
USB access on the phone is only supported via the External Accessory Framework. You cannot hook the iPhone up to arbitrary USB devices, the devices actually have to support the EA protocol. You can get more details about it via the Made for iPhone program.
Other than that there is no USB access available on to applications.
You want the External Accessory Framework. Having said that, I'm not sure that Apple's intention was for you to communicate with an application on a PC/Mac. It's really for talking to accessories such as iPod docks, remote controls, etc. Apple may not allow an application that talks to a PC in this manner in the App Store.
You might be interested in ssh_relay (earlier called iphone_tunnel).
There is a /System/Library/Lockdown/Services.plist on your iPhone and you can start any such services via AMDeviceStartService and then communicate with it.
The ssh_relay demonstrates how to do that by having a simple port forwarder as a service on the iPhone site and the client application on your PC, so you can forward any local iPhone port to your PC. This is not exactly what you wants here (it is handy in the case you have already another service running on the iPhone which communicates via simple TCP and you want to access that; for example SSH) but based on this example, it should be straight-forward to have any communication between the service (in Services.plist) and your PC.

iphone blue tooth connection

could i connect iPhone and collect data from other bluetooth device (it may be iphone , ipod, nokia or other blue tooth device, like PC and so on.) from my own application. ?
if it is possible which way is the easiest . like GameKit framework ?
pls help me
With the SDK the GameKit framework is your only choice.
You are not allowed to low-level access to Bluetooth devices, also knowing apple and their policy on connecting external devices to their iPods, it would take some kind of chip and licensing deal for a vendor to be able to connect their device to an iPhone. So I am guessing that not all bluetooth devices will be abble to connect to your iPhone