No Jailbreak Data Interfacing with iOS

So, I’ve been playing around with the mindwave and I’ve been working on a few (real world) work projects and I thought about integrating them.

The mindwave stuff I’ve already touched on here in the blog.

The work related stuff is mostly to do with mobile app development.  I’ve been working both with iOS devices and Android devices (both phones and tablets).  What struck me is how much easier it is to get data into an Android device as compared to an iOS device.

Apple does not make it easy to get data into their devices.

I tried using a Bluetooth module (Sparkfun’s Bluesmirf).  No dice.

I looked at using a serial interface over the port at the bottom of the device.  This will only work on a jail broken device (and requires a fair amount of work even then).

Then I remembered seeing a project from Maker Faire written up in the Make Magazine Blog.  They did some data transfer over the headphone jack.  My first thought was that their was a serial port there (and perhaps in the newer iOS platforms there is), but it turns out that the system was using Frequency Shift Keying.  This is the same method used by old modems that worked over telephone lines.

Here are the articles that I’m working from:

So, to ring in the new year, I soldered up a (barely functional) connector that will work on a breadboard to interface between an iOS device and an Arduino (yet another work project toy).

Also, the source code for the iOS device is provided in the second link (ironically, under iPhone Source Code).  To get it to build under iOS 4.3, you need to make the following change:

In lockfree.h, the get function of the queue class needs to be modified.  If it’s not modified you get the following two errors:

  • Invalid conversion from ‘char’ to ‘const char*’
  • Initializing argument 1 of ‘int remove(const char*)’

Change it from (Line 377):

// Pop a data item off the head of the list
bool get(T& data)
     return remove(data);
// Pop a data item off the head of the list
bool get(T& data)
     return this->remove(data);

Finally, if you want to know how to get line numbers displayed in XCode 4, go to XCode/Preferences/Text Editing/Editing/Show/Line Numbers and make sure it’s checked.