From: liangzhenying <867174124@qq.com> Date: Fri, 5 Jul 2024 09:49:50 +0000 (+0800) Subject: 声音震动设置协议调整 X-Git-Url: http://git.snicker.com.cn/sitemap.xml?a=commitdiff_plain;h=ef1239b4067e6b939b13a6ce4082de4f20ca8c4a;p=mirrors%2FIOTBluetooth-iOS.git 声音震动设置协议调整 --- diff --git a/IOTBluetooth/IOTBluetooth/Example/Datas.swift b/IOTBluetooth/IOTBluetooth/Example/Datas.swift index b1f17b8..9fc1c86 100644 --- a/IOTBluetooth/IOTBluetooth/Example/Datas.swift +++ b/IOTBluetooth/IOTBluetooth/Example/Datas.swift @@ -118,15 +118,15 @@ class Config{ } static func setVibrateSound()->IBVibrateConfig{ let model = IBVibrateConfig() - model.type = 0 - model.systemValue = 80 +// model.type = 0 +// model.systemValue = 92 // model.type = 1 -// model.ringsValue = 70 +// model.ringsValue = 48 // -// model.type = 3 -// model.ringsState = 1 -// model.vibrateState = 1 + model.type = 3 + model.ringsState = 1 + model.vibrateState = 1 return model } } diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/project.pbxproj b/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/project.pbxproj index db61b17..3fdf57c 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/project.pbxproj +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/project.pbxproj @@ -717,6 +717,7 @@ 8A0A39C32B980BEF006A3B18 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; @@ -754,6 +755,7 @@ 8A0A39C42B980BEF006A3B18 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate b/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate index b322eb2..8ccc617 100644 Binary files a/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate and b/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 7ca3830..392f79f 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -14,8 +14,8 @@ filePath = "IOTBluetooth/IBChecker.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "386" - endingLineNumber = "386" + startingLineNumber = "398" + endingLineNumber = "398" landmarkName = "unknown" landmarkType = "0"> diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBChecker.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBChecker.swift index 594b045..b9b6a6c 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBChecker.swift +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBChecker.swift @@ -137,13 +137,25 @@ struct IBSleepChecker: IBChecker { } struct IBWaterChecker: IBChecker { static func check(_ parameters: [IBParameter]) -> [UInt8] { +// guard case let .water(value) = parameters[.water] else { fatalError("缺少参数: water") } +// Logger.log(value.description) +// +// var data = [value.alertState.byte] +// if value.alertState == 1 { +// data = data + [value.alertType.byte] + value.drinkingValue.byte2 + [value.start.hour.byte] + [value.start.minute.byte] +// } +// if value.alertType == 1 { +// data = data + [value.end.hour.byte] + [value.end.minute.byte] + [value.frequency.rawValue.byte] +// } +// return data + guard case let .water(value) = parameters[.water] else { fatalError("缺少参数: water") } Logger.log(value.description) - var data = [value.alertState.byte] - if value.alertState == 1 { - data = data + [value.alertType.byte] + value.drinkingValue.byte2 + [value.start.hour.byte] + [value.start.minute.byte] + if value.alertState == 0 { + return [value.alertState.byte] } + var data = [value.alertState.byte] + [value.alertType.byte] + value.drinkingValue.byte2 + [value.start.hour.byte] + [value.start.minute.byte] if value.alertType == 1 { data = data + [value.end.hour.byte] + [value.end.minute.byte] + [value.frequency.rawValue.byte] } diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBManager.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBManager.swift index 1949760..e51b97b 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBManager.swift +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBManager.swift @@ -27,23 +27,11 @@ public class IBManager { } public static var logs: [String] { Logger.logs } - - -// public static func redirectNSlogToDocumentFolder() { -// let filePath: String = NSHomeDirectory () + "IOTBluetooth_\(Date().format(.long)).log" -// let defaultManager = FileManager.default -// try? defaultManager.removeItem(atPath: filePath) -// -// print("log path = " + filePath) -// -// freopen(filePath.cString(using: String.Encoding.ascii), "a+", stdout) -// freopen(filePath.cString(using: String.Encoding.ascii), "a+", stderr) -// } } public extension IBManager { /// SDK 版本号 - static let version: String = "1.0.15" + static let version: String = "1.0.17" /// 默认为 false static var isDebug: Bool = false { didSet { Logger.isDebug = isDebug } diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBluetooth.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBluetooth.swift index 3d27b94..0a7756c 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBluetooth.swift +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBluetooth.swift @@ -135,7 +135,7 @@ class IBBluetooth: NSObject { /// - sender: 消息类 func send(_ sender: IBSender) { if let _ = lastSender { -// sender.completion(.response.code(.failure).message("有命令正在执行中...")) + sender.completion(.response.code(.failure).message("有命令正在执行中...")) sender.remove() Logger.log("有命令正在执行中...") return