1

I came up with a project that requires me to write a driver for a micro-controller connected to an iPhone via the lightning port. Is it possible to write the driver at all, if I don't plan on releasing it to the App Store?

Also, my second question is: What language do I have to use? I'm pretty familiar with C++ and I'm completely new to Apple devices, so I have no idea if I need to use Swift.

  • Wouldn't that fall under Apples MFI program? As to your second question, no, you don't "have" to use Swift, you can use Objective C instead ;); although it does have support for c/c++, but you'll spend a lot of time writing bridging code – MadProgrammer Apr 02 '18 at 20:38
  • I would recommend https://developer.apple.com/programs/mfi/ to get started- – luk2302 Apr 02 '18 at 20:39
  • I'm pretty sure there is a way, but I don't want to throw out 90$ for taking a look if it's right (MFI) –  Apr 02 '18 at 20:40
  • 2
    @MadProgrammer don't spread misinformation `IOKit` is C++. this is the framework and language you would be using to write a driver – Brad Allred Apr 02 '18 at 21:26
  • @BradAllred Having never developed with IOKit, I wouldn't know, but thanks for the heads up – MadProgrammer Apr 02 '18 at 22:01
  • It's not possible to write drivers for iOS. The only way to access the port (and bluetooth classic) is the [ExternalAccessory Framework](https://developer.apple.com/documentation/externalaccessory). You need MFi as a hardware developer and for the AppStore. Maybe you can find this SO question useful https://stackoverflow.com/q/5908451/8918119 – Mihayl Apr 04 '18 at 06:01
  • submit it as an answer, I'll flag it as correct @MihaylA.A –  Apr 04 '18 at 06:07

1 Answers1

1

It's not possible to write drivers for iOS. The only way to access the port (and Bluetooth classic) is the External Accessory Framework.

Some common accessory features are accessible through other frameworks like Game ControllerFramework. The WWDC2013 Designing Accessories for iOS and OS X and WWDC2014 lists some of the frameworks you can use to interact with accessories.

You need MFi as a hardware vendor and for the AppStore (you need to provide your custom protocol string/s, if any). The program provides detailed information about the iPod Accessory Protocol (iAP).

Maybe you can find this SO question useful USB-Programming on iPhone

Mihayl
  • 3,821
  • 2
  • 13
  • 32
  • I have a minor nit to pick here. I believe, unless something has changed in the last few years, that if you are jailbroken you can develop `IOKit` drivers for iOS. – Brad Allred Apr 06 '18 at 18:50