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,35 @@
import CoreBluetooth
public enum BleUUIDs {
public static let service = CBUUID(string: "000002c4-0000-1000-8000-00805f9b34fb")
public static let writeCharacteristic = CBUUID(string: "000002c5-0000-1000-8000-00805f9b34fb")
public static let readCharacteristic = CBUUID(string: "000002c6-0000-1000-8000-00805f9b34fb")
public static let broadcastCharacteristic = CBUUID(string: "000002c1-0000-1000-8000-00805f9b34fb")
}
public enum FrameHead: UInt8 {
case appToDevice = 0xC7
case deviceToApp = 0xB0
}
public enum FrameConstants {
public static let maxDataSize = 496
public static let headerSize = 8
public static let footerSize = 1
/// Inter-frame delay in nanoseconds (35ms)
public static let frameIntervalNanos: UInt64 = 35_000_000
public static let screenSize = 360
}
public enum CommandType: UInt8, Sendable {
case otaPackage = 0x02
case transferBootAnimation = 0x03
case transferAniVideo = 0x05
case transferJpegImage = 0x06
case getDeviceVersion = 0x07
case getDeviceInfo = 0x0D
case bindDevice = 0x0F
case unbindDevice = 0x12
case deleteFile = 0x13
case prepareTransfer = 0x14
}