Hi,
Do Apps(not carplay) can access USB NCM interface to communicate with the accessory on IOS?
I want to develop the APP to communicate with my accessory based on the USB NCM.
BR, Carl
iOS has full support for USB Ethernet. If you attach such an accessory, and the Ethernet is connected to the wider Internet, iOS will bring up TCP/IP on that interfaces and set it as the default route. Apps have access to this interface in the same way they have access to Wi-Fi.
Things get more complicated when your Ethernet does not lead to the wider Internet, which is typically what happens when you try to use this for accessory integration. iOS will still add the interface to TCP/IP but it won’t become the default route. Apps can access such interfaces, but there are restrictions.
I have a lot of background to this stuff in the various posts linked to by Extra-ordinary Networking. Specifically, heed the high-level guidance in Working with a Wi-Fi Accessory, that is, support IPv6 and Bonjour.
My advice is that you prototype this with an off-the-shelve USB Ethernet device. Connect the Ethernet side of that to a switch and hence to a computer that emulates your accessory. You can then see create a prototype iOS app that accesses this emulated accessory. If that works — and I suspect it’ll work pretty well — you can take the next steps.
IMPORTANT In the above, “emulates” dosen’t mean “emulates your accessory in its entirety”. You just need to set up enough networking for your prototype app. That could, for example, be a stock HTTP server.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"