Files
akbleserver/unpackage/cache/.app-android/sourcemap/pages/akbletest.kt.map
2026-03-16 10:37:46 +08:00

1 line
55 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"version":3,"sources":["pages/akbletest.uvue","App.uvue","uni_modules/uni-getbatteryinfo/utssdk/interface.uts"],"sourcesContent":["<template>\r\n\t<scroll-view direction=\"vertical\" class=\"container\">\r\n\t\t<view class=\"section\">\r\n\t\t\t<button @click=\"scanDevices\" :disabled=\"scanning\">{{ scanning ? '正在扫描...' : '扫描设备' }}</button>\r\n\t\t\t<!-- \t\t\t<view style=\"display:flex; flex-direction:row; margin-left:12px; align-items:center\">\r\n\t\t\t\t<text style=\"margin-right:8px\">预设:</text>\r\n\t\t\t\t<radio-group :modelValue=\"presetSelected\" @change=\"onPresetChange\">\r\n\t\t\t\t\t<view v-for=\"(opt, index) in presetOptions\" :key=\"index\"\r\n\t\t\t\t\t\tstyle=\"margin-right:8px; display:flex; align-items:center\">\r\n\t\t\t\t\t\t<radio :value=\"opt['value'] as string\" />\r\n\t\t\t\t\t\t<text style=\"margin-left:4px\">{{ opt['label'] as string }}</text>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</radio-group>\r\n\t\t\t</view> -->\r\n\t\t\t<input v-model=\"optionalServicesInput\" placeholder=\"可选服务 UUID, 逗号分隔\" style=\"margin-left:12px; width: 40%\" />\r\n\t\t\t<button @click=\"autoConnect\" :disabled=\"connecting || devices.length == 0\"\r\n\t\t\t\tstyle=\"margin-left:12px;\">{{ connecting ? '正在自动连接...' : '自动连接' }}</button>\r\n\t\t\t<!-- Debug: show devices count and raw devices for troubleshooting -->\r\n\t\t\t<view>\r\n\t\t\t\t<text>设备计数: {{ devices.length }}</text>\r\n\t\t\t\t<text style=\"font-size:12px; color:gray\">{{ _fmt(devices) }}</text>\r\n\t\t\t</view>\r\n\t\t\t<view v-if=\"devices.length\">\r\n\t\t\t\t<text>已发现设备:</text>\r\n\t\t\t\t<view v-for=\"item in devices\" :key=\"item.deviceId\" class=\"device-item\">\r\n\t\t\t\t\t<text>{{ item.name!='' ? item.name : '未知设备' }} ({{ item.deviceId }})</text>\r\n\t\t\t\t\t<button @click=\"connect(item.deviceId)\">连接</button>\r\n\r\n\t\t\t\t\t<button v-if=\"connectedIds.includes(item.deviceId)\" @click=\"disconnect(item.deviceId)\"\r\n\t\t\t\t\t\t:disabled=\"disconnecting\">断开</button>\r\n\t\t\t\t\t<button v-if=\"connectedIds.includes(item.deviceId)\"\r\n\t\t\t\t\t\t@click=\"showServices(item.deviceId)\">查看服务</button>\r\n\t\t\t\t\t<button v-if=\"connectedIds.includes(item.deviceId)\"\r\n\t\t\t\t\t\t@click=\"autoDiscoverInterfaces(item.deviceId)\">自动发现接口</button>\r\n\t\t\t\t\t<button v-if=\"connectedIds.includes(item.deviceId)\"\r\n\t\t\t\t\t\t@click=\"getDeviceInfo(item.deviceId)\">设备信息</button>\r\n\r\n\t\t\t\t\t<!-- DFU 按钮,仅在 APP-ANDROID 可见 -->\r\n\r\n\t\t\t\t\t<button v-if=\"connectedIds.includes(item.deviceId)\" @click=\"startDfuFlow(item.deviceId)\">DFU\r\n\t\t\t\t\t\t升级</button>\r\n\t\t\t\t\t<button v-if=\"connectedIds.includes(item.deviceId)\"\r\n\t\t\t\t\t\t@click=\"startDfuFlow(item.deviceId, '/static/OmFw2509140009.zip')\">使用内置固件 DFU</button>\r\n\r\n\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t<view class=\"section\">\r\n\t\t\t<text>日志:</text>\r\n\t\t\t<scroll-view direction=\"vertical\" style=\"height:240px;\">\r\n\t\t\t\t<text v-for=\"(log, idx) in logs\" :key=\"idx\" style=\"font-size:12px;\">{{ log }}</text>\r\n\t\t\t</scroll-view>\r\n\t\t</view>\r\n\t\t<view v-if=\"showingServicesFor\">\r\n\t\t\t<view class=\"section\">\r\n\t\t\t\t<text>设备 {{ showingServicesFor }} 的服务:</text>\r\n\t\t\t\t<view v-if=\"services.length\">\r\n\t\t\t\t\t<view v-for=\"srv in services\" :key=\"srv.uuid\" class=\"service-item\">\r\n\t\t\t\t\t\t<text>{{ srv.uuid }}</text>\r\n\t\t\t\t\t\t<button @click=\"showCharacteristics(showingServicesFor, srv.uuid)\">查看特征</button>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t\t<view v-else><text>无服务</text></view>\r\n\t\t\t\t<button @click=\"closeServices\">关闭</button>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t<view v-if=\"showingCharacteristicsFor\">\r\n\t\t\t<view class=\"section\">\r\n\t\t\t\t<text>服务 的特征:</text>\r\n\t\t\t\t<view v-if=\"characteristics.length\">\r\n\t\t\t\t\t<view v-for=\"char in characteristics\" :key=\"char.uuid\" class=\"char-item\">\r\n\t\t\t\t\t\t<text>{{ char.uuid }} [{{ charProps(char) }}]</text>\r\n\t\t\t\t\t\t<view style=\"display:flex; flex-direction:row; margin-top:6px\">\r\n\t\t\t\t\t\t\t<button v-if=\"char.properties?.read\"\r\n\t\t\t\t\t\t\t\t@click=\"readCharacteristic(showingCharacteristicsFor.deviceId, showingCharacteristicsFor.serviceId, char.uuid)\">读取</button>\r\n\t\t\t\t\t\t\t<button v-if=\"char.properties?.write\"\r\n\t\t\t\t\t\t\t\t@click=\"writeCharacteristic(showingCharacteristicsFor.deviceId, showingCharacteristicsFor.serviceId, char.uuid)\">写入(测试)</button>\r\n\t\t\t\t\t\t\t<button v-if=\"char.properties?.notify\"\r\n\t\t\t\t\t\t\t\t@click=\"toggleNotify(showingCharacteristicsFor.deviceId, showingCharacteristicsFor.serviceId, char.uuid)\">{{ isNotifying(char.uuid) ? '取消订阅' : '订阅' }}</button>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t\t<view v-else><text>无特征</text></view>\r\n\t\t\t\t<button @click=\"closeCharacteristics\">关闭</button>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t</scroll-view>\r\n</template>\r\n\r\n<script lang=\"uts\">\r\n\timport { BluetoothService } from '@/uni_modules/ak-sbsrv/utssdk/interface.uts'\r\n\t// Platform-specific entrypoint: import the platform index per build target to avoid bundler including Android-only code in web builds\r\n\r\n\timport { bluetoothService } from '@/uni_modules/ak-sbsrv/utssdk/app-android/index.uts'\r\n\r\n\r\n\r\n\r\n\timport type { BleDevice, BleService, BleCharacteristic } from '@/uni_modules/ak-sbsrv/utssdk/interface.uts'\r\n\timport { ProtocolHandler } from '@/uni_modules/ak-sbsrv/utssdk/protocol_handler.uts'\r\n\r\n\r\n\timport { dfuManager } from '@/uni_modules/ak-sbsrv/utssdk/app-android/dfu_manager.uts'\r\n\r\n\timport { PermissionManager } from '@/ak/PermissionManager.uts'\r\n\ttype ShowingCharacteristicsFor = {\r\n\t\tdeviceId : string,\r\n\t\tserviceId : string\r\n\t}\r\n\r\n\texport default {\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\tscanning: false,\r\n\t\t\t\tconnecting: false,\r\n\t\t\t\tdisconnecting: false,\r\n\t\t\t\tdevices: [] as BleDevice[],\r\n\t\t\t\tconnectedIds: [] as string[],\r\n\t\t\t\tlogs: [] as string[],\r\n\t\t\t\tshowingServicesFor: '',\r\n\t\t\t\tservices: [] as BleService[],\r\n\t\t\t\tshowingCharacteristicsFor: { deviceId: '', serviceId: '' } as ShowingCharacteristicsFor,\r\n\t\t\t\tcharacteristics: [] as BleCharacteristic[],\r\n\t\t\t\t// 新增协议相关参数\r\n\t\t\t\tprotocolDeviceId: '',\r\n\t\t\t\tprotocolServiceId: '',\r\n\t\t\t\tprotocolWriteCharId: '',\r\n\t\t\t\tprotocolNotifyCharId: '',\r\n\t\t\t\t// protocol handler instances/cache\r\n\t\t\t\tprotocolHandlerMap: new Map<string, ProtocolHandler>(),\r\n\t\t\t\tprotocolHandler: null as ProtocolHandler | null,\r\n\t\t\t\t// optional services input (comma-separated UUIDs)\r\n\t\t\t\toptionalServicesInput: '',\r\n\t\t\t\t// presets for common BLE services (label -> UUID). 'custom' allows free-form input.\r\n\t\t\t\tpresetOptions: [\r\n\t\t\t\t\t{ label: '无', value: '' },\r\n\t\t\t\t\t{ label: 'Battery Service (180F)', value: '0000180f-0000-1000-8000-00805f9b34fb' },\r\n\t\t\t\t\t{ label: 'Device Information (180A)', value: '0000180a-0000-1000-8000-00805f9b34fb' },\r\n\t\t\t\t\t{ label: 'Generic Attribute (1801)', value: '00001801-0000-1000-8000-00805f9b34fb' },\r\n\t\t\t\t\t{ label: 'Nordic DFU', value: '00001530-1212-efde-1523-785feabcd123' },\r\n\t\t\t\t\t{ label: 'Nordic UART (NUS)', value: '6e400001-b5a3-f393-e0a9-e50e24dcca9e' },\r\n\t\t\t\t\t{ label: '自定义', value: 'custom' }\r\n\t\t\t\t],\r\n\t\t\t\tpresetSelected: '',\r\n\t\t\t\t// map of characteristicId -> boolean (is currently subscribed)\r\n\t\t\t\tnotifyingMap: new Map<string, boolean>(),\r\n\t\t\t}\r\n\t\t},\r\n\t\tmounted() {\r\n\t\t\tPermissionManager.requestBluetoothPermissions((granted : boolean) => {\r\n\t\t\t\tif (!granted) {\r\n\t\t\t\t\tuni.showToast({ title: '请授权蓝牙和定位权限', icon: 'none' });\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t});\r\n\t\t\tthis.log('页面 mounted: 初始化事件监听和蓝牙权限请求完成')\r\n\t\t\t// deviceFound - only accept devices whose name starts with 'CF' or 'BCL'\r\n\t\t\tbluetoothService.on('deviceFound', (payload) => {\r\n\t\t\t\ttry {\r\n\t\t\t\t\t// this.log('[event] deviceFound -> ' + this._fmt(payload))\r\n\t\t\t\t\t// console.log('[event] deviceFound -> ' + this._fmt(payload))\r\n\t\t\t\t\t// payload can be UTSJSONObject-like or plain object. Normalize.\r\n\t\t\t\t\tlet rawDevice = payload?.device;\r\n\t\t\t\t\tif (rawDevice == null) {\r\n\t\t\t\t\t\tthis.log('[event] deviceFound - payload.device is null, ignoring');\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// extract name\r\n\t\t\t\t\tlet name : string | null = rawDevice.name;\r\n\r\n\t\t\t\t\tif (name == null) {\r\n\t\t\t\t\t\tthis.log('[event] deviceFound - 无名称,忽略: ' + this._fmt(rawDevice as any))\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst n = name as string;\r\n\t\t\t\t\tif (!(n.startsWith('CF') || n.startsWith('BCL'))) {\r\n\t\t\t\t\t\tthis.log('[event] deviceFound - 名称不匹配前缀,忽略: ' + n)\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst exists = this.devices.some(d => d != null && d.name == n);\r\n\r\n\t\t\t\t\tif (!exists) {\r\n\t\t\t\t\t\t// rawDevice is non-null here per earlier guard\r\n\t\t\t\t\t\tthis.devices.push(rawDevice as BleDevice);\r\n\t\t\t\t\t\tconst deviceIdStr = (rawDevice.deviceId != null) ? rawDevice.deviceId : '';\r\n\t\t\t\t\t\tthis.log('发现设备: ' + n + ' (' + deviceIdStr + ')');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconst deviceIdStr = (rawDevice.deviceId != null) ? rawDevice.deviceId : '';\r\n\t\t\t\t\t\tthis.log('发现重复设备: ' + n + ' (' + deviceIdStr + ')')\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (err) {\r\n\t\t\t\t\tthis.log('[error] deviceFound handler error: ' + getErrorMessage(err))\r\n\t\t\t\t\tconsole.log(err)\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\t// scanFinished\r\n\t\t\tbluetoothService.on('scanFinished', (payload) => {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.scanning = false\r\n\t\t\t\t\tthis.log('[event] scanFinished -> ' + this._fmt(payload))\r\n\t\t\t\t} catch (err) {\r\n\t\t\t\t\tthis.log('[error] scanFinished handler error: ' + getErrorMessage(err))\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\t// connectionStateChanged\r\n\t\t\tbluetoothService.on('connectionStateChanged', (payload) => {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.log('[event] connectionStateChanged -> ' + this._fmt(payload))\r\n\t\t\t\t\tif (payload != null) {\r\n\t\t\t\t\t\tconst device = payload.device\r\n\t\t\t\t\t\tconst state = payload.state\r\n\t\t\t\t\t\tthis.log(`设备 ${device?.deviceId} 连接状态变为: ${state}`)\r\n\t\t\t\t\t\t// maintain connectedIds\r\n\t\t\t\t\t\tif (state == 2) {\r\n\t\t\t\t\t\t\tif (device != null && device.deviceId != null && !this.connectedIds.includes(device.deviceId)) {\r\n\t\t\t\t\t\t\t\tthis.connectedIds.push(device.deviceId)\r\n\t\t\t\t\t\t\t\tthis.log(`已记录已连接设备: ${device.deviceId}`)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else if (state == 0) {\r\n\t\t\t\t\t\t\tif (device != null && device.deviceId != null) {\r\n\t\t\t\t\t\t\t\tthis.connectedIds = this.connectedIds.filter(id => id !== device.deviceId)\r\n\t\t\t\t\t\t\t\tthis.log(`已移除已断开设备: ${device.deviceId}`)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (err) {\r\n\t\t\t\t\tthis.log('[error] connectionStateChanged handler error: ' + getErrorMessage(err))\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\tasync startDfuFlow(deviceId : string, staticFilePath : string = '') {\r\n\t\t\t\tif (staticFilePath != null && staticFilePath !== '') {\r\n\t\t\t\t\tthis.log('DFU 开始: 使用内置固件文件 ' + staticFilePath)\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.log('DFU 开始: 请选择固件文件')\r\n\t\t\t\t}\r\n\t\t\t\ttry {\r\n\t\t\t\t\tlet chosenPath : string | null = null\r\n\t\t\t\t\tlet fileName : string | null = null\r\n\t\t\t\t\tif (staticFilePath != null && staticFilePath !== '') {\r\n\t\t\t\t\t\t// Use the app's bundled static file path\r\n\t\t\t\t\t\tchosenPath = staticFilePath.replace(/^\\/+/, '')\r\n\t\t\t\t\t\tconst tmpName = staticFilePath.split(/[\\/]/).pop()\r\n\t\t\t\t\t\tfileName = (tmpName != null && tmpName !== '') ? tmpName : staticFilePath\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconst res = await new Promise<any>((resolve, reject) => {\r\n\t\t\t\t\t\t\tuni.chooseFile({ count: 1, success: (r) => resolve(r), fail: (e) => reject(e) })\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\tconsole.log(res)\r\n\t\t\t\t\t\t// Generator-friendly: avoid property iteration or bracket indexing.\r\n\t\t\t\t\t\t// Serialize and regex-match common file fields (path/uri/tempFilePath/name).\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tconst s = (() => { try { return JSON.stringify(res); } catch (e) { return ''; } })()\r\n\t\t\t\t\t\t\tconst m = s.match(/\"(?:path|uri|tempFilePath|temp_file_path|tempFilePath|name)\"\\s*:\\s*\"([^\"]+)\"/i)\r\n\t\t\t\t\t\t\tif (m != null && m.length >= 2) {\r\n\t\t\t\t\t\t\t\tconst capturedCandidate : string | null = (m[1] != null ? m[1] : null)\r\n\t\t\t\t\t\t\t\tconst captured : string = capturedCandidate != null ? capturedCandidate : ''\r\n\t\t\t\t\t\t\t\tif (captured !== '') {\r\n\t\t\t\t\t\t\t\t\tchosenPath = captured\r\n\t\t\t\t\t\t\t\t\tconst toTest : string = captured\r\n\t\t\t\t\t\t\t\t\tif (!(/^[a-zA-Z]:\\\\|^\\\\\\//.test(toTest) || /:\\/\\//.test(toTest))) {\r\n\t\t\t\t\t\t\t\t\t\tconst m2 = s.match(/\"(?:path|uri|tempFilePath|temp_file_path|tempFilePath)\"\\s*:\\s*\"([^\"]+)\"/i)\r\n\t\t\t\t\t\t\t\t\t\tif (m2 != null && m2.length >= 2 && m2[1] != null) {\r\n\t\t\t\t\t\t\t\t\t\t\tconst pathCandidate : string = m2[1] != null ? ('' + m2[1]) : ''\r\n\t\t\t\t\t\t\t\t\t\t\tif (pathCandidate !== '') chosenPath = pathCandidate\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tconst nameMatch = s.match(/\"name\"\\s*:\\s*\"([^\"]+)\"/i)\r\n\t\t\t\t\t\t\tif (nameMatch != null && nameMatch.length >= 2 && nameMatch[1] != null) {\r\n\t\t\t\t\t\t\t\tconst nm : string = nameMatch[1] != null ? ('' + nameMatch[1]) : ''\r\n\t\t\t\t\t\t\t\tif (nm !== '') fileName = nm\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} catch (err) { /* ignore */ }\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (chosenPath == null || chosenPath == '') {\r\n\t\t\t\t\t\tthis.log('未选择文件')\r\n\t\t\t\t\t\treturn\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// filePath is non-null and non-empty here\r\n\t\t\t\t\tconst fpStr : string = chosenPath as string\r\n\t\t\t\t\tconst lastSeg = fpStr.split(/[\\/]/).pop();\r\n\t\t\t\t\tconst displayName = (fileName != null && fileName !== '') ? fileName : (lastSeg != null && lastSeg !== '' ? lastSeg : fpStr)\r\n\t\t\t\t\tthis.log('已选文件: ' + displayName + ' 路径: ' + fpStr)\r\n\t\t\t\t\tconst bytes = await this._readFileAsUint8Array(fpStr)\r\n\t\t\t\t\tthis.log('固件读取完成, 大小: ' + bytes.length)\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tawait dfuManager.startDfu(deviceId, bytes, {\r\n\t\t\t\t\t\t\tuseNordic: false,\r\n\t\t\t\t\t\t\tonProgress: (p : number) => this.log('DFU 进度: ' + p + '%'),\r\n\t\t\t\t\t\t\tonLog: (s : string) => this.log('DFU: ' + s),\r\n\t\t\t\t\t\t\tcontrolTimeout: 30000\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\tthis.log('DFU 完成')\r\n\t\t\t\t\t} catch (e) {\r\n\t\t\t\t\t\tthis.log('DFU 失败: ' + getErrorMessage(e))\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tconsole.log('选择或读取固件失败: ' + e)\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t_readFileAsUint8Array(path : string) : Promise<Uint8Array> {\r\n\t\t\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tconsole.log('should readfile')\r\n\t\t\t\t\t\tconst fsm = uni.getFileSystemManager()\r\n\t\t\t\t\t\tconsole.log(fsm)\r\n\t\t\t\t\t\t// Read file as ArrayBuffer directly to avoid base64 encoding issues\r\n\t\t\t\t\t\tfsm.readFile({\r\n\t\t\t\t\t\t\tfilePath: path, success: (res) => {\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tconst data = res.data as ArrayBuffer\r\n\t\t\t\t\t\t\t\t\tconst arr = new Uint8Array(data)\r\n\t\t\t\t\t\t\t\t\tresolve(arr)\r\n\t\t\t\t\t\t\t\t} catch (e) { reject(e) }\r\n\t\t\t\t\t\t\t}, fail: (err) => { reject(err) }\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t} catch (e) { reject(e) }\r\n\t\t\t\t})\r\n\t\t\t},\r\n\r\n\t\t\tlog(msg : string) {\r\n\t\t\t\tconst ts = new Date().toISOString();\r\n\t\t\t\tthis.logs.unshift(`[${ts}] ${msg}`)\r\n\t\t\t\tif (this.logs.length > 100) this.logs.length = 100\r\n\t\t\t},\r\n\t\t\t_fmt(obj : any) : string {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (obj == null) return 'null'\r\n\t\t\t\t\tif (typeof obj == 'string') return obj\r\n\t\t\t\t\treturn JSON.stringify(obj)\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\treturn '' + obj\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonPresetChange(e : any) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\t// Some platforms emit { detail: { value: 'x' } }, others emit { value: 'x' } or just 'x'.\r\n\t\t\t\t\t// Serialize and regex-extract to avoid direct property access that the UTS->Kotlin generator may emit incorrectly.\r\n\t\t\t\t\tconst s = (() => { try { return JSON.stringify(e); } catch (err) { return ''; } })()\r\n\t\t\t\t\tlet val : string = this.presetSelected\r\n\t\t\t\t\t// try detail.value first\r\n\t\t\t\t\tconst m = s.match(/\"detail\"\\s*:\\s*\\{[^}]*\"value\"\\s*:\\s*\"([^\\\"]+)\"/i)\r\n\t\t\t\t\tif (m != null && m.length >= 2 && m[1] != null) {\r\n\t\t\t\t\t\tval = '' + m[1]\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconst m2 = s.match(/\"value\"\\s*:\\s*\"([^\\\"]+)\"/i)\r\n\t\t\t\t\t\tif (m2 != null && m2.length >= 2 && m2[1] != null) {\r\n\t\t\t\t\t\t\tval = '' + m2[1]\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.presetSelected = val\r\n\t\t\t\t\tif (val == 'custom' || val == '') {\r\n\t\t\t\t\t\tthis.log('已选择预设: ' + (val == 'custom' ? '自定义' : '无'))\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.optionalServicesInput = val;\r\n\t\t\t\t\tthis.log('已选择预设服务 UUID: ' + val)\r\n\t\t\t\t} catch (err) {\r\n\t\t\t\t\tthis.log('[error] onPresetChange: ' + getErrorMessage(err))\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tscanDevices() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.scanning = true\r\n\t\t\t\t\tthis.devices = []\r\n\t\t\t\t\t// prepare optional services: prefer free-form input, otherwise use selected preset (unless preset is 'custom' or empty)\r\n\t\t\t\t\tlet raw = (this.optionalServicesInput != null ? this.optionalServicesInput : '').trim();\r\n\t\t\t\t\tif (raw.length == 0 && this.presetSelected != null && this.presetSelected !== '' && this.presetSelected !== 'custom') {\r\n\t\t\t\t\t\traw = this.presetSelected;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// normalize helper: expand 16-bit UUIDs like '180F' to full 128-bit UUIDs\r\n\t\t\t\t\tconst normalize = (s : string) => {\r\n\t\t\t\t\t\tif (s == null || s.length == 0) return '';\r\n\t\t\t\t\t\tconst u = s.toLowerCase().replace(/^0x/, '').trim();\r\n\t\t\t\t\t\tconst hex = u.replace(/[^0-9a-f]/g, '');\r\n\t\t\t\t\t\tif (/^[0-9a-f]{4}$/.test(hex)) return `0000${hex}-0000-1000-8000-00805f9b34fb`;\r\n\t\t\t\t\t\treturn s;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tconst optionalServices = raw.length > 0 ? raw.split(',').map(s => normalize(s.trim())).filter(s => s.length > 0) : []\r\n\t\t\t\t\tthis.log('开始扫描... optionalServices=' + JSON.stringify(optionalServices))\r\n\t\t\t\t\tbluetoothService.scanDevices({ \"protocols\": ['BLE'], \"optionalServices\": optionalServices })\r\n\t\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\t\tthis.log('scanDevices resolved')\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t.catch((e) => {\r\n\t\t\t\t\t\t\tthis.log('[error] scanDevices failed: ' + getErrorMessage(e))\r\n\t\t\t\t\t\t\tthis.scanning = false\r\n\t\t\t\t\t\t})\r\n\t\t\t\t} catch (err) {\r\n\t\t\t\t\tthis.log('[error] scanDevices thrown: ' + getErrorMessage(err))\r\n\t\t\t\t\tthis.scanning = false\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tconnect(deviceId : string) {\r\n\t\t\t\tthis.connecting = true\r\n\t\t\t\tthis.log(`connect start -> ${deviceId}`)\r\n\t\t\t\ttry {\r\n\t\t\t\t\tbluetoothService.connectDevice(deviceId, 'BLE', { timeout: 10000 }).then(() => {\r\n\t\t\t\t\t\tif (!this.connectedIds.includes(deviceId)) this.connectedIds.push(deviceId)\r\n\t\t\t\t\t\tthis.log('连接成功: ' + deviceId)\r\n\t\t\t\t\t}).catch((e) => {\r\n\t\t\t\t\t\tthis.log('连接失败: ' + getErrorMessage(e!));\r\n\t\t\t\t\t}).finally(() => {\r\n\t\t\t\t\t\tthis.connecting = false\r\n\t\t\t\t\t\tthis.log(`connect finished -> ${deviceId}`)\r\n\t\t\t\t\t})\r\n\t\t\t\t} catch (err) {\r\n\t\t\t\t\tthis.log('[error] connect thrown: ' + getErrorMessage(err))\r\n\t\t\t\t\tthis.connecting = false\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdisconnect(deviceId : string) {\r\n\t\t\t\tif (!this.connectedIds.includes(deviceId)) return\r\n\t\t\t\tthis.disconnecting = true\r\n\t\t\t\tthis.log(`disconnect start -> ${deviceId}`)\r\n\t\t\t\tbluetoothService.disconnectDevice(deviceId, 'BLE').then(() => {\r\n\t\t\t\t\tthis.log('已断开: ' + deviceId)\r\n\t\t\t\t\tthis.connectedIds = this.connectedIds.filter(id => id !== deviceId)\r\n\t\t\t\t\t// 清理协议处理器缓存\r\n\t\t\t\t\tthis.protocolHandlerMap.delete(deviceId)\r\n\t\t\t\t}).catch((e) => {\r\n\t\t\t\t\tthis.log('断开失败: ' + getErrorMessage(e!));\r\n\t\t\t\t}).finally(() => {\r\n\t\t\t\t\tthis.disconnecting = false\r\n\t\t\t\t\tthis.log(`disconnect finished -> ${deviceId}`)\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\tshowServices(deviceId : string) {\r\n\t\t\t\tthis.showingServicesFor = deviceId\r\n\t\t\t\tthis.services = []\r\n\t\t\t\tthis.log(`showServices start -> ${deviceId}`)\r\n\t\t\t\tbluetoothService.getServices(deviceId).then((list) => {\r\n\t\t\t\t\tthis.log('showServices result -> ' + this._fmt(list))\r\n\t\t\t\t\tthis.services = list as BleService[]\r\n\t\t\t\t\tthis.log('服务数: ' + (list != null ? list.length : 0) + ' [' + deviceId + ']');\r\n\t\t\t\t}).catch((e) => {\r\n\t\t\t\t\tthis.log('获取服务失败: ' + getErrorMessage(e!));\r\n\t\t\t\t}).finally(() => {\r\n\t\t\t\t\tthis.log(`showServices finished -> ${deviceId}`)\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\tcloseServices() {\r\n\t\t\t\tthis.showingServicesFor = ''\r\n\t\t\t\tthis.services = []\r\n\t\t\t},\r\n\t\t\tshowCharacteristics(deviceId : string, serviceId : string) {\r\n\t\t\t\tthis.showingCharacteristicsFor = { deviceId, serviceId }\r\n\t\t\t\tthis.characteristics = []\r\n\t\t\t\tbluetoothService.getCharacteristics(deviceId, serviceId).then((list) => {\r\n\t\t\t\t\tthis.characteristics = list as BleCharacteristic[]\r\n\t\t\t\t\tconsole.log('特征数: ' + (list != null ? list.length : 0) + ' [' + deviceId + ']');\r\n\t\t\t\t\t// 自动查找可用的写入和通知特征\r\n\t\t\t\t\tconst writeChar = this.characteristics.find(c => c.properties.write)\r\n\t\t\t\t\tconst notifyChar = this.characteristics.find(c => c.properties.notify)\r\n\t\t\t\t\tif (writeChar != null && notifyChar != null) {\r\n\t\t\t\t\t\tthis.protocolDeviceId = deviceId\r\n\t\t\t\t\t\tthis.protocolServiceId = serviceId\r\n\t\t\t\t\t\tthis.protocolWriteCharId = writeChar.uuid\r\n\t\t\t\t\t\tthis.protocolNotifyCharId = notifyChar.uuid\r\n\t\t\t\t\t\tlet abs = bluetoothService as BluetoothService\r\n\t\t\t\t\t\tthis.protocolHandler = new ProtocolHandler(abs)\r\n\t\t\t\t\t\tlet handler = this.protocolHandler\r\n\t\t\t\t\t\thandler?.setConnectionParameters(deviceId, serviceId, writeChar.uuid, notifyChar.uuid)\r\n\t\t\t\t\t\thandler?.initialize()?.then(() => {\r\n\t\t\t\t\t\t\tconsole.log(\"协议处理器已初始化,可进行协议测试\")\r\n\t\t\t\t\t\t})?.catch(e => {\r\n\t\t\t\t\t\t\tconsole.log(\"协议处理器初始化失败: \" + getErrorMessage(e!))\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t}).catch((e) => {\r\n\t\t\t\t\tconsole.log('获取特征失败: ' + getErrorMessage(e!));\r\n\t\t\t\t});\r\n\t\t\t\t// tracking notifying state\r\n\t\t\t\t// this.$set(this, 'notifyingMap', this.notifyingMap || {});\r\n\t\t\t},\r\n\t\t\tcloseCharacteristics() {\r\n\t\t\t\tthis.showingCharacteristicsFor = { deviceId: '', serviceId: '' }\r\n\t\t\t\tthis.characteristics = []\r\n\t\t\t},\r\n\t\t\tcharProps(char : BleCharacteristic) : string {\r\n\t\t\t\tconst p = char.properties\r\n\t\t\t\tconst parts = [] as string[]\r\n\t\t\t\tif (p.read) parts.push('R')\r\n\t\t\t\tif (p.write) parts.push('W')\r\n\t\t\t\tif (p.notify) parts.push('N')\r\n\t\t\t\tif (p.indicate) parts.push('I')\r\n\t\t\t\treturn parts.join('/')\r\n\t\t\t\t// return [p.read ? 'R' : '', p.write ? 'W' : '', p.notify ? 'N' : '', p.indicate ? 'I' : ''].filter(Boolean).join('/')\r\n\t\t\t},\r\n\t\t\tisNotifying(uuid : string) {\r\n\t\t\t\treturn this.notifyingMap.has(uuid) && this.notifyingMap.get(uuid) == true\r\n\t\t\t},\r\n\t\t\tasync readCharacteristic(deviceId : string, serviceId : string, charId : string) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.log(`readCharacteristic ${charId} ...`)\r\n\t\t\t\t\tconst buf = await bluetoothService.readCharacteristic(deviceId, serviceId, charId)\r\n\t\t\t\t\tlet text = ''\r\n\t\t\t\t\ttry { text = new TextDecoder().decode(new Uint8Array(buf)) } catch (e) { text = '' }\r\n\t\t\t\t\tconst hex = Array.from(new Uint8Array(buf)).map(b => b.toString(16).padStart(2, '0')).join(' ')\r\n\t\t\t\t\tconsole.log(`读取 ${charId}: text='${text}' hex='${hex}'`)\r\n\t\t\t\t\tthis.log(`读取 ${charId}: text='${text}' hex='${hex}'`)\r\n\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tthis.log('读取特征失败: ' + getErrorMessage(e))\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tasync writeCharacteristic(deviceId : string, serviceId : string, charId : string) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconst payload = new Uint8Array([0x01])\r\n\t\t\t\t\tconst ok = await bluetoothService.writeCharacteristic(deviceId, serviceId, charId, payload, null)\r\n\t\t\t\t\tif (ok) this.log(`写入 ${charId} 成功`);\r\n\t\t\t\t\telse this.log(`写入 ${charId} 失败`);\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tthis.log('写入特征失败: ' + getErrorMessage(e))\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tasync toggleNotify(deviceId : string, serviceId : string, charId : string) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconst map = this.notifyingMap\r\n\t\t\t\t\tconst cur = map.get(charId) == true\r\n\t\t\t\t\tif (cur) {\r\n\t\t\t\t\t\t// unsubscribe\r\n\t\t\t\t\t\tawait bluetoothService.unsubscribeCharacteristic(deviceId, serviceId, charId)\r\n\t\t\t\t\t\tmap.set(charId, false)\r\n\t\t\t\t\t\tthis.log(`取消订阅 ${charId}`)\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// subscribe with callback\r\n\t\t\t\t\t\tawait bluetoothService.subscribeCharacteristic(deviceId, serviceId, charId, (payload : any) => {\r\n\t\t\t\t\t\t\tlet data : ArrayBuffer | null = null\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tif (payload instanceof ArrayBuffer) {\r\n\t\t\t\t\t\t\t\t\tdata = payload\r\n\t\t\t\t\t\t\t\t} else if (payload != null && typeof payload == 'string') {\r\n\t\t\t\t\t\t\t\t\t// some runtimes deliver base64 strings\r\n\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\tconst s = atob(payload)\r\n\t\t\t\t\t\t\t\t\t\tconst tmp = new Uint8Array(s.length)\r\n\t\t\t\t\t\t\t\t\t\tfor (let i = 0; i < s.length; i++) {\r\n\t\t\t\t\t\t\t\t\t\t\tconst ch = s.charCodeAt(i)\r\n\t\t\t\t\t\t\t\t\t\t\ttmp[i] = (ch == null) ? 0 : (ch & 0xff)\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tdata = tmp.buffer\r\n\t\t\t\t\t\t\t\t\t} catch (e) { data = null }\r\n\t\t\t\t\t\t\t\t} else if (payload != null && (payload as UTSJSONObject).get('data') instanceof ArrayBuffer) {\r\n\t\t\t\t\t\t\t\t\tdata = (payload as UTSJSONObject).get('data') as ArrayBuffer\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tconst arr = data != null ? new Uint8Array(data) : new Uint8Array([])\r\n\t\t\t\t\t\t\t\tconst hex = Array.from(arr).map(b => b.toString(16).padStart(2, '0')).join(' ')\r\n\t\t\t\t\t\t\t\tthis.log(`notify ${charId}: ${hex}`)\r\n\t\t\t\t\t\t\t} catch (e) { this.log('notify callback error: ' + getErrorMessage(e)) }\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\tmap.set(charId, true)\r\n\t\t\t\t\t\tthis.log(`订阅 ${charId}`)\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tthis.log('订阅/取消订阅失败: ' + getErrorMessage(e))\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tautoConnect() {\r\n\t\t\t\tif (this.connecting) return;\r\n\t\t\t\tthis.connecting = true;\r\n\t\t\t\tconst toConnect = this.devices.filter(d => !this.connectedIds.includes(d.deviceId));\r\n\t\t\t\tif (toConnect.length == 0) {\r\n\t\t\t\t\tthis.log('没有可自动连接的设备');\r\n\t\t\t\t\tthis.connecting = false;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tlet successCount = 0;\r\n\t\t\t\tlet failCount = 0;\r\n\t\t\t\tlet finished = 0;\r\n\t\t\t\ttoConnect.forEach(device => {\r\n\t\t\t\t\tbluetoothService.connectDevice(device.deviceId, 'BLE', { timeout: 10000 }).then(() => {\r\n\t\t\t\t\t\tif (!this.connectedIds.includes(device.deviceId)) this.connectedIds.push(device.deviceId);\r\n\t\t\t\t\t\tthis.log('自动连接成功: ' + device.deviceId);\r\n\t\t\t\t\t\tsuccessCount++;\r\n\t\t\t\t\t\t//\tthis.getOrInitProtocolHandler(device.deviceId);\r\n\t\t\t\t\t}).catch((e) => {\r\n\t\t\t\t\t\tthis.log('自动连接失败: ' + device.deviceId + ' ' + getErrorMessage(e!));\r\n\t\t\t\t\t\tfailCount++;\r\n\t\t\t\t\t}).finally(() => {\r\n\t\t\t\t\t\tfinished++;\r\n\t\t\t\t\t\tif (finished == toConnect.length) {\r\n\t\t\t\t\t\t\tthis.connecting = false;\r\n\t\t\t\t\t\t\tthis.log(`自动连接完成,成功${successCount},失败${failCount}`);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\tautoDiscoverInterfaces(deviceId : string) {\r\n\t\t\t\tthis.log('自动发现接口中...')\r\n\t\t\t\tbluetoothService.getAutoBleInterfaces(deviceId)\r\n\t\t\t\t\t.then((res) => {\r\n\t\t\t\t\t\tconsole.log(res)\r\n\t\t\t\t\t\tthis.log('自动发现接口成功: ' + JSON.stringify(res))\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.catch((e) => {\r\n\t\t\t\t\t\tconsole.log(e)\r\n\t\t\t\t\t\tthis.log('自动发现接口失败: ' + getErrorMessage(e!))\r\n\t\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t// 新增:测试电量功能\r\n\t\t\tasync getOrInitProtocolHandler(deviceId : string) : Promise<ProtocolHandler> {\r\n\t\t\t\tlet handler = this.protocolHandlerMap.get(deviceId);\r\n\t\t\t\tif (handler == null) {\r\n\t\t\t\t\t// 自动发现接口\r\n\t\t\t\t\tconst res = await bluetoothService.getAutoBleInterfaces(deviceId);\r\n\t\t\t\t\thandler = new ProtocolHandler(bluetoothService as BluetoothService);\r\n\t\t\t\t\thandler.setConnectionParameters(deviceId, res.serviceId, res.writeCharId, res.notifyCharId);\r\n\t\t\t\t\tawait handler.initialize();\r\n\t\t\t\t\tthis.protocolHandlerMap.set(deviceId, handler);\r\n\t\t\t\t\tthis.log(`协议处理器已初始化: ${deviceId}`);\r\n\t\t\t\t}\r\n\t\t\t\treturn handler!;\r\n\t\t\t},\r\n\r\n\t\t\tasync getDeviceInfo(deviceId : string) {\r\n\t\t\t\tthis.log('获取设备信息中...');\r\n\t\t\t\ttry {\r\n\t\t\t\t\t// First try protocol handler (if device exposes custom protocol)\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tconst handler = await this.getOrInitProtocolHandler(deviceId);\r\n\t\t\t\t\t\t// 获取电量\r\n\t\t\t\t\t\tconst battery = await handler.testBatteryLevel();\r\n\t\t\t\t\t\tthis.log('协议: 电量: ' + battery);\r\n\t\t\t\t\t\t// 获取软件/硬件版本\r\n\t\t\t\t\t\tconst swVersion = await handler.testVersionInfo(false);\r\n\t\t\t\t\t\tthis.log('协议: 软件版本: ' + swVersion);\r\n\t\t\t\t\t\tconst hwVersion = await handler.testVersionInfo(true);\r\n\t\t\t\t\t\tthis.log('协议: 硬件版本: ' + hwVersion);\r\n\t\t\t\t\t} catch (protoErr) {\r\n\t\t\t\t\t\tthis.log('协议处理器不可用或初始化失败,继续使用通用 GATT 查询: ' + ((protoErr != null && protoErr instanceof Error) ? protoErr.message : this._fmt(protoErr)));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Additionally, attempt to read standard services: Generic Access (0x1800), Generic Attribute (0x1801), Battery (0x180F)\r\n\t\t\t\t\tconst stdServices = ['1800', '1801', '180f'].map(s => {\r\n\t\t\t\t\t\tconst hex = s.toLowerCase().replace(/^0x/, '');\r\n\t\t\t\t\t\treturn /^[0-9a-f]{4}$/.test(hex) ? `0000${hex}-0000-1000-8000-00805f9b34fb` : s;\r\n\t\t\t\t\t});\r\n\t\t\t\t\t// fetch services once to avoid repeated GATT server queries\r\n\t\t\t\t\tconst services = await bluetoothService.getServices(deviceId);\r\n\t\t\t\t\tfor (const svc of stdServices) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tthis.log('读取服务: ' + svc);\r\n\t\t\t\t\t\t\t// find matching service\r\n\t\t\t\t\t\t\tconst found = services.find((x : any) => {\r\n\t\t\t\t\t\t\t\tconst uuid = (x as UTSJSONObject).get('uuid')\r\n\t\t\t\t\t\t\t\treturn uuid != null && uuid.toString().toLowerCase() == svc.toLowerCase()\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tif (found == null) {\r\n\t\t\t\t\t\t\t\tthis.log('未发现服务 ' + svc + '(需重新扫描并包含 optionalServices');\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tconst chars = await bluetoothService.getCharacteristics(deviceId, found?.uuid as string);\r\n\t\t\t\t\t\t\tconsole.log(`服务 ${svc} 包含 ${chars.length} 个特征`, chars);\r\n\t\t\t\t\t\t\tfor (const c of chars) {\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tif (c.properties?.read == true) {\r\n\t\t\t\t\t\t\t\t\t\tconst buf = await bluetoothService.readCharacteristic(deviceId, found?.uuid as string, c.uuid);\r\n\t\t\t\t\t\t\t\t\t\t// try to decode as utf8 then hex\r\n\t\t\t\t\t\t\t\t\t\tlet text = '';\r\n\t\t\t\t\t\t\t\t\t\ttry { text = new TextDecoder().decode(new Uint8Array(buf)); } catch (e) { text = ''; }\r\n\t\t\t\t\t\t\t\t\t\tconst hex = Array.from(new Uint8Array(buf)).map(b => b.toString(16).padStart(2, '0')).join(' ');\r\n\t\t\t\t\t\t\t\t\t\tconsole.log(`特征 ${c.uuid} 读取: text='${text}' hex='${hex}'`);\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\tconsole.log(`特征 ${c.uuid} 不可读`);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} catch (e) {\r\n\t\t\t\t\t\t\t\t\tconsole.log(`读取特征 ${c.uuid} 失败: ${getErrorMessage(e)}`);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} catch (e) {\r\n\t\t\t\t\t\t\tconsole.log('查询服务 ' + svc + ' 失败: ' + getErrorMessage(e));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tconsole.log('获取设备信息失败: ' + getErrorMessage(e));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tfunction getErrorMessage(e : Error | string | null) : string {\r\n\t\tif (e == null) return '';\r\n\t\tif (typeof e == 'string') return e;\r\n\t\ttry {\r\n\t\t\treturn JSON.stringify(e);\r\n\t\t} catch (err) {\r\n\t\t\treturn '' + e;\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style scoped>\r\n\t.container {\r\n\t\tpadding: 16px;\r\n\t\tflex: 1;\r\n\t}\r\n\r\n\t.section {\r\n\t\tmargin-bottom: 18px;\r\n\t}\r\n\r\n\t.device-item {\r\n\t\tdisplay: flex;\r\n\t\tflex-direction: row;\r\n\t\tflex-wrap: wrap;\r\n\t}\r\n\r\n\t.service-item,\r\n\t.char-item {\r\n\t\tmargin: 6px 0;\r\n\t}\r\n\r\n\tbutton {\r\n\t\tmargin-left: 8px;\r\n\t}\r\n</style>",null,null],"names":[],"mappings":";;;;;;;;;;;;;+BA8PW;+BA6DW;+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