恢复 USB 相机连接、边拍边传、三品牌驱动与 SwiftUI 历史导入页,通过适配层对接现有本地上传与 OSS 管道。 Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
624 B
Swift
21 lines
624 B
Swift
import Foundation
|
|
|
|
/// 将 OTG 引擎连接状态映射为有线传图页展示状态。
|
|
extension ConnectionState {
|
|
/// 转换为旅拍有线传图 UI 使用的连接状态。
|
|
var cameraConnectionState: CameraConnectionState {
|
|
switch self {
|
|
case .idle, .disconnected:
|
|
return .disconnected
|
|
case .searching:
|
|
return .searching
|
|
case .connecting:
|
|
return .connecting
|
|
case .connected(_, let deviceName):
|
|
return .connected(deviceName: deviceName)
|
|
case .failed(let message):
|
|
return .error(message)
|
|
}
|
|
}
|
|
}
|