Inquiry)
A Linux-based embedded device is connected to an iPhone using a USB-C cable.
The device operates as a USB device and presents a standard CDC-ECM Ethernet interface. The iPhone operates as the USB host.
When the iPhone screen is on:
- 以太网接口被正确识别。
- 分配IPv4和IPv6地址。
- 互联网接入正常。
大约在 iPhone 被锁定 30 秒后,USB 连接进入暂停状态,以太网数据传输停止。
我们启用了USB远程唤醒。定期触发它有助于保持以太网接口的可用,当 iPhone 屏幕开启时网络会恢复。然而,屏幕关闭时以太网数据仍然无法保持活跃状态。
问题)
- 这在iOS上是正常的行为吗?
- 有没有支持的方法可以在 iPhone 锁定时保持 USB 以太网数据活跃?
- USB远程唤醒是否支持输入网络流量?
- 助理在恢复后是否需要发送任何CDC链接通知?
- 这需要支持MFi还是特定的iOS权限?
谢谢。
The behaviour you’ve described doesn’t surprise me. I’ve not looked into the Ethernet side of this, but what you’re seeing closely matches the Wi-Fi behaviour. That is:
- If you lock the screen, your app moves to the background and shortly thereafter gets suspended, meaning that it’s unable to perform networking.
- If the device sleeps, the system disassociates from Wi-Fi.
I talk about these ideas in a lot more detail in the various posts linked to from Extra-ordinary Networking.
Does this require MFi support … ?
AFAIK MFi doesn’t have any specific provisions for Ethernet.
Does this … a specific iOS entitlement?
AFAIK there are no entitlements related to this.
What’s the actual problem you’re trying to solve here?
I suspect that you’re trying to communicate between your app and this Ethernet-based accessory. If that’s the case then the issue here isn’t really the Ethernet side of things, but rather your app. Apps in the background typically get suspended, and thus can’t do networking. In some circumstances it may be possible to stay running in the background, but those facilities all have limits. See iOS Background Execution Limits.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"