Connect the Accessory to my JailBreak iPhone Device

我的梦境 提交于 2019-12-04 06:13:05

Perhaps the following articles iPhone Serial Communication may help?

iPhone/iPod Touch Serial Port Tutorial By Collin Meyer

and

iPhone Serial Communication

I got the same error when trying to open the serial port on a jailbroken iPod Touch running iOS 5.0 using a binary created with Xcode. However when I used gcc (for the iPhone with appropriate flags set) on the command line on my Mac instead of Xcode and created a command line app for iOS, the binary that was generated was able to open the serial port and read commands from my external accessory. This should be possible to create a library and link it with Xcode and have the same result (though I haven't tried it yet).

Update: Unfortunately creating a library in gcc and linking it in an Xcode project came up with the same error as before. Possible solutions:

  • call the command line app from the iOS Xcode GUI app
  • compile the app itself with gcc instead of Xcode

Actually, it's even simpler than this, found it while going through the second link in Fulvio's answer: You just need to move the app to a different directory than where Xcode normally puts them. As suggested in the blog entry, I put my app in a directory for Cydia apps (/private/var/stash/Applications), and was able to open the serial port--no gcc compiling necessary.

So my gcc-compiled command-line app was able to read from the serial port because I was executing it in the root's home directory, which also doesn't have the restrictions of the normal apps directory (/private/var/mobile/Applications)--whatever those restrictions might be.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!