mattstuehler
mattstuehler

Reputation: 9292

Getting started - creating an iPhone app that controls another (non-iOS) device via bluetooth commands

All,

Apologies in advance - this question might be too open-ended for SO.

Anyway... A friend of mine (an engineer and entrepreneur) is in the process of building a high-tech piece of lab equipment. He's asked me about the feasibility of building an iPhone/iPad/iPod application that would allow users to control the device via Bluetooth, so I'm helping him gather some information. I'm hoping to get a few pointers on how to get started. Specifically:

  1. Would this require a native app, or could this be accomplished with HTML5 (with or without something like PhoneGap?)

  2. Can you point me to a good primer on bluetooth networking? Everything I've found assumed a VERY high level of pre-existing knowledge.

  3. What are the basics on how something like this is accomplished? Is there a single, established protocol for how one device "controls" another, or is bluetooth more like SSL - just a pipe that allows you to convey any type of message?

I realize this question is incredibly broad and detailed - so I'm not really looking for specifics. But obvious Google searches don't turn up much, and I'm otherwise having a hard time finding a good starting point.

Thanks in advance.

Upvotes: 1

Views: 1123

Answers (1)

Greg Price
Greg Price

Reputation: 2556

You can communicate via bluetooth in two ways: One is using the Low Energy Bluetooth capabilities of iOS 5 and newer iPhone/ipads.

https://developer.apple.com/library/ios/#documentation/CoreBluetooth/Reference/CoreBluetooth_Framework/_index.html#//apple_ref/doc/uid/TP40011295

Unfortunately the documentation is sparse and will require some hacking away. If you choose this route I would consider starting here and learning as much as you can about how the protocols work before hacking into the framework:

http://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx

The limitations of this route are that it might not be best for sending a lot of data. I have only built stuff that sent simple commands which it does work great for.

The other option is the external accessory framework. This will require you to get an mfi license from apple (not fun). You will also need to pay royalties. But it will do what you want. You won't need to concern yourself much with underlying protocols if you use this, the framework provides a friendly api for processing streams.

http://developer.apple.com/library/ios/#documentation/ExternalAccessory/Reference/ExternalAccessoryFrameworkReference/_index.html

Upvotes: 2

Related Questions