demo app + SDK updates:\n- Add direct ANI transfer (prepare -> transfer)\n- Add firmware update flow (fetch latest w/ x-api-key, OTA transfer)\n- Extract x-api-key to NetworkConstants\n- Rename example app to demo; move folder and entry to DemoApp\n- Switch from SPM package dependency to local framework target\n- Enable automatic Info.plist generation for framework target\n- Add placeholder test to satisfy SwiftPM test target\n- Regenerate XcodeGen project (demo.xcodeproj)

This commit is contained in:
km2023
2026-04-09 18:41:56 +08:00
parent c33e7d3fa1
commit 7d9ff3081d
30 changed files with 2594 additions and 516 deletions

View File

@@ -0,0 +1,27 @@
import Foundation
public struct VersionInfo: Sendable, Equatable {
public let version: String
/// Int ( 7) String ( "0x07")
public let type: String
}
extension VersionInfo: Codable {
enum CodingKeys: String, CodingKey {
case version, type
}
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
version = try container.decode(String.self, forKey: .version)
// type may come as Int or String from different firmware versions
if let str = try? container.decode(String.self, forKey: .type) {
type = str
} else if let num = try? container.decode(Int.self, forKey: .type) {
type = "\(num)"
} else {
type = ""
}
}
}