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>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
public struct BindingResponse: Codable, Sendable, Equatable {
|
||||
public struct BindingResponse: Codable, Equatable {
|
||||
public let type: Int
|
||||
/// 设备 SN 码 (14 位)
|
||||
public let sn: String
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
public struct DeleteFileResponse: Codable, Sendable, Equatable {
|
||||
public struct DeleteFileResponse: Codable, Equatable {
|
||||
public let type: Int
|
||||
/// 0 = 成功, 1 = 失败, 2 = 文件不存在
|
||||
public let success: Int
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
public struct DeviceInfo: Sendable, Equatable {
|
||||
public struct DeviceInfo: Equatable {
|
||||
public let allspace: UInt64
|
||||
public let freespace: UInt64
|
||||
public let name: String
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
public struct PrepareTransferResponse: Codable, Sendable, Equatable {
|
||||
public struct PrepareTransferResponse: Codable, Equatable {
|
||||
public let type: Int
|
||||
public let key: String
|
||||
/// "ready" | "no_space" | "duplicated"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
public struct UnbindResponse: Codable, Sendable, Equatable {
|
||||
public struct UnbindResponse: Codable, Equatable {
|
||||
/// 1 = 成功, 0 = 失败
|
||||
public let success: Int
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
public struct VersionInfo: Sendable, Equatable {
|
||||
public struct VersionInfo: Equatable {
|
||||
public let version: String
|
||||
/// 命令类型标识,设备可能返回 Int (如 7) 或 String (如 "0x07")
|
||||
public let type: String
|
||||
|
||||
Reference in New Issue
Block a user