将 otg_swift OTG 引擎迁入 Core/CameraOTG,并接入旅拍有线传图与历史导入。
恢复 USB 相机连接、边拍边传、三品牌驱动与 SwiftUI 历史导入页,通过适配层对接现有本地上传与 OSS 管道。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -0,0 +1,20 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user