Listening on USB port for data in iPhone App - iphone

I am wanting to send data over the usb on the iphone and have it captured by my application. This application will be private and not sold. I would also like to just use the standard usb cable that is standard. Is this possible?

This is possible with Apple's MFI Program. The downside is this will probably be quite expensive and you will of course have to develop a piece of hardware that can be sold as a product for your application.
EDIT: If you look at the 'iOS Accessories' section on the MFI Program link above, it suggests that you can communicate over the 30-pin usb dock connector.

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

iPhone Bluetooth Communication Examples

I've been trying to find examples on communicating with bluetooth devices on iOS and have been coming up short. As I understand it SPP is not yet supported. At the simplest level, I'd like to send a simple 1 or 0 signal to the bluetooth device I'm creating. (It's a bluetooth switch that would turn something on and off). Is there a way to cleverly do this through the HID or HFP profiles?
The short answer to your question is that you can't connect to an arbitrary Bluetooth device you may happen to have, you can only connect to a Bluetooth device that has come through Apple's licensing program (i.e. the "Made for iPod/iPhone" label). From Apple's documentation:
Q: [The External Accessory framework allows] my application to communicate with Bluetooth devices. So why doesn't my application see the Bluetooth accessory sitting next to my iPhone?
A: The External Accessory framework is designed to allow iOS applications to communicate only with hardware accessories that are developed under Apple's MFi licensee program.
So there is no public API for accessing an arbitrary Bluetooth device from within iOS: you have to go through the External Accessory Framework to communicate via Bluetooth, and the EAF's mission is "communicate with MFi devices," not "communicate with arbitrary external devices." A sufficiently ingenious developer could probably hack something in there, but -
it's a non-trivial undertaking
you are spectacularly unlikely to get past the App Store approval process
So there's just not much percentage in it - the effort of doing so is unlikely to reward you.
If there already exists an MFi device that can be coerced into doing something that you want, that's probably your best chance - short of going through the MFi approval/licensing process yourself, of course. If you want to do so, have at it and good luck.
I'm answering this question late because Zeroxide's answer is incorrect (you can use a random Bluetooth keyboard with your iOS device because Apple implemented that connection, which is different from giving you a public API path to doing likewise) and I find Rokridi's answer to be incomplete-though-headed-in-the-right-direction.
Edit: A caveat has since been added to the linked Apple page about Bluetooth Low-Energy devices. So there's a loophole, but it's not a big one because very, very few Bluetooth LE devices have actually been produced as yet.
As far as i know, if your external device is non iOs device then you should use External Accessory Framework to communicate your application with it. Threfore, you external device should be certified by Apple through the Made for Ipod program (MFI). Hope this helps.
If you want to use classic Bluetooth (not BLE), then you have to first PAIR the iOS device to the Bluetooth device (in Settings). If you can't do that then you can't communicate with it with your app.
NO. whether device is MFi certified or not, you can connect device to iphone if bluetooth profile is HFP, or HID's (ordinary profiles. not iAP profile). Think about bluetooth headset or keyboard. does it need MFi mark on it to use? NO. Never.

Establish communication link between a device and iOS

I'm developing an iPhone/iPad app that requires it communicate with another device. I'm actually more interested in receiving input from another device that the iPhone is connected to through USB. The solution needs to work with any iOS device and cannot require it to be jailbroken.
I've heard of apps that communicate with a piece of hardware that can be plugged to the iOS' serial connection, which is similar to what I'm going to develop except that the other device I'll be connecting to is a standalone music keyboard.
best regards,
fbr
If you are developing accessories that need to connect to iOS devices and want to use your own communication mechanism then you need to join the Apple MFi program.
Several options:
Forget MFi unless you have 1000s of $ backing up your product development. Apple won't even talk to you. I've tried.
Take a look at the Serial Cable from Redpark (http://redpark.com/c2db9.html)
I've got one of those and it's ideal for apps that you can deliver on your own, but you might also be able to get them into the App Store.
Another option is to use Wifi with a Wifi-to-Serial adapter on the other end. I've used the RN-174 and RN-134 from Roving Networks successfully.
However, these solutions only get you Serial connections, but can be quite fast, especially with the RN modules. There are also Serial-to-USB converters you can use on the device's end, but that would require the device to work as a USB host, usually. If you have a USB device that wants to act as a client, these common adapters won't do the trick.
So, unless you can actually afford the MFi program, and if you really need USB connectivity, you'll have to let someone create a small box containing a USB host adapter with a Wifi chip. I don't know of a ready-made solution for this yet, although I've seen quite a few area where people would like to have such a unit.

iPhone Bluetooth application to connect to a Bluetooth printer

Has anybody succeeded in developing a bluetooth application on the iPhone that prints to a Bluetooth printer?
I have been investigating the feasibility of developing an iPhone application that could print to a Bluetooth-enabled printer. I've gone through the most of the postings in this thread and was confused by the mail exchanges.
As per my analysis:
Gamekit - can be used for bluetooth connectivity between iPhones and IPods ONLY
Bonjour - can be used for wi-fi connectivity between iPhones/IPods and bonjour-enabled printer
We can use an external accessory to connect to a third party Bluetooth-enabled printer provided the 3rd-party printer complies with the necessary regulations from Apple (registering for either “Made for iPod”/ “Works with iPhone”, and also customizing their printer with specific hardware/software, etc.)
Could someone please share their experiences?
You want their external accessory framework. Not GameKit. Happy coding!
The External Accessory framework provides support for communicating with external hardware connected to an iPhone OS–based device through the 30-pin dock connector or wirelessly using Bluetooth.
(This is exactly what you were looking for)
To detect and connect to external devices ExternalAccessoryFramework should be used.Me too developing an application for connecting iphone to other hardware devices via bluetooth .A'm facing the problem with the protocol.The protocol should be the hardware supported ones and the protocol should be given in the info plist file..
Happy coding.
You can want to try this Bluetooth printer, which is Apple MFI approved
http://www.bluebamboo.com/other_file/P25i%20Datasheet%20%28EN%29%20v1.0%2009-Oct-2011.pdf
I would bet that you would need to use Bonjour and Wi-Fi for this application. The bluetooth hardware is restricted to gameplay from what I've seen.
well i have sucsessfully accomplished bt printing on a customers I-phone both devices have to be in discovery mode to do so and then the combination wireless and bt will allow only photo printing though otherwise you will need an app

How to integrate iPhone with other non iPhone devices using serial port?

Anybody knows how to integrate iPhone with other non-iPhone devices using serial port?
You can't directly. There may be some sort of serial line (i2c) on the dock connecter, but it is not exposed through the SDK, the Made for iPhone/ExternalAccessory.framework stuff is only for USB and BT.
You could conceivably use a WiFi/serial bridge (such things do exist) since you can send whatever you want over a TCP tunnel, but I doubt that is what you want.
Underlying ExternalAccessoryFramework for 30-pin connector it's the real UART handshaking (using Tx, Rx, Gnd, Vcc and some detect pins and no flow control) but not USB. Those pins of USB are only used for iTunes, Xcode and powering. The iOS app does not need to understand UART and only needs to send/receive bytes through NSOutputStream and NSInputStream.
But you need to pay Apple for MFi(Made For iPhone) Program first and buy some confidential IC to enable your accessory to communicate with iOS. They will require you to propose a product plan and expected sales and consider whether they would accept you as a MFi manufacturer.
You can get the info on using the ExternalAccessory framework from apple's developer portal.
You can't get the required serial handshake(?) info without joining the Made for iPhone program. This requires that you are developing a commercial device.
I have tried to get information on this protocol from apple through my university and have thus far failed.
I successfully received serial communication from the Arduino on the iPhone. I made a google doc explaining my process.
https://docs.google.com/document/d/1Yi9_hcw8XSyYNCG2OJT9oHlTG-dC-Dnuc58VIULa81Q/edit