How does this iOS app communicate over the USB port?
Asked Answered
F

2

33

This app promises to turn your iOS device into a second monitor and uses the standard USB cable to connect to the computer, as opposed to the network which all other similar apps use.

Back when I heard about it, it wasn't yet available so I thought it was a scam. To my surprise, they released the app and it actually works as described.

How does it work ? As far as I know there are no APIs to drive the USB port in iOS, and the computer connected via USB through the standard charging/syncing cable doesn't count as an MFI accessory.

Note that they provide the server software (the one that installs on the Mac and streams the desktop to the device) on their download page for free, reverse-engineering it could shed some light on this but I unfortunately don't have the skills for that.

Frydman answered 24/1, 2015 at 10:15 Comment(0)
D
40

Dean told about it on his blog.

Duet uses Peertalk, an open source library allowing to pass TCP connections through the USB connection without being part of the MFI program.

Deane answered 25/2, 2015 at 9:41 Comment(4)
Thank you so much, finally a correct answer. I've edited it to include a bit more details so it isn't a link-only answer anymore.Frydman
does peertalk work on windows to allow it to connect to iOS device using USB cable ?Ultraism
@Ultraism On windows, there is a open source library "libimobiledevice". You could define the same protocol as peertalk, then you could communicate with iOS devices.Assizes
How does one get the port number of the attached device?Bainite
N
6

The information, code and tools to accomplish generic USB port communication is available to those who join the Apple MFi program. You have to do the paperwork and get licensed by Apple.

http://developer.apple.com/programs/mfi/

The libraries necessary are included in the app and then the usual streaming libraries and code do the rest.

Nolanolan answered 24/1, 2015 at 17:4 Comment(5)
But doesn't MFI require a custom device implementing the accessory protocol at the end, and not just a computer and the standard Lightning<->USB cable ?Frydman
I would think that the Mac OS and iOS get along in that regard. I am confused as Andre says the system uses a standard USB cable when the Duet website clearly says the lightning or 30 pin cable is necessary.Nolanolan
Yeah, by "standard USB cable" I meant the standard Lightning to USB or Dock to USB cables we're used to, as opposed to a custom made cable that appears as an MFI accessory to the iOS device.Frydman
Connections are accomplished using the ExternalAccessory.framework. Duet then installs audio and video drivers that do the rest.Nolanolan
Could you provide more detail, and if possible some sample code ? I find it hard to believe that if this is true, why is Duet the only app to have done this so far...Frydman

© 2022 - 2024 — McMap. All rights reserved.