From: liangzhenying <867174124@qq.com> Date: Sat, 3 Aug 2024 03:00:31 +0000 (+0800) Subject: 有命令正在执行中bug修复 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.js?a=commitdiff_plain;h=02244cc37cd47bfc4015c505c3fedd9b7d1ba8da;p=mirrors%2FIOTBluetooth-iOS.git 有命令正在执行中bug修复 --- 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 5a4b6fd..44bad9f 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/IBAiManager.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBAiManager.swift index 1519b30..175b685 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBAiManager.swift +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBAiManager.swift @@ -14,6 +14,7 @@ class IBAiManager{ var reply = "" init(){ + MixSdk.shared.isDebug = true setupChatCallBack() } @@ -145,13 +146,17 @@ extension IBAiManager{ reply = "" } else if model.type == "end" { - let model = IBAiResponse() - model.type = 2 - model.value = reply - sendRelpy(model: model) +// let model = IBAiResponse() +// model.type = 2 +// model.value = reply +// sendRelpy(model: model) } else if model.type == "middle"{ - reply += model.content ?? "" +// reply += model.content ?? "" + let data = IBAiResponse() + data.type = 2 + data.value = model.content ?? "" + sendRelpy(model: data) } } } diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBluetooth.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBluetooth.swift index 02f9676..f63c91c 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBluetooth.swift +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBluetooth.swift @@ -143,10 +143,14 @@ class IBBluetooth: NSObject { sender.completion(.response.code(.failure).message("有命令正在执行中...")) sender.remove() Logger.log("有命令正在执行中...") + if Self.timer == nil{ + startTimer() + } return } - lastSender = sender + startTimer() + lastSender = sender for dataPacket in sender.dataPacket { Thread.sleep(forTimeInterval:0.02)