From: liangzhenying <867174124@qq.com> Date: Tue, 23 Jul 2024 08:16:58 +0000 (+0800) Subject: 去掉发送数据连接状态判断 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=d5727fcca83a5ed870716db4c44babe3cbb2fcd1;p=mirrors%2FIOTBluetooth-iOS.git 去掉发送数据连接状态判断 --- diff --git a/IOTBluetooth/IOTBluetooth/Example/Datas.swift b/IOTBluetooth/IOTBluetooth/Example/Datas.swift index 40f36fd..98c64a2 100644 --- a/IOTBluetooth/IOTBluetooth/Example/Datas.swift +++ b/IOTBluetooth/IOTBluetooth/Example/Datas.swift @@ -49,7 +49,7 @@ let datas: [(ability: IBAbility, label: String, parameters: [IBParameter])] = [ (.sendUnpair, "发送取消解除配对消息", []), - (.startSport, "开启指定运动模式", [.motionMode(.running)]), + (.startSport, "开启指定运动模式", [.motionMode(.walking)]), (.trainPauseResume, "训练暂停", [.action(0)]), (.trainPauseResume, "训练恢复", [.action(1)]), (.endSport, "结束运动模式", []), 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 bc4f4ca..693f765 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/IBManager.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBManager.swift index 8ed4999..a9b76da 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBManager.swift +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBManager.swift @@ -31,7 +31,7 @@ public class IBManager { public extension IBManager { /// SDK 版本号 - static let version: String = "1.0.20" + static let version: String = "1.0.21" /// 默认为 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 db38a08..d626767 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBluetooth.swift +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBluetooth.swift @@ -132,12 +132,12 @@ class IBBluetooth: NSObject { /// 发送数据 func send(_ sender: IBSender) { - if currentConnected.peripheral.state == .disconnected{ - sender.completion(.response.code(.failure).message("手机未连上蓝牙设备")) - sender.remove() - Logger.log("手机未连上蓝牙设备!") - return - } +// if currentConnected.peripheral.state == .disconnected{ +// sender.completion(.response.code(.failure).message("手机未连上蓝牙设备")) +// sender.remove() +// Logger.log("手机未连上蓝牙设备!") +// return +// } if let _ = lastSender { sender.completion(.response.code(.failure).message("有命令正在执行中...")) @@ -165,11 +165,11 @@ class IBBluetooth: NSObject { } func send(fileData data: Data) { // Thread.sleep(forTimeInterval:0.02) - if currentConnected.peripheral.state == .disconnected{ - self.fileSender?.lastData?.fileWriteHander?(.response.code(.failure).message("手机未连上蓝牙设备")) - Logger.log("手机未连上蓝牙设备!") - return - } +// if currentConnected.peripheral.state == .disconnected{ +// self.fileSender?.lastData?.fileWriteHander?(.response.code(.failure).message("手机未连上蓝牙设备")) +// Logger.log("手机未连上蓝牙设备!") +// return +// } startTimer() Logger.log("\(writeFileCharacteristicUUID) Write:", data)