let datas: [(ability: IBAbility, label: String, parameters: [IBParameter])] = [
+ (.sendSchedule,"发送日程管理给手表",[.sendSchedule([IBSchedule()])]),
(.getSosContact,"获取OS紧急联系人",[]),
(.setSosContact,"设置SOS紧急联系人",[.setSosContact([IBContact()])]),
3F6A07CC2D2D2C3F00F4122A /* IBPassword.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F6A07CB2D2D2C3F00F4122A /* IBPassword.swift */; };
3F9355B72D38FF2100C54DAB /* IBPush.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F9355B62D38FF1900C54DAB /* IBPush.swift */; };
3FFAE0552D3A042900325873 /* IBContact.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FFAE0542D3A03EF00325873 /* IBContact.swift */; };
+ 3FFAE0572D3A2CFF00325873 /* IBSchedule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FFAE0562D3A2CF800325873 /* IBSchedule.swift */; };
8A0A39BF2B980BEF006A3B18 /* IOTBluetooth.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A0A39BE2B980BEF006A3B18 /* IOTBluetooth.h */; settings = {ATTRIBUTES = (Public, ); }; };
8A0A39C62B980C88006A3B18 /* IBluetooth.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A0A39C52B980C88006A3B18 /* IBluetooth.swift */; };
8A0A39C92B980CC2006A3B18 /* CoreBluetooth.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8A0A39C82B980CC2006A3B18 /* CoreBluetooth.framework */; };
3F6A07CB2D2D2C3F00F4122A /* IBPassword.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IBPassword.swift; sourceTree = "<group>"; };
3F9355B62D38FF1900C54DAB /* IBPush.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IBPush.swift; sourceTree = "<group>"; };
3FFAE0542D3A03EF00325873 /* IBContact.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IBContact.swift; sourceTree = "<group>"; };
+ 3FFAE0562D3A2CF800325873 /* IBSchedule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IBSchedule.swift; sourceTree = "<group>"; };
8A0A39BB2B980BEF006A3B18 /* IOTBluetooth.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = IOTBluetooth.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8A0A39BE2B980BEF006A3B18 /* IOTBluetooth.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IOTBluetooth.h; sourceTree = "<group>"; };
8A0A39C52B980C88006A3B18 /* IBluetooth.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IBluetooth.swift; sourceTree = "<group>"; };
3F6A07CB2D2D2C3F00F4122A /* IBPassword.swift */,
3F9355B62D38FF1900C54DAB /* IBPush.swift */,
3FFAE0542D3A03EF00325873 /* IBContact.swift */,
+ 3FFAE0562D3A2CF800325873 /* IBSchedule.swift */,
);
path = Models;
sourceTree = "<group>";
18EF69512C45130200AA0A36 /* IBAiManager.swift in Sources */,
18204C022C199D0E00F94E69 /* IBFileSender+Ota.swift in Sources */,
18EC6E282BFF4C6D00757CA8 /* IBPhoneInfo.swift in Sources */,
+ 3FFAE0572D3A2CFF00325873 /* IBSchedule.swift in Sources */,
18EF69532C45136800AA0A36 /* IBPairling.swift in Sources */,
18C9589F2C086A9D006A5DE8 /* IBHistorySleep.swift in Sources */,
180220CE2C2D5D560090D34A /* IBAiResponse.swift in Sources */,
uuid = "2CC27BE0-931D-4412-B83C-49E80F4BA55C"
type = "1"
version = "2.0">
- <Breakpoints>
- <BreakpointProxy
- BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
- <BreakpointContent
- uuid = "F50E648D-FC87-4335-B9B9-976A5D8720FA"
- shouldBeEnabled = "Yes"
- ignoreCount = "0"
- continueAfterRunningActions = "No"
- filePath = "IOTBluetooth/IBChecker.swift"
- startingColumnNumber = "9223372036854775807"
- endingColumnNumber = "9223372036854775807"
- startingLineNumber = "332"
- endingLineNumber = "332"
- landmarkName = "check(_:)"
- landmarkType = "7">
- </BreakpointContent>
- </BreakpointProxy>
- </Breakpoints>
</Bucket>
/// - Parameter setSosContact: see ``[IBContact]``
static let setSosContact = IBAbility.long.id(0x25).parser(IBGeneralParser.self).checker(IBSetSosChecker.self)
-
+ /// 发送日程管理给手表
+ /// - Parameter sendSchedule: see ``[IBSchedule]``
+ static let sendSchedule = IBAbility.long.id(0x24).parser(IBGeneralParser.self).checker(IBSendScheduleChecker.self)
/// 设置用户数据
guard case let .setPassword(value) = parameters[.setPassword] else { fatalError("缺少参数: SetPassword") }
Logger.log(value.description)
- var psd = value.password
+ let psd = value.password
var data:[UInt8] = [UInt8(value.type)]
if value.type == 1 {
for i in 0..<psd.count{
}
struct IBSetSosChecker: IBChecker {
static func check(_ parameters: [IBParameter]) -> [UInt8] {
- guard case let .setSosContact(value) = parameters[.setSosContact] else { fatalError("缺少参数: setpush") }
+ guard case let .setSosContact(value) = parameters[.setSosContact] else { fatalError("缺少参数: setSosContact") }
Logger.log(value.description)
var data = [UInt8]()
data += [value.count.byte]
return data
}
}
-
+struct IBSendScheduleChecker: IBChecker {
+ static func check(_ parameters: [IBParameter]) -> [UInt8] {
+ guard case let .sendSchedule(value) = parameters[.sendSchedule] else { fatalError("缺少参数: sendSchedule") }
+ Logger.log(value.description)
+ var data = [UInt8]()
+ for item in value {
+ data += item.id.byte2
+ if let value = item.title.data(using: .utf8),!value.isEmpty {
+ data += value.count.byte2
+ data += value.bytes
+ }
+ data += item.begin.byte4
+ data += item.end.byte4
+ if let value = item.content?.data(using: .utf8),!value.isEmpty {
+ data += value.count.byte2
+ data += value.bytes
+ }
+ else{
+ data += 0.byte2
+ }
+ }
+ return data
+ }
+}
struct IBClockChecker: IBChecker {
static func check(_ parameters: [IBParameter]) -> [UInt8] {
case setPassword = "setPassword"
case setPush = "setPushConfig"
case setSosContact = "setSosContact"
+ case sendSchedule = "sendSchedule"
}
/// 参数
case setPush([IBPush])
/// 设置SOS紧急联系人
case setSosContact([IBContact])
+ /// 向手表发送日程
+ case sendSchedule([IBSchedule])
var key: IBKey {
switch self {
case .setPassword(_): return .setPassword
case .setPush(_): return .setPush
case .setSosContact(_): return .setSosContact
+ case .sendSchedule(_): return .sendSchedule
}
}
}
/// 性别 0:男性 1:女性
public var gender: Int = 0
/// 名称
- public var name:String = "广州"
+ public var name:String = ""
/// 电话
- public var tel:String = "13480000000"
+ public var tel:String = ""
public init() { }
--- /dev/null
+//
+// IBSchedule.swift
+// IOTBluetooth
+//
+// Created by liangshi on 2025/1/17.
+//
+
+import Foundation
+/// 日程
+public class IBSchedule {
+ /// 日程id
+ public var id:Int = 0
+ /// 标题
+ public var title: String = ""
+ /// 开始时间戳
+ public var begin:Int = 1737196185
+ /// 结束时间戳
+ public var end:Int = 1737396185
+ /// 备注内容
+ public var content: String?
+
+ public init() { }
+
+ var description: String {
+ let str = "IBSchedule(title: \(title),begin:\(begin),end:\(end),content:\(content ?? ""))"
+ return str
+ }
+
+}