去掉发送数据连接状态判断
authorliangzhenying <867174124@qq.com>
Tue, 23 Jul 2024 08:16:58 +0000 (16:16 +0800)
committerliangzhenying <867174124@qq.com>
Tue, 23 Jul 2024 08:16:58 +0000 (16:16 +0800)
IOTBluetooth/IOTBluetooth/Example/Datas.swift
IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate
IOTBluetooth/IOTBluetooth/IOTBluetooth/IBManager.swift
IOTBluetooth/IOTBluetooth/IOTBluetooth/IBluetooth.swift

index 40f36fd..98c64a2 100644 (file)
@@ -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, "结束运动模式", []),
index bc4f4ca..693f765 100644 (file)
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
index 8ed4999..a9b76da 100644 (file)
@@ -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 }
index db38a08..d626767 100644 (file)
@@ -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)