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:
20
Sources/DuooomiBleSDK/Protocol/ProtocolFrame.swift
Normal file
20
Sources/DuooomiBleSDK/Protocol/ProtocolFrame.swift
Normal file
@@ -0,0 +1,20 @@
|
||||
import Foundation
|
||||
|
||||
/// BLE 协议帧结构
|
||||
/// 格式: [head:1][type:1][subpageTotal:2][curPage:2][dataLen:2][data:N][checksum:1]
|
||||
public struct ProtocolFrame: Sendable {
|
||||
/// 传输方向标识 (0xC7 = APP→Device, 0xB0 = Device→APP)
|
||||
public let head: UInt8
|
||||
/// 命令类型,对应 CommandType
|
||||
public let type: UInt8
|
||||
/// 总分包数 (0 = 单帧不分包)
|
||||
public let subpageTotal: UInt16
|
||||
/// 当前包序号 (从 total-1 倒数到 0)
|
||||
public let curPage: UInt16
|
||||
/// 数据段字节长度
|
||||
public let dataLen: UInt16
|
||||
/// 数据段内容
|
||||
public let data: Data
|
||||
/// 校验字节
|
||||
public let checksum: UInt8
|
||||
}
|
||||
Reference in New Issue
Block a user