From: liangzhenying <867174124@qq.com> Date: Tue, 27 May 2025 10:13:16 +0000 (+0800) Subject: 新增应用安装协议 X-Git-Url: http://git.snicker.com.cn/sitemap.xml?a=commitdiff_plain;h=7ff8f77fd7913103a40e4760a2425acb7def7bd8;p=mirrors%2FIOTBluetooth-iOS.git 新增应用安装协议 --- diff --git "a/Doc/\346\234\200\346\226\260/2025.5.20.docx" "b/Doc/\346\234\200\346\226\260/2025.5.20.docx" new file mode 100644 index 0000000..8c0f963 Binary files /dev/null and "b/Doc/\346\234\200\346\226\260/2025.5.20.docx" differ diff --git a/IOTBluetooth/IOTBluetooth/Example/AbilityViewController.swift b/IOTBluetooth/IOTBluetooth/Example/AbilityViewController.swift index c95c91c..51f9225 100644 --- a/IOTBluetooth/IOTBluetooth/Example/AbilityViewController.swift +++ b/IOTBluetooth/IOTBluetooth/Example/AbilityViewController.swift @@ -58,6 +58,9 @@ extension AbilityViewController: UITableViewDelegate, UITableViewDataSource { else if data.label.isEqual("发送MP3文件"){ self.sendMp3() } + else if data.label.isEqual("发送App文件"){ + self.sendApp() + } else if data.label.isEqual("发送EPO文件"){ self.sendEpo() } @@ -115,6 +118,31 @@ extension AbilityViewController{ self?.activityIndicatorView.stopAnimating() } } + func sendApp(){ + guard let path = Bundle.main.path(forResource: "word_1734702718553_hisi_signed", ofType: "bin") else {return} + let info = IBSendApp() + info.name = "com.example.watch_word_challenge.bin" + info.filePath = path + +// guard let path = Bundle.main.path(forResource: "caichengyu_1734702353793_hisi_signed", ofType: "bin") else {return} +// let info = IBSendApp() +// info.name = "chengyu.bin" +// info.filePath = path + +// guard let path = Bundle.main.path(forResource: "com.vendor.keyinput_sample", ofType: "bin") else {return} +// let info = IBSendApp() +// info.name = "com.vendor.keyinput_sample.bin" +// info.filePath = path +// IBResponse(code: 1000,isSuccess: true, massage:操作成功, value:["com.zrgj.watch_lunar", "com.example.watch_word_challenge"]) + + activityIndicatorView.startAnimating() + IBFileSender().app(info).progress({ total, current in + // print("\(total) : \(current)") + }).response {[weak self] result in + print(result) + self?.activityIndicatorView.stopAnimating() + } + } func sendEpo(){ } diff --git a/IOTBluetooth/IOTBluetooth/Example/Datas.swift b/IOTBluetooth/IOTBluetooth/Example/Datas.swift index 37d4590..3e5137e 100644 --- a/IOTBluetooth/IOTBluetooth/Example/Datas.swift +++ b/IOTBluetooth/IOTBluetooth/Example/Datas.swift @@ -11,100 +11,102 @@ import IOTBluetooth let datas: [(ability: IBAbility, label: String, parameters: [IBParameter])] = [ - (.sendSchedule,"发送日程管理给手表",[.sendSchedule([IBSchedule()])]), - (.getSosContact,"获取OS紧急联系人",[]), - (.setSosContact,"设置SOS紧急联系人",[.setSosContact([IBContact()])]), +// (.sendSchedule,"发送日程管理给手表",[.sendSchedule([IBSchedule()])]), +// (.getSosContact,"获取OS紧急联系人",[]), +// (.setSosContact,"设置SOS紧急联系人",[.setSosContact([IBContact()])]), +// +// (.getPushConfig,"获取推送配置",[]), +// (.setPushConfig,"设置推送",[.setPush(IBPush.all)]), +// +// (.getPasssword,"获取密码",[]), +// (.setPasssword,"启用密码",[.setPassword(IBPassword(type: 1, password: "123456"))]), +// (.setPasssword,"删除密码",[.setPassword(IBPassword(type: 0, password: ""))]), +// +// (.userData,"设置用户数据",[.userInfo(IBUserInfo())]), +// (.language, "设置语言", [.language(.chinese)]), +// (.about,"关于本机内容",[]), +// (.find, "开始查找手表", [.action(1)]), +// (.find, "停止查找手表", [.action(0)]), +// (.message, "开启消息推送功能", [.action(1)]), +// (.message, "关闭消息推送功能", [.action(0)]), +// +// (.takePhoto, "开启手势拍照", [.action(1)]), +// (.takePhoto, "关闭手势拍照", [.action(0)]), +// (.restore, "恢复出厂设置", []), +// (.reboot, "重新启动", []), +// (.shutdown, "关机", []), +// (.fetchScreen, "获取手表屏幕参数", []), +// (.screen, "设置手表屏幕参数", [.screen(Config.setScreen())]), +// (.fetchBattery, "获取电量", []), +// (.fetchClock, "获取闹钟设置", []), +// (.setClock, "发送闹钟设置", [.clock(IBClock())]), +// +// (.fetchCurrentDialId, "发送当前表盘ID", []), +// (.switchDial, "切换表盘", [.dialID(120)]), +// (.deleteDial, "删除表盘", [.dialID(120)]), +// (.fetchDials, "获取所有表盘UID", []), +// (.checkDialID, "获取某表盘ID是否已安装", [.dialID(120)]), +// +// (.fetchWatchState, "获取当前手表状态", []), +// (.fetchVibrateSound, "获取手表声音与震动参数", []), +// (.vibrateSound, "设置手表声音与震动参数", [.vibrateSound(Config.setVibrateSound())]), +// (.fetchAuxiliary, "获取手表辅助功能参数", []), +// (.auxiliary, "设置手表辅助功能参数", [.auxiliary(.bloodOxygen)]), +// (.unit, "设置手表公英制单位", [.value(1)]), +// +// +// (.disk, "获取SD卡剩余空间", []), +// (.unpair, "发送解除配对消息", []), +// (.sendUnpair, "发送取消解除配对消息", []), +// +// +// (.startSport, "开启指定运动模式", [.motionMode(.walking)]), +// (.trainPauseResume, "训练暂停", [.action(0)]), +// (.trainPauseResume, "训练恢复", [.action(1)]), +// (.endSport, "结束运动模式", []), +// +// (.heartRateMode, "开启自动获取实时心率", [.action(1)]), +// (.heartRateMode, "关闭自动获取实时心率", [.action(0)]), +// (.heartRateHigh, "设置最高心率提醒", [.value(180)]), +// (.heartRateHigh, "关闭最高心率提醒", [.value(0)]), +// (.fetchHeartRate, "获取手表心率参数", []), +// (.heartRate, "设置手表心率参数", [.heartRate(IBHeartRate())]), +// (.currentHeartRate, "获取实时心率", []), +// +// (.fetchBloodOxygen, "获取手表血氧设置", []), +// (.bloodOxygen, "设置手表血氧参数", [.bloodOxygen(IBBloodOxygen())]), +// (.trainFrequency, "设置训练实时数据采样频率", [.value(30)]), +// +// (.fetchTargetStep, "获取目标步数设置", []), +// (.targetStep, "设置目标步数", [.targetStep(IBTargetStep())]), +// (.fetchOtherTarget, "获取其他目标设置", []), +// (.targetOther, "设置其他目标", [.otherTarget(IBOtherTarget())]), +// (.trainTarget, "设置训练目标", [.trainTarget(IBTrainTarget())]), +// (.fetchSleep, "获取睡眠设置", []), +// (.sleep, "设置睡眠", [.sleep(IBSleep())]), +// (.fetchWater, "获取手表喝水提醒设置", []), +// (.water, "设置喝水提醒", [.water(IBWater())]), +// +// +// (.syncHeartRate, "同步心率历史数据", [.value(0)]), +// (.syncBloodOxygen, "同步血氧历史数据", [.value(0)]), +// (.syncStepCount, "同步历史步数数据", [.value(0)]), +// (.syncFatBurning, "同步燃脂时间历史数据", [.value(0)]), +// (.syncStand, "同步站立历史数据", [.value(0)]), +// (.syncCalorie, "同步卡路里历史数据", [.value(0)]), +// (.syncDistance, "同步距离历史数据", [.value(0)]), +// (.syncTrain, "同步基础训练历史数据", [.value(0)]), +// (.syncSleep, "同步睡眠历史数据", [.value(0)]), +// (.syncGPS, "同步路径坐标集历史数据", [.value(1654012800)]), +// (.sendSyncEnd, "发送同步数据结束消息", []), +// (.addressBook, "发送通讯录", [.addressBook([IBAddressBook()])]), - (.getPushConfig,"获取推送配置",[]), - (.setPushConfig,"设置推送",[.setPush(IBPush.all)]), - - (.getPasssword,"获取密码",[]), - (.setPasssword,"启用密码",[.setPassword(IBPassword(type: 1, password: "123456"))]), - (.setPasssword,"删除密码",[.setPassword(IBPassword(type: 0, password: ""))]), - - (.userData,"设置用户数据",[.userInfo(IBUserInfo())]), - (.language, "设置语言", [.language(.chinese)]), - (.about,"关于本机内容",[]), - (.find, "开始查找手表", [.action(1)]), - (.find, "停止查找手表", [.action(0)]), - (.message, "开启消息推送功能", [.action(1)]), - (.message, "关闭消息推送功能", [.action(0)]), - - (.takePhoto, "开启手势拍照", [.action(1)]), - (.takePhoto, "关闭手势拍照", [.action(0)]), - (.restore, "恢复出厂设置", []), - (.reboot, "重新启动", []), - (.shutdown, "关机", []), - (.fetchScreen, "获取手表屏幕参数", []), - (.screen, "设置手表屏幕参数", [.screen(Config.setScreen())]), - (.fetchBattery, "获取电量", []), - (.fetchClock, "获取闹钟设置", []), - (.setClock, "发送闹钟设置", [.clock(IBClock())]), - - (.fetchCurrentDialId, "发送当前表盘ID", []), - (.switchDial, "切换表盘", [.dialID(120)]), - (.deleteDial, "删除表盘", [.dialID(120)]), - (.fetchDials, "获取所有表盘UID", []), - (.checkDialID, "获取某表盘ID是否已安装", [.dialID(120)]), - - (.fetchWatchState, "获取当前手表状态", []), - (.fetchVibrateSound, "获取手表声音与震动参数", []), - (.vibrateSound, "设置手表声音与震动参数", [.vibrateSound(Config.setVibrateSound())]), - (.fetchAuxiliary, "获取手表辅助功能参数", []), - (.auxiliary, "设置手表辅助功能参数", [.auxiliary(.bloodOxygen)]), - (.unit, "设置手表公英制单位", [.value(1)]), - - - (.disk, "获取SD卡剩余空间", []), - (.unpair, "发送解除配对消息", []), - (.sendUnpair, "发送取消解除配对消息", []), - - - (.startSport, "开启指定运动模式", [.motionMode(.walking)]), - (.trainPauseResume, "训练暂停", [.action(0)]), - (.trainPauseResume, "训练恢复", [.action(1)]), - (.endSport, "结束运动模式", []), - - (.heartRateMode, "开启自动获取实时心率", [.action(1)]), - (.heartRateMode, "关闭自动获取实时心率", [.action(0)]), - (.heartRateHigh, "设置最高心率提醒", [.value(180)]), - (.heartRateHigh, "关闭最高心率提醒", [.value(0)]), - (.fetchHeartRate, "获取手表心率参数", []), - (.heartRate, "设置手表心率参数", [.heartRate(IBHeartRate())]), - (.currentHeartRate, "获取实时心率", []), - - (.fetchBloodOxygen, "获取手表血氧设置", []), - (.bloodOxygen, "设置手表血氧参数", [.bloodOxygen(IBBloodOxygen())]), - (.trainFrequency, "设置训练实时数据采样频率", [.value(30)]), - - (.fetchTargetStep, "获取目标步数设置", []), - (.targetStep, "设置目标步数", [.targetStep(IBTargetStep())]), - (.fetchOtherTarget, "获取其他目标设置", []), - (.targetOther, "设置其他目标", [.otherTarget(IBOtherTarget())]), - (.trainTarget, "设置训练目标", [.trainTarget(IBTrainTarget())]), - (.fetchSleep, "获取睡眠设置", []), - (.sleep, "设置睡眠", [.sleep(IBSleep())]), - (.fetchWater, "获取手表喝水提醒设置", []), - (.water, "设置喝水提醒", [.water(IBWater())]), - - - (.syncHeartRate, "同步心率历史数据", [.value(0)]), - (.syncBloodOxygen, "同步血氧历史数据", [.value(0)]), - (.syncStepCount, "同步历史步数数据", [.value(0)]), - (.syncFatBurning, "同步燃脂时间历史数据", [.value(0)]), - (.syncStand, "同步站立历史数据", [.value(0)]), - (.syncCalorie, "同步卡路里历史数据", [.value(0)]), - (.syncDistance, "同步距离历史数据", [.value(0)]), - (.syncTrain, "同步基础训练历史数据", [.value(0)]), - (.syncSleep, "同步睡眠历史数据", [.value(0)]), - (.syncGPS, "同步路径坐标集历史数据", [.value(1654012800)]), - (.sendSyncEnd, "发送同步数据结束消息", []), - (.addressBook, "发送通讯录", [.addressBook([IBAddressBook()])]), - -// (.epo, "发送EPO文件", []), (.ota, "发送OTA文件", []), (.mp3, "发送MP3文件", []), -// (.dial, "发送自定义表盘文件", []), + (.fetchWatchInfoH5, "获取应用商店h5配置", []), + (.app, "发送App文件", []), + (.fetchApps, "获取已安装的app列表", []), + (.deleteApp, "删除App", [.text("com.example.watch_word_challenge")]), (.dial, "发送市场表盘文件", []), (.revokeFileSend, "撤销当前文件传输", []), diff --git a/IOTBluetooth/IOTBluetooth/Example/Resource/2_1736772035256.25.01135_hisi_signed.bin b/IOTBluetooth/IOTBluetooth/Example/Resource/2_1736772035256.25.01135_hisi_signed.bin new file mode 100644 index 0000000..500000d Binary files /dev/null and b/IOTBluetooth/IOTBluetooth/Example/Resource/2_1736772035256.25.01135_hisi_signed.bin differ diff --git a/IOTBluetooth/IOTBluetooth/Example/Resource/caichengyu_1734702353793_hisi_signed.bin b/IOTBluetooth/IOTBluetooth/Example/Resource/caichengyu_1734702353793_hisi_signed.bin new file mode 100644 index 0000000..718e181 Binary files /dev/null and b/IOTBluetooth/IOTBluetooth/Example/Resource/caichengyu_1734702353793_hisi_signed.bin differ diff --git a/IOTBluetooth/IOTBluetooth/Example/Resource/com.vendor.keyinput_sample.bin b/IOTBluetooth/IOTBluetooth/Example/Resource/com.vendor.keyinput_sample.bin new file mode 100644 index 0000000..59c4a67 Binary files /dev/null and b/IOTBluetooth/IOTBluetooth/Example/Resource/com.vendor.keyinput_sample.bin differ diff --git a/IOTBluetooth/IOTBluetooth/Example/Resource/jinianri_1734702023799_hisi_signed.bin b/IOTBluetooth/IOTBluetooth/Example/Resource/jinianri_1734702023799_hisi_signed.bin new file mode 100644 index 0000000..cf787c1 Binary files /dev/null and b/IOTBluetooth/IOTBluetooth/Example/Resource/jinianri_1734702023799_hisi_signed.bin differ diff --git a/IOTBluetooth/IOTBluetooth/Example/Resource/nongliri_1734702102176_hisi_signed.bin b/IOTBluetooth/IOTBluetooth/Example/Resource/nongliri_1734702102176_hisi_signed.bin new file mode 100644 index 0000000..f373fe1 Binary files /dev/null and b/IOTBluetooth/IOTBluetooth/Example/Resource/nongliri_1734702102176_hisi_signed.bin differ diff --git a/IOTBluetooth/IOTBluetooth/Example/Resource/word_1734702718553_hisi_signed.bin b/IOTBluetooth/IOTBluetooth/Example/Resource/word_1734702718553_hisi_signed.bin new file mode 100644 index 0000000..93bf50e Binary files /dev/null and b/IOTBluetooth/IOTBluetooth/Example/Resource/word_1734702718553_hisi_signed.bin differ diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/project.pbxproj b/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/project.pbxproj index 234467d..e87fb99 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/project.pbxproj +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcodeproj/project.pbxproj @@ -60,6 +60,16 @@ 18EF697A2C47A86D00AA0A36 /* IBTools.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18EF69782C47A86D00AA0A36 /* IBTools.swift */; }; 18EFF59B2C080F14001B1E0E /* IBUserInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18EFF59A2C080F14001B1E0E /* IBUserInfo.swift */; }; 39517247ABAC3EA28AABA92A /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A87ADBA97338BE6292016534 /* Pods_Example.framework */; }; + 3F0D52D92DDC163D00763D50 /* word_1734702718553_hisi_signed.bin in Resources */ = {isa = PBXBuildFile; fileRef = 3F0D52D82DDC163D00763D50 /* word_1734702718553_hisi_signed.bin */; }; + 3F0D52DB2DDC17B100763D50 /* caichengyu_1734702353793_hisi_signed.bin in Resources */ = {isa = PBXBuildFile; fileRef = 3F0D52DA2DDC17B100763D50 /* caichengyu_1734702353793_hisi_signed.bin */; }; + 3F0D52E02DDC2DF000763D50 /* IBApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F0D52DF2DDC2DEF00763D50 /* IBApp.swift */; }; + 3F0D52E22DDC2F8400763D50 /* IBFileSender+App.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F0D52E12DDC2F7900763D50 /* IBFileSender+App.swift */; }; + 3F0D52E62DDC4F3A00763D50 /* IBFetchApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F0D52E52DDC4F2F00763D50 /* IBFetchApp.swift */; }; + 3F0D52E92DDC50DA00763D50 /* IBWatchInfoH5.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F0D52E82DDC50CA00763D50 /* IBWatchInfoH5.swift */; }; + 3F0D52FA2DDD705D00763D50 /* 2_1736772035256.25.01135_hisi_signed.bin in Resources */ = {isa = PBXBuildFile; fileRef = 3F0D52F92DDD705D00763D50 /* 2_1736772035256.25.01135_hisi_signed.bin */; }; + 3F0D52FD2DDD719000763D50 /* jinianri_1734702023799_hisi_signed.bin in Resources */ = {isa = PBXBuildFile; fileRef = 3F0D52FB2DDD719000763D50 /* jinianri_1734702023799_hisi_signed.bin */; }; + 3F0D52FE2DDD719000763D50 /* nongliri_1734702102176_hisi_signed.bin in Resources */ = {isa = PBXBuildFile; fileRef = 3F0D52FC2DDD719000763D50 /* nongliri_1734702102176_hisi_signed.bin */; }; + 3F0D53002DDD745000763D50 /* com.vendor.keyinput_sample.bin in Resources */ = {isa = PBXBuildFile; fileRef = 3F0D52FF2DDD745000763D50 /* com.vendor.keyinput_sample.bin */; }; 3F2AF7F32D57106400635545 /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 18EF696B2C47766400AA0A36 /* libbz2.tbd */; }; 3F2AF7F42D57107100635545 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 18EF69692C47765800AA0A36 /* libiconv.tbd */; }; 3F2AF7F52D57107A00635545 /* liblzma.5.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 18EF69672C47764400AA0A36 /* liblzma.5.tbd */; }; @@ -180,6 +190,16 @@ 18EF69752C47A0F200AA0A36 /* AIAudio.sbc */ = {isa = PBXFileReference; lastKnownFileType = file; path = AIAudio.sbc; sourceTree = ""; }; 18EF69782C47A86D00AA0A36 /* IBTools.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IBTools.swift; sourceTree = ""; }; 18EFF59A2C080F14001B1E0E /* IBUserInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IBUserInfo.swift; sourceTree = ""; }; + 3F0D52D82DDC163D00763D50 /* word_1734702718553_hisi_signed.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = word_1734702718553_hisi_signed.bin; sourceTree = ""; }; + 3F0D52DA2DDC17B100763D50 /* caichengyu_1734702353793_hisi_signed.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = caichengyu_1734702353793_hisi_signed.bin; sourceTree = ""; }; + 3F0D52DF2DDC2DEF00763D50 /* IBApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IBApp.swift; sourceTree = ""; }; + 3F0D52E12DDC2F7900763D50 /* IBFileSender+App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "IBFileSender+App.swift"; sourceTree = ""; }; + 3F0D52E52DDC4F2F00763D50 /* IBFetchApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IBFetchApp.swift; sourceTree = ""; }; + 3F0D52E82DDC50CA00763D50 /* IBWatchInfoH5.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IBWatchInfoH5.swift; sourceTree = ""; }; + 3F0D52F92DDD705D00763D50 /* 2_1736772035256.25.01135_hisi_signed.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = 2_1736772035256.25.01135_hisi_signed.bin; sourceTree = ""; }; + 3F0D52FB2DDD719000763D50 /* jinianri_1734702023799_hisi_signed.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = jinianri_1734702023799_hisi_signed.bin; sourceTree = ""; }; + 3F0D52FC2DDD719000763D50 /* nongliri_1734702102176_hisi_signed.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = nongliri_1734702102176_hisi_signed.bin; sourceTree = ""; }; + 3F0D52FF2DDD745000763D50 /* com.vendor.keyinput_sample.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = com.vendor.keyinput_sample.bin; sourceTree = ""; }; 3F2AF7F72D57109700635545 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; 3F2AF7F92D57118D00635545 /* ChatViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatViewController.swift; sourceTree = ""; }; 3F2AF8342D573B5D00635545 /* ChatCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatCell.swift; sourceTree = ""; }; @@ -275,6 +295,12 @@ 18113B292C1318FD00E04997 /* Resource */ = { isa = PBXGroup; children = ( + 3F0D52FF2DDD745000763D50 /* com.vendor.keyinput_sample.bin */, + 3F0D52FB2DDD719000763D50 /* jinianri_1734702023799_hisi_signed.bin */, + 3F0D52FC2DDD719000763D50 /* nongliri_1734702102176_hisi_signed.bin */, + 3F0D52F92DDD705D00763D50 /* 2_1736772035256.25.01135_hisi_signed.bin */, + 3F0D52D82DDC163D00763D50 /* word_1734702718553_hisi_signed.bin */, + 3F0D52DA2DDC17B100763D50 /* caichengyu_1734702353793_hisi_signed.bin */, 3FCFBFDD2D548D70003FC090 /* pumpkin.lzma */, 18EF69752C47A0F200AA0A36 /* AIAudio.sbc */, 18113B322C1406CB00E04997 /* 大约在冬季.mp3 */, @@ -329,6 +355,7 @@ 8A79D2242BA4278E0096A98C /* IBSender.swift */, 181441D22C115AC500CCDD46 /* IBFileSender.swift */, 18204BFF2C199B8600F94E69 /* IBFileSender+Mp3.swift */, + 3F0D52E12DDC2F7900763D50 /* IBFileSender+App.swift */, 18204C012C199D0E00F94E69 /* IBFileSender+Ota.swift */, 18204C032C199E7800F94E69 /* IBFileSender+Dial.swift */, 8A79D2262BA433330096A98C /* IBNotify.swift */, @@ -433,11 +460,14 @@ 18C9589A2C082FA7006A5DE8 /* IBWeather.swift */, 180CE2642C0D728F00A7006E /* IBAddressBook.swift */, 181441CE2C11571400CCDD46 /* IBMp3.swift */, + 3F0D52DF2DDC2DEF00763D50 /* IBApp.swift */, + 3F0D52E82DDC50CA00763D50 /* IBWatchInfoH5.swift */, 181441D02C11575D00CCDD46 /* IBOta.swift */, 181441D42C116AE500CCDD46 /* IBDial.swift */, 18884C452C12A4EA00E01458 /* IBEpo.swift */, 18884C432C11DBA300E01458 /* IBDeleteFile.swift */, 1839DBCF2C14442200E33B6E /* IBFetchFile.swift */, + 3F0D52E52DDC4F2F00763D50 /* IBFetchApp.swift */, 180220CD2C2D5D560090D34A /* IBAiResponse.swift */, 1849DC902BECD131002C2D2D /* IBCode.swift */, 182DDFD32C5CE68900D44D37 /* IBAiValid.swift */, @@ -576,12 +606,18 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 3F0D52D92DDC163D00763D50 /* word_1734702718553_hisi_signed.bin in Resources */, 8A1DFF5E2B9EB4F900B735FF /* LaunchScreen.storyboard in Resources */, 18113B312C1400D700E04997 /* 黄沙-名决.mp3 in Resources */, 8A1DFF5B2B9EB4F900B735FF /* Assets.xcassets in Resources */, + 3F0D52FA2DDD705D00763D50 /* 2_1736772035256.25.01135_hisi_signed.bin in Resources */, 8A1DFF592B9EB4F900B735FF /* Main.storyboard in Resources */, + 3F0D52FD2DDD719000763D50 /* jinianri_1734702023799_hisi_signed.bin in Resources */, + 3F0D52FE2DDD719000763D50 /* nongliri_1734702102176_hisi_signed.bin in Resources */, + 3F0D53002DDD745000763D50 /* com.vendor.keyinput_sample.bin in Resources */, 3FCFBFDE2D548D70003FC090 /* pumpkin.lzma in Resources */, 185E9C3B2C2564F60078C808 /* 20240604_155433_2_V1.0.1_20240618_113111_ota.fwpkg in Resources */, + 3F0D52DB2DDC17B100763D50 /* caichengyu_1734702353793_hisi_signed.bin in Resources */, 18EF69772C47A0F200AA0A36 /* AIAudio.sbc in Resources */, 18113B332C1406CB00E04997 /* 大约在冬季.mp3 in Resources */, 18113B2F2C13195900E04997 /* galaxy.lzma in Resources */, @@ -638,6 +674,7 @@ buildActionMask = 2147483647; files = ( 8A79D2292BA43F5A0096A98C /* IBResponse.swift in Sources */, + 3F0D52E22DDC2F8400763D50 /* IBFileSender+App.swift in Sources */, 3F9355B72D38FF2100C54DAB /* IBPush.swift in Sources */, 189C15932C05FFA600676A80 /* IBHistoryStand.swift in Sources */, 1849DC8F2BEC8007002C2D2D /* IBVibrateSound.swift in Sources */, @@ -674,6 +711,7 @@ 8A5822CF2BA1A67700590AB6 /* IBAbility.swift in Sources */, 8A65F9652BAC271B005C1EA4 /* IBScreen.swift in Sources */, 1859DFA02BFF5A2700112E8C /* IBSendTime.swift in Sources */, + 3F0D52E92DDC50DA00763D50 /* IBWatchInfoH5.swift in Sources */, 3FFAE0552D3A042900325873 /* IBContact.swift in Sources */, 18EF69792C47A86D00AA0A36 /* IBTools.swift in Sources */, 8A65F9632BAC1018005C1EA4 /* IBTargetStep.swift in Sources */, @@ -702,6 +740,7 @@ 189C158F2C05F85200676A80 /* IBHistoryStep.swift in Sources */, 3FBD71C52D7E95AC009E6F3C /* IBAiManager2.swift in Sources */, 8A5822D12BA1C80700590AB6 /* LRC.swift in Sources */, + 3F0D52E02DDC2DF000763D50 /* IBApp.swift in Sources */, 8A0A39DA2B981037006A3B18 /* Date.swift in Sources */, 181441D52C116AE500CCDD46 /* IBDial.swift in Sources */, 18993AA22C073FED006742D2 /* IBBloodOxygen.swift in Sources */, @@ -709,6 +748,7 @@ 18884C462C12A4EA00E01458 /* IBEpo.swift in Sources */, 8A87FBB32BAA7F3900096761 /* IBLanguage.swift in Sources */, 18EF69552C45266D00AA0A36 /* IBReceiveManager.swift in Sources */, + 3F0D52E62DDC4F3A00763D50 /* IBFetchApp.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcworkspace/xcuserdata/yaozuopan.xcuserdatad/UserInterfaceState.xcuserstate b/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcworkspace/xcuserdata/yaozuopan.xcuserdatad/UserInterfaceState.xcuserstate index fccfc07..da63a13 100644 Binary files a/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcworkspace/xcuserdata/yaozuopan.xcuserdatad/UserInterfaceState.xcuserstate and b/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcworkspace/xcuserdata/yaozuopan.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcworkspace/xcuserdata/yaozuopan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcworkspace/xcuserdata/yaozuopan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index d097835..1395a25 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcworkspace/xcuserdata/yaozuopan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth.xcworkspace/xcuserdata/yaozuopan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -3,4 +3,38 @@ uuid = "DE90D99F-11DF-48BC-9070-3AF484DDB28C" type = "0" version = "2.0"> + + + + + + + + + + diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBAbility.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBAbility.swift index faa7a5a..81a1833 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBAbility.swift +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBAbility.swift @@ -477,9 +477,23 @@ public extension IBAbility { /// - Parameter mp3: see ``IBMp3File`` static let mp3 = IBAbility.file.id(0x07).parser(IBGeneralParser.self).checker(IBMp3Checker.self) -// /// 发送自定义表盘文件汇总信息 -// /// - Parameter customDial: see ``IBCustomDial`` -// static let customDial = IBAbility.file.id(0x22).parser(IBGeneralParser.self).checker(IBCustomDialChecker.self) + /// 发送App文件信息 + /// - Parameter app: see ``IBAppFile`` + static let app = IBAbility.file.id(0x0c).parser(IBGeneralParser.self).checker(IBAppChecker.self) + + /// 获取已安装的app列表 + /// - Returns: [String] \n + /// Read from ``IBResponse``.value + static let fetchApps = IBAbility.file.id(0x0e).parser(IBFetchAppParser.self) + + /// 获取手表信息 + /// - Returns: IBWatchInfoH5 \n + /// Read from ``IBResponse``.value + static let fetchWatchInfoH5 = IBAbility.file.id(0x0f).parser(IBFetchWatchInfoH5Parser.self) + + /// 删除app + /// - Parameter text: see ``String`` + static let deleteApp = IBAbility.file.id(0x0d).parser(IBGeneralParser.self).checker(IBTextChecker.self) /// 发送表盘文件汇总信息 /// - Parameter dial: see ``IBDial`` diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBChecker.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBChecker.swift index 749dd88..873645a 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBChecker.swift +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBChecker.swift @@ -475,6 +475,14 @@ struct IBMp3Checker: IBChecker { return data.bytes } } +struct IBAppChecker: IBChecker { + static func check(_ parameters: [IBParameter]) -> [UInt8] { + guard case let .app(value) = parameters[.app] else { fatalError("缺少参数: app") } + guard let data = value.encode else { fatalError("json解析异常: app") } + Logger.log(value.jsonString ?? "") + return data.bytes + } +} struct IBEpoChecker: IBChecker { static func check(_ parameters: [IBParameter]) -> [UInt8] { guard case let .epo(list) = parameters[.epo] else { fatalError("缺少参数: epo") } diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBFileSender+App.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBFileSender+App.swift new file mode 100644 index 0000000..bf3a9df --- /dev/null +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBFileSender+App.swift @@ -0,0 +1,87 @@ +// +// IBFileSender_App.swift +// IOTBluetooth +// +// Created by liangshi on 2025/5/20. +// + +import Foundation + +extension IBFileSender{ + func sendApp(_ info:IBSendApp){ + let (list,size,lrc) = readFile(from: info.filePath) + if let list = list { + info.size = size + total = info.size + let content = IBFileSenderContent(dataList: list,lrc: lrc) + self.fileList = [content] + + IBSender() + .ability(.app) + .parameters([.app(IBAppFile(data:info))]) + .response {[weak self] result in + guard let self = self else {return} + if result.isSuccess{ + self.sendContentApp() + } + else{ + completion(result) + self.remove() + } + } + } + else{ + completion(.response.code(.failure).message("读取文件失败")) + self.remove() + } + } + private func sendContentApp(){ + if cancelSend { + Logger.log("已取消发送") + self.remove() + return + } + + if let file = fileList.first,let data = file.nextData(){ + IBBluetooth.shared.fileSender = self + let model = IBFileSenderData() + model.data = data + model.fileWriteHander = { [weak self] result in + guard let self = self else { return } + self.lastData = nil + if result.isSuccess { + self.current += data.count - 18 + Logger.log("\(total) : \(current)") + self.progress?(self.total,self.current) + self.sendContentApp() + } + else{ + completion(.response.code(.failure).message("发送文件超时,发送失败!")) + self.remove() + } + } + self.lastData = model + IBBluetooth.shared.send(fileData: data) + } + else{ + Logger.log( "文件内容发送结束...") + startTimer() + } + } + func sendAppLrc(){ + IBSender() + .ability(.fileCheckCode) + .parameters([.value(fileList.first!.lrc)]) + .response {[weak self] result in + guard let self = self else {return} + if result.isSuccess{ + completion(result) + self.remove() + } + else{ + completion(.response.code(.failure).message("发送文件校验码失败")) + self.remove() + } + } + } +} diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBFileSender.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBFileSender.swift index 3862937..405dd91 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBFileSender.swift +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBFileSender.swift @@ -57,8 +57,7 @@ public class IBFileSender { var otaInfo:IBSendOta? var mp3Info:IBSendMp3? - var epoInfo:[IBEpo]? - // var customInfo:IBCustomDial? + var appInfo:IBSendApp? var dialInfo:IBDial? var fileList:[IBFileSenderContent] = [] @@ -105,18 +104,15 @@ public class IBFileSender { if let _ = self.mp3Info{ sendMp3Lrc() } + else if let _ = self.appInfo { + sendAppLrc() + } else if let _ = self.otaInfo { sendOtaLrc() } else if let _ = self.dialInfo{ sendDialLrc() } - // else if let _ = self.marketInfo{ - // sendDialLrc() - // } - // else if let path = self.epoInfo.filePath { - // filePath = path - // } } } @@ -127,39 +123,16 @@ extension IBFileSender{ if let info = self.mp3Info{ self.sendMp3(info) } + else if let info = self.appInfo { + self.sendApp(info) + } else if let info = self.otaInfo { self.sendOta(info) } else if let info = self.dialInfo{ self.sendDial(info) } - // else if let info = self.marketInfo{ - // self.sendDial(info) - // } - // else if let path = self.epoInfo.filePath { - // filePath = path - // } } - // func readFile(from path:String) ->([Data]?,Int,Int){ - // let fileURL = URL(fileURLWithPath: path) - // do { - // let data = try Data(contentsOf:fileURL) - // let seg = 495 - // var list = [Data]() - // for i in stride(from: 0, to: data.count, by: seg) { - // if i+seg < data.count { - // list.append(data[i ... i+seg - 1]) - // } - // else{ - // list.append(data[i ... data.count - 1]) - // } - // } - // let lrc = LRC.calculateLRC(data.bytes).int - // return (list,data.count,lrc) - // } catch { - // return (nil,0,0) - // } - // } func readFile(from path:String) ->([Data]?,Int,Int){ let fileURL = URL(fileURLWithPath: path) @@ -211,6 +184,9 @@ public extension IBFileSender{ /// - Returns: self func ota(_ info:IBSendOta) ->Self{ self.otaInfo = info + self.dialInfo = nil + self.mp3Info = nil + self.appInfo = nil return self } @discardableResult @@ -220,51 +196,38 @@ public extension IBFileSender{ /// - Parameter info: mp3信息 /// - Returns: Self func mp3(_ info:IBSendMp3) ->Self{ + self.otaInfo = nil + self.dialInfo = nil self.mp3Info = info + self.appInfo = nil + return self + } + /// 发送app + /// - Parameter info: app信息 + /// - Returns: Self + func app(_ info:IBSendApp) ->Self{ + self.otaInfo = nil + self.dialInfo = nil + self.mp3Info = nil + self.appInfo = info return self } - - // /// 发送自定义表盘 - // /// - Parameter info: 表盘信息 - // /// - Returns: Self - // func customDial(_ info:IBCustomDial) ->Self{ - // if let list = info.files,list.count > 0{ - // for i in 0...list.count - 1 { - // list[i].index = i - // list[i].UID = info.UID - // } - // } - // self.customInfo = info - // return self - // } /// 发送表盘 /// - Parameter info: 表盘信息 /// - Returns: Self func dial(_ info:IBDial) ->Self{ - // IBMarketDial - if let list = info.files,list.count > 0{ for i in 0...list.count - 1{ list[i].index = i + 1 list[i].UID = info.UID } } - + self.otaInfo = nil self.dialInfo = info + self.mp3Info = nil + self.appInfo = nil return self } - - /// 发送EPO文件 - /// - Parameters: - /// - filePath: 文件路径 - /// - info: epo信息 - /// - Returns: self - // func epo(filePath:URL,info:[IBEpo]) ->Self{ - // self.filePath = filePath - // self.epoInfo = info - // return self - // } - /// 进度 @discardableResult func progress(_ value: @escaping IBProgressHandler) -> Self { @@ -293,9 +256,26 @@ public extension IBFileSender{ item.cancelSend = true } + var type = IBFile.mp3 + if self.otaInfo != nil { + type = .ota + } + else if self.mp3Info != nil{ + type = .mp3 + } + else if self.dialInfo != nil{ + type = .dial + } + else if self.appInfo != nil{ + type = .app + } + else{ + return + } + IBSender() .ability(.revokeFileSend) - .parameters([.file(.mp3)]) + .parameters([.file(type)]) .response { result in handler(result) self.remove() diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBManager.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBManager.swift index cec6f9a..f8c3c1b 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 = "2.0.0" + static let version: String = "2.0.1" /// 默认为 false static var isDebug: Bool = false { didSet { diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBParameter.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBParameter.swift index bada05a..a3a179f 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBParameter.swift +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBParameter.swift @@ -34,6 +34,7 @@ enum IBKey: String { case epo = "epo" case ota = "ota" case mp3 = "mp3" + case app = "app" case dial = "dial" case dialFile = "dialFile" case deleteFile = "deleteFile" @@ -101,6 +102,8 @@ public enum IBParameter { case ota(IBOtaFile) /// 发送mp3文件信息 case MP3(IBMp3File) + /// 发送app文件信息 + case app(IBAppFile) /// 发送表盘信息汇总 case dial(IBDial) /// 发送单个表盘文件信息 @@ -150,6 +153,7 @@ public enum IBParameter { case .epo(_): return .epo case .ota(_): return .ota case .MP3(_): return .mp3 + case .app(_): return .app case .dial(_): return .dial case .dialFile(_): return .dialFile case .deleteFile(_): return .deleteFile @@ -180,10 +184,8 @@ public enum IBFile: Int,Codable { case mp3 /// 表盘信息 case dial - /// OTA(W4) - case ota_w4 - ///EPO - case epo + /// app + case app } //0:运动 //1:心率 diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBParser.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBParser.swift index e2dc78c..4e6e2d0 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBParser.swift +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBParser.swift @@ -342,7 +342,25 @@ struct IBFetchDialsParser: IBParser { return .response.code(.success).items(list) } } - +struct IBFetchAppParser: IBParser { + static func parse(_ data: Data) -> IBResponse { + let dataPacket = dataPacket(data) + Logger.log(String(data: data, encoding: .utf8) ?? "") + guard let model = IBFetchApp(dataPacket.data) else { return .response.code(.parseError) } +// guard let model = JSON.decode(IBFetchApp.self, from: dataPacket.data) else { return .response.code(.parseError) } + Logger.log(model.jsonString ?? "") + return .response.code(.success).value(model.list) + } +} +struct IBFetchWatchInfoH5Parser: IBParser { + static func parse(_ data: Data) -> IBResponse { + let dataPacket = dataPacket(data) + Logger.log(String(data: data, encoding: .utf8) ?? "") + guard let model = JSON.decode(IBWatchInfoH5.self, from: dataPacket.data) else { return .response.code(.parseError) } + Logger.log(model.jsonString ?? "") + return .response.code(.success).value(model) + } +} struct IBTargetStepParser: IBParser { static func parse(_ data: Data) -> IBResponse { let dataPacket = dataPacket(data) diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBluetooth.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBluetooth.swift index 343d7e1..cfbd9de 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBluetooth.swift +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/IBluetooth.swift @@ -308,7 +308,7 @@ extension IBBluetooth: CBPeripheralDelegate { } if let data = characteristic.value { // Logger.log( "[receive] \(characteristic.uuid.uuidString) " + data.joined("")) - if data.count > 100 { + if data.count > 500 { Logger.log( "[receive] \(characteristic.uuid.uuidString) " + "\(data.count)") } else{ diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/MixSdk/Example/Example.xcodeproj/xcuserdata/yaozuopan.xcuserdatad/xcschemes/xcschememanagement.plist b/IOTBluetooth/IOTBluetooth/IOTBluetooth/MixSdk/Example/Example.xcodeproj/xcuserdata/yaozuopan.xcuserdatad/xcschemes/xcschememanagement.plist index c1cbfb0..8154a1f 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/MixSdk/Example/Example.xcodeproj/xcuserdata/yaozuopan.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/MixSdk/Example/Example.xcodeproj/xcuserdata/yaozuopan.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,7 +7,7 @@ Example.xcscheme_^#shared#^_ orderHint - 1 + 3 diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/MixSdk/MixSdk.xcworkspace/xcuserdata/yaozuopan.xcuserdatad/UserInterfaceState.xcuserstate b/IOTBluetooth/IOTBluetooth/IOTBluetooth/MixSdk/MixSdk.xcworkspace/xcuserdata/yaozuopan.xcuserdatad/UserInterfaceState.xcuserstate index 97dd682..d65fc50 100644 Binary files a/IOTBluetooth/IOTBluetooth/IOTBluetooth/MixSdk/MixSdk.xcworkspace/xcuserdata/yaozuopan.xcuserdatad/UserInterfaceState.xcuserstate and b/IOTBluetooth/IOTBluetooth/IOTBluetooth/MixSdk/MixSdk.xcworkspace/xcuserdata/yaozuopan.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/MixSdk/Pods/Pods.xcodeproj/xcuserdata/yaozuopan.xcuserdatad/xcschemes/xcschememanagement.plist b/IOTBluetooth/IOTBluetooth/IOTBluetooth/MixSdk/Pods/Pods.xcodeproj/xcuserdata/yaozuopan.xcuserdatad/xcschemes/xcschememanagement.plist index 52928e8..fa4c272 100644 --- a/IOTBluetooth/IOTBluetooth/IOTBluetooth/MixSdk/Pods/Pods.xcodeproj/xcuserdata/yaozuopan.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/MixSdk/Pods/Pods.xcodeproj/xcuserdata/yaozuopan.xcuserdatad/xcschemes/xcschememanagement.plist @@ -17,17 +17,17 @@ Pods-Example.xcscheme_^#shared#^_ orderHint - 6 + 1 SnapKit-SnapKit_Privacy.xcscheme_^#shared#^_ orderHint - 7 + 0 SnapKit.xcscheme_^#shared#^_ orderHint - 3 + 6 Toast-Swift.xcscheme_^#shared#^_ diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/Models/IBApp.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/Models/IBApp.swift new file mode 100644 index 0000000..c837407 --- /dev/null +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/Models/IBApp.swift @@ -0,0 +1,39 @@ +// +// Untitled.swift +// IOTBluetooth +// +// Created by liangshi on 2025/5/20. +// + +import Foundation + +/// 发送app +public class IBSendApp:Codable { + /// 文件路径 + public var filePath: String = "" + /// 名字 + public var name: String = "" + + /// 文件大小,单位byte + internal var size: Int = 0 + + + public init() { } +} + + +/// app文件模型 +public class IBAppFile:Codable { + /// 歌曲名字 + var name: String = "" + /// 文件类型,4 + var type: Int = 4 + /// 文件大小,单位byte + var size: Int = 0 + + internal init(data:IBSendApp) { + self.name = data.name + self.size = data.size + } +} + diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/Models/IBFetchApp.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/Models/IBFetchApp.swift new file mode 100644 index 0000000..c0e9ab7 --- /dev/null +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/Models/IBFetchApp.swift @@ -0,0 +1,33 @@ +// +// IBFetchApp.swift +// IOTBluetooth +// +// Created by liangshi on 2025/5/20. +// + +/// 已安装app +class IBFetchApp:Codable { + var list:[IBWatchApp] = [IBWatchApp]() + + init?(_ data: Data) { + guard let appList = data.jsonObject() as? [[String: Any]] else { return nil } + for item in appList { + let model = IBWatchApp() + model.appName = item["appName"] as? String ?? "" + model.packageName = item["packageName"] as? String ?? "" + list.append(model) + } + } + + public init() { } +} +/// 已安装app +public class IBWatchApp:Codable{ + /// app名字 + public var appName: String = "" + /// 包名 + public var packageName: String = "" + public init(){ + + } +} diff --git a/IOTBluetooth/IOTBluetooth/IOTBluetooth/Models/IBWatchInfoH5.swift b/IOTBluetooth/IOTBluetooth/IOTBluetooth/Models/IBWatchInfoH5.swift new file mode 100644 index 0000000..d761747 --- /dev/null +++ b/IOTBluetooth/IOTBluetooth/IOTBluetooth/Models/IBWatchInfoH5.swift @@ -0,0 +1,35 @@ +// +// IBAppWatchInfo.swift +// IOTBluetooth +// +// Created by liangshi on 2025/5/20. +// + +import Foundation +/// h5 应用商店手表配置 +public class IBWatchInfoH5:Codable { + /// 品牌商在聚合平台注册 + public var vendorIdentity: String = "" + /// 消费者账号 + public var consumerIdentity:String = "" + /// 消费者账号类型,0:品牌商注册账号,1:聚合平台注册账号 + public var consumerType:String = "" + /// 设备序列号,从表端获取,需要品牌商提前将序列号在聚合平台注册 + public var deviceSn:String = "" + /// H5页面主题, 模式:light(浅色)(默认)/dark(深色) + public var themeMode:String = "light" + /// 片平台,如:hisi + public var chipPlatform:String = "" + /// 芯片型号, 如:300 + public var chipModel:String = "" + /// watch系统,如: openharmony等 + public var os:String = "" + /// watch系统版本,如: 5.0.1 + public var osVersion:String = "" + /// sdk版本号,如: 13 + public var sdkVersion:String = "" + /// watch分辨率,格式:宽*高,如:466*466 + public var resolution:String = "" + + public init() { } +}