Files
duooomi-ios-sdk/Sources/DuooomiBleSDK/DuooomiBleConfig.swift
km2023 1a7bbdc625 feat: 重写 SDK 支持 iOS 12.2,移除 async/await 和 Combine
- 所有公开 API 改为 completion handler (Result<T, Error>)
- 状态通知改为 DuooomiBleSDKDelegate 协议
- 移除 Sendable、@MainActor、AsyncStream、CheckedContinuation
- 网络请求改为 URLSession.dataTask 回调
- BLE 通信改为 delegate + 闭包模式
- deployment target 降至 iOS 12.2

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 16:59:39 +08:00

42 lines
1.3 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import Foundation
/// SDK
public struct DuooomiBleConfig {
/// API
public let apiHost: URL
/// API key
public let apiKey: String
/// CDN `/`
public let cdnHost: String
/// "duomi"
public let firmwareIdentifier: String
/// "DRAFT" / "PUBLISHED"
public let firmwareStatus: String
/// ANI
public let aniWidth: Int
/// ANI
public let aniHeight: Int
/// ANI
public let aniFps: String
public init(
apiHost: URL = URL(string: "https://api.duooomi.com")!,
apiKey: String,
cdnHost: String = "https://cdn.bowong.cc/",
firmwareIdentifier: String = "duomi",
firmwareStatus: String = "DRAFT",
aniWidth: Int = 360,
aniHeight: Int = 360,
aniFps: String = "24"
) {
self.apiHost = apiHost
self.apiKey = apiKey
self.cdnHost = cdnHost.hasSuffix("/") ? cdnHost : cdnHost + "/"
self.firmwareIdentifier = firmwareIdentifier
self.firmwareStatus = firmwareStatus
self.aniWidth = aniWidth
self.aniHeight = aniHeight
self.aniFps = aniFps
}
}