From: liangzhenying <867174124@qq.com> Date: Wed, 26 Jun 2024 02:29:50 +0000 (+0800) Subject: 删除表盘调试 X-Git-Url: http://git.snicker.com.cn/sitemap.xml?a=commitdiff_plain;h=1f810f9c18299a2a6bfe5d46edcc57c51686e388;p=mirrors%2FIOTBluetooth-iOS.git 删除表盘调试 --- diff --git "a/Doc/\343\200\220230\343\200\221\350\223\235\347\211\231\346\211\213\350\241\250\351\200\232\350\256\257\345\215\217\350\256\256.docx" "b/Doc/\343\200\220230\343\200\221\350\223\235\347\211\231\346\211\213\350\241\250\351\200\232\350\256\257\345\215\217\350\256\256.docx" new file mode 100644 index 0000000..86a8bf8 Binary files /dev/null and "b/Doc/\343\200\220230\343\200\221\350\223\235\347\211\231\346\211\213\350\241\250\351\200\232\350\256\257\345\215\217\350\256\256.docx" differ diff --git a/IOTBluetooth/IOTBluetooth/Example/Datas.swift b/IOTBluetooth/IOTBluetooth/Example/Datas.swift index 145944e..437c280 100644 --- a/IOTBluetooth/IOTBluetooth/Example/Datas.swift +++ b/IOTBluetooth/IOTBluetooth/Example/Datas.swift @@ -29,10 +29,10 @@ let datas: [(ability: IBAbility, label: String, parameters: [IBParameter])] = [ (.setClock, "发送闹钟设置", [.clock(IBClock())]), (.fetchCurrentDialId, "发送当前表盘ID", []), - (.switchDial, "切换表盘", [.dialID(26112)]), - (.deleteDial, "删除表盘", [.dialID(7168)]), + (.switchDial, "切换表盘", [.dialID(1028)]), + (.deleteDial, "删除表盘", [.dialID(10001)]), (.fetchDials, "获取所有表盘UID", []), - (.checkDialID, "获取某表盘ID是否已安装", [.dialID(12)]), + (.checkDialID, "获取某表盘ID是否已安装", [.dialID(10001)]), (.fetchWatchState, "获取当前手表状态", []), (.fetchVibrateSound, "获取手表声音与震动参数", []), diff --git a/IOTBluetooth/IOTBluetooth/Example/ViewController.swift b/IOTBluetooth/IOTBluetooth/Example/ViewController.swift index 8e63674..1d6af06 100644 --- a/IOTBluetooth/IOTBluetooth/Example/ViewController.swift +++ b/IOTBluetooth/IOTBluetooth/Example/ViewController.swift @@ -44,8 +44,6 @@ class ViewController: BaseViewController { } @IBAction func startScan(_ sender: UIButton) { -// IBFileSender().readFile() -// return title = "正在扫描蓝牙设备..." IBManager.scan { [unowned self] peripheral in if let _ = datas.filter({ $0.uuid == peripheral.uuid }).last { diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/project.pbxproj b/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/project.pbxproj index 3ca006b..85d1a71 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/project.pbxproj +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/project.pbxproj @@ -742,7 +742,7 @@ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 1; }; name = Debug; @@ -778,7 +778,7 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 1; }; name = Release; 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 0136190..55cf124 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 dd854dd..a476c2f 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 @@ -20,5 +20,37 @@ landmarkType = "0"> + + + + + + + + diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBAbility.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBAbility.swift index 52797a6..91d0daf 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBAbility.swift +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBAbility.swift @@ -487,11 +487,9 @@ public extension IBAbility { } extension IBAbility { - // // // // MARK: - 私有 - // // /// 获取当前数据(jSON格式)【不使用】 // static let var681B9E92 = IBAbility.short.id(0x06) diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBManager.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBManager.swift index 5de8c13..06c43b0 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.11" + static let version: String = "1.0.14" /// 默认为 false static var isDebug: Bool = false { didSet { Logger.isDebug = isDebug } diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBNotify.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBNotify.swift index a8da2b2..8bad54a 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBNotify.swift +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBNotify.swift @@ -166,7 +166,6 @@ public extension IBNotify.Name { } extension IBNotify { - /// 处理手表推送过来的通知 static func handle(_ data: Data) -> Bool { //拍照 @@ -215,6 +214,14 @@ extension IBNotify { return true } //配对 + if checkPairing(data){ + return true + } + + return false + } + + static func checkPairing(_ data:Data)->Bool{ if data.bytes[1] == 0x05 && data.bytes[2] == 0x11 { let result = IBGeneralParser.dataPacket(data) let code = result[0].int @@ -223,6 +230,7 @@ extension IBNotify { return true } if data.bytes[1] == 0x05 && data.bytes[2] == 0x1 { + //解绑 let result = IBGeneralParser.dataPacket(data) let code = result[0].int let desc = ["拒绝解绑","确认解绑"] @@ -230,6 +238,7 @@ extension IBNotify { return true } if data.bytes[1] == 0x05 && data.bytes[2] == 0x10 { + //配对结果 var result = IBGeneralParser.dataPacket(data) let code = result[0].int if code == 1{ diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBParser.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBParser.swift index 4ae93e7..2895572 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBParser.swift +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBParser.swift @@ -277,9 +277,11 @@ struct IBFetchDialsParser: IBParser { static func parse(_ data: Data) -> IBResponse { let dataPacket = dataPacket(data) let num = dataPacket[0].int + var list:[Int] = [] for i in 0..