From f7e37a8c21b8b96c1ee9e8f3d9eb6359c3f109cc Mon Sep 17 00:00:00 2001 From: zhangmenghan Date: Tue, 3 Dec 2024 08:19:29 +0800 Subject: [PATCH 1/6] add socket test Signed-off-by: zhangmenghan --- .../bluetooth/sockettest/entry/.gitignore | 6 + .../sockettest/entry/build-profile.json5 | 51 ++ .../bluetooth/sockettest/entry/hvigorfile.ts | 21 + .../sockettest/entry/obfuscation-rules.txt | 18 + .../sockettest/entry/oh-package.json5 | 25 + .../main/ets/entryability/EntryAbility.ets | 61 ++ .../entry/src/main/ets/pages/Index.ets | 620 ++++++++++++++++++ .../entry/src/main/ets/workers/Worker.ets | 175 +++++ .../sockettest/entry/src/main/module.json5 | 57 ++ .../main/resources/base/element/color.json | 237 +++++++ .../main/resources/base/element/string.json | 28 + .../src/main/resources/base/media/icon.png | Bin 0 -> 2041 bytes .../resources/base/profile/main_pages.json | 5 + .../main/resources/en_US/element/string.json | 34 + .../main/resources/zh_CN/element/string.json | 28 + .../entry/src/mock/mock-config.json5 | 17 + .../src/ohosTest/ets/test/Ability.test.ets | 62 ++ .../entry/src/ohosTest/ets/test/List.test.ets | 20 + .../ohosTest/ets/testability/TestAbility.ets | 64 ++ .../ohosTest/ets/testability/pages/Index.ets | 32 + .../ets/testrunner/OpenHarmonyTestRunner.ets | 107 +++ .../entry/src/ohosTest/module.json5 | 52 ++ .../resources/base/element/color.json | 8 + .../resources/base/element/string.json | 16 + .../ohosTest/resources/base/media/icon.png | Bin 0 -> 2041 bytes .../resources/base/profile/test_pages.json | 5 + .../sockettest/entry/src/test/List.test.ets | 20 + .../entry/src/test/LocalUnit.test.ets | 48 ++ 28 files changed, 1817 insertions(+) create mode 100644 function/communication/bluetooth/sockettest/entry/.gitignore create mode 100644 function/communication/bluetooth/sockettest/entry/build-profile.json5 create mode 100644 function/communication/bluetooth/sockettest/entry/hvigorfile.ts create mode 100644 function/communication/bluetooth/sockettest/entry/obfuscation-rules.txt create mode 100644 function/communication/bluetooth/sockettest/entry/oh-package.json5 create mode 100644 function/communication/bluetooth/sockettest/entry/src/main/ets/entryability/EntryAbility.ets create mode 100644 function/communication/bluetooth/sockettest/entry/src/main/ets/pages/Index.ets create mode 100644 function/communication/bluetooth/sockettest/entry/src/main/ets/workers/Worker.ets create mode 100644 function/communication/bluetooth/sockettest/entry/src/main/module.json5 create mode 100644 function/communication/bluetooth/sockettest/entry/src/main/resources/base/element/color.json create mode 100644 function/communication/bluetooth/sockettest/entry/src/main/resources/base/element/string.json create mode 100644 function/communication/bluetooth/sockettest/entry/src/main/resources/base/media/icon.png create mode 100644 function/communication/bluetooth/sockettest/entry/src/main/resources/base/profile/main_pages.json create mode 100644 function/communication/bluetooth/sockettest/entry/src/main/resources/en_US/element/string.json create mode 100644 function/communication/bluetooth/sockettest/entry/src/main/resources/zh_CN/element/string.json create mode 100644 function/communication/bluetooth/sockettest/entry/src/mock/mock-config.json5 create mode 100644 function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/test/Ability.test.ets create mode 100644 function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/test/List.test.ets create mode 100644 function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/testability/TestAbility.ets create mode 100644 function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/testability/pages/Index.ets create mode 100644 function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets create mode 100644 function/communication/bluetooth/sockettest/entry/src/ohosTest/module.json5 create mode 100644 function/communication/bluetooth/sockettest/entry/src/ohosTest/resources/base/element/color.json create mode 100644 function/communication/bluetooth/sockettest/entry/src/ohosTest/resources/base/element/string.json create mode 100644 function/communication/bluetooth/sockettest/entry/src/ohosTest/resources/base/media/icon.png create mode 100644 function/communication/bluetooth/sockettest/entry/src/ohosTest/resources/base/profile/test_pages.json create mode 100644 function/communication/bluetooth/sockettest/entry/src/test/List.test.ets create mode 100644 function/communication/bluetooth/sockettest/entry/src/test/LocalUnit.test.ets diff --git a/function/communication/bluetooth/sockettest/entry/.gitignore b/function/communication/bluetooth/sockettest/entry/.gitignore new file mode 100644 index 00000000..e2713a27 --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/build-profile.json5 b/function/communication/bluetooth/sockettest/entry/build-profile.json5 new file mode 100644 index 00000000..719bdfc7 --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/build-profile.json5 @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "apiType": "stageMode", + "buildOption": { + "arkOptions": { + // "apPath": "./modules.ap" /* Profile used for profile-guided optimization (PGO), a compiler optimization technique to improve app runtime performance. */ + }, + "sourceOption": { + "workers":[ + './src/main/ets/workers/Worker.ets' + ] + } + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/hvigorfile.ts b/function/communication/bluetooth/sockettest/entry/hvigorfile.ts new file mode 100644 index 00000000..ac00aaea --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/hvigorfile.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/function/communication/bluetooth/sockettest/entry/obfuscation-rules.txt b/function/communication/bluetooth/sockettest/entry/obfuscation-rules.txt new file mode 100644 index 00000000..985b2aeb --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/oh-package.json5 b/function/communication/bluetooth/sockettest/entry/oh-package.json5 new file mode 100644 index 00000000..4e54d14e --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/oh-package.json5 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/function/communication/bluetooth/sockettest/entry/src/main/ets/entryability/EntryAbility.ets b/function/communication/bluetooth/sockettest/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 00000000..b5e74e12 --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import AbilityConstant from '@ohos.app.ability.AbilityConstant'; +import hilog from '@ohos.hilog'; +import UIAbility from '@ohos.app.ability.UIAbility'; +import Want from '@ohos.app.ability.Want'; +import window from '@ohos.window'; +import socket from '@ohos.bluetooth.socket'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + // socket.sppCloseServerSocket(this.serverNumber); + // socket.sppCloseClientSocket(this.clientNumber); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/function/communication/bluetooth/sockettest/entry/src/main/ets/pages/Index.ets b/function/communication/bluetooth/sockettest/entry/src/main/ets/pages/Index.ets new file mode 100644 index 00000000..de3dac6b --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,620 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import socket from '@ohos.bluetooth.socket'; +import { BusinessError } from '@ohos.base'; +import worker, { MessageEvents, ErrorEvent } from '@ohos.worker'; +import { WorkerParam, WorkParam } from '.././workers/Worker'; +import bluetooth from '@ohos.bluetooth.connection'; +import abilityAccessCtrl, { Context, PermissionRequestResult } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; + +interface PairDevices { + id: string;//配对设备的蓝牙mac地址 + name: string//配对设备的名字 +} + +@Component +export struct TitleBar { + private title!: string; + build() { + Column() { + Row() { + Text(this.title) + .fontSize(20) + .layoutWeight(1) + .margin({ left: 16 }) + .align(Alignment.Start) + Blank() + } + .height(56) + .width('100%') + } + } +} + +@Extend(Column) +function backgroundStyle() { + .width('100%') + .padding(12) + .borderRadius(16) + .backgroundColor(Color.White) + .justifyContent(FlexAlign.SpaceAround) +} + + +@Entry +@Component +struct Index { + private sppOption:socket.SppOptions = { //spp监听配置参数 + uuid: '22001101-0000-1000-8000-77666f9b34fb', + secure: false, + type: 0, + }; + private serverNumber: number = -1; //服务端Socket的id + private clientNumber: number = -1; //客户端Socket的id + @State len: number = 0; //服务端每次收到字长 + @State deltaDate: number = 0; //服务端每次收包时间 + @State packageNum: number = 0; //服务端收包个数 + @State velocity: number = 0; + @State messageArr: Array = []; //服务端收包字长数组 + @State deltaDateArr: Array = []; //服务端收包时间数组 + @State packageNumArr: Array = []; //服务端收包个数数组 + @State velocityArr: Array = []; + @State acceptNum: number = 0; //服务端收包次数 + @State serverButtonText: string = '测试Socket服务端'; //服务端按钮文本 + @State zeroLength: number = 0; //服务端接收的0的字长 + @State oneItem: number = 0; //数组中1的索引 + @State serverMac: string = '00:00:00:00:00:00';//服务端蓝牙mac地址 + @State pairDevices: Array = []; + @State devicesSelectOptions: Array = []; + @State serverColor: Color = Color.Blue;//服务端按钮颜色 + @State logButColor: Color = Color.White; + @State workParam: WorkParam = { + cliButtText: '测试Socket客户端', + cliColor: Color.Blue, + numArr: [], + packArr: [], + messArr: [], + cliCnt: 0, + cliLen: 0, + cliBol: true + } + @State serBol: boolean = true; //是否禁用服务端按钮 + @State message: string = 'Hello World'; + @State listDirection: Axis = Axis.Vertical; + @State space: number = 10; + @State strokeWidth: number = 0; + @State color: string = '#409EFF'; + @State barState: BarState = BarState.Auto; + @State scrollBarWidth: number = 0; + @State scrollBarColor: Color = Color.Blue; + @State initIndex: number = AppStorage.get('listSampleInitIndex') || 0; + @State edgeEffect: EdgeEffect = EdgeEffect.Spring; + @State isChainAnimation: boolean = false; + @State multiSelectable: boolean = false; + @State lanes: number = 1; + @State alignListItem: ListItemAlign = ListItemAlign.Center; + private controller: Scroller = new Scroller(); + @State numberArray: number[] = []; //服务端接收次序 + @State sendCnt: string = '100'; //传输次数 + @State packageSize: string = '1024'; //包长 + @State nameIndex: number = 1; + @State cntIndex: number = 1; + @State deviceIndex: number = 1; + @State packageIndex: number = 1; + @State recvSize: number = 0; //服务端接收总字长 + @State recvDuration: number = 0; //服务端总计时 + @State recvPackageNum: number = 0; + @State debug: boolean = false; + @State logCnt: number = 0; + @State starttime: number = 0; + @State endtime: number = 0; + private data: Uint8Array = new Uint8Array(); + + print(msg: string) { + if (this.debug) { + console.log(msg); + } + } + + getPairDevice(){ + let macs: Array = bluetooth.getPairedDevices();//获取蓝牙mac地址列表 + this.print('getPairDevice macs: '+JSON.stringify(macs)); + for (let i = 0; i < macs.length; i++) { + let name = bluetooth.getRemoteDeviceName(macs[i]);//获取对端蓝牙设备名称 + this.print('getPairDevice name: '+JSON.stringify(name)); + this.pairDevices.push({ id: macs[i], name: name }); + } + this.print('getPairDevice pairDevices: '+JSON.stringify(this.pairDevices)); + } + + pairDevicesToSelectOptions(pairDevices: Array): Array { + let result = new Array(); + for(let i = 0; i < pairDevices.length; i++) { + result[i] = { value: pairDevices[i].name }; + } + return result; + } + + aboutToAppear(){ + let abilityMgr: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); + let context: Context = getContext(this) as common.UIAbilityContext; + abilityMgr.requestPermissionsFromUser(context, ['ohos.permission.ACCESS_BLUETOOTH'], (error: BusinessError, result: PermissionRequestResult) => { + console.log('bluetooth requestPermissionsFromUser, err: ' + JSON.stringify(error) + '; result: ' + JSON.stringify(result)); + }); + this.getPairDevice(); + this.devicesSelectOptions = this.pairDevicesToSelectOptions(this.pairDevices); + } + + @Styles + listItemTextDynamicSize(){ + .height(this.listDirection === Axis.Horizontal ? '99%' : '20%') + .width(this.listDirection === Axis.Vertical ? '99%' : '20%') + } + + printMess() { + this.print(`============第${this.acceptNum}次接收数据============`); + this.print(`data[0] = ${this.data[0]}, data.length is ${this.data.length}`); + this.print(`this.len is ${this.len}`); + // this.print(`data = ${this.data}`); + } + + startInit() { + this.starttime = new Date().getTime(); + this.packageNum++; + this.acceptNum++; + } + + endCalculate() { + this.endtime = new Date().getTime(); + this.deltaDate = this.endtime - this.starttime; + this.velocity = this.len * 1000 / (this.deltaDate * 1024); + this.printMess(); + this.print(`endtime is ${this.endtime}`); + this.print(`this.deltaDate is ${this.deltaDate}`); + this.numberArray.push(this.acceptNum); + this.packageNumArr.push(this.packageNum); + this.messageArr.push(this.len); + this.deltaDateArr.push(this.deltaDate); + this.velocityArr.push(this.velocity); + this.recvDuration += this.deltaDate;//总计时 + this.recvSize += this.len;//总字长 + this.recvPackageNum += this.packageNum; + this.starttime = 0; + this.endtime = 0; + this.len = 0; + this.packageNum = 0; + } + + checkHead(): boolean { + if (this.data.includes(0) || this.data.includes(1)) { + if (this.starttime == 0) { + if (this.data.includes(0) && this.data.includes(1)) { + this.startInit(); + this.len = this.data.length - this.data.indexOf(1); + this.printMess(); + this.print(`starttime is ${this.starttime}`); + return true; + } else if (this.data[0] === 1) { + this.startInit(); + this.len += this.data.length; + this.printMess(); + this.print(`starttime is ${this.starttime}`); + return true; + } else { + this.printMess(); + return true; + } + } else { + return false; + } + } else { + return false; + } + } + + checkTail(): boolean { + if (this.data.includes(101)) { + if (this.starttime !== 0) { + if (this.data.includes(100)) { + this.len += this.data.indexOf(101); + this.packageNum++; + } + this.endCalculate(); + return true; + } else { + this.printMess(); + return true; + } + } else { + return false; + } + } + + checkEnd(): boolean { + if (this.data.includes(199)) { + setTimeout(() => { + this.print('delay 3s'); + try { + socket.off('sppRead', this.clientNumber); + this.print('取消订阅spp读请求事件成功!'); + try { + socket.sppCloseServerSocket(this.serverNumber); + this.print('关闭服务端监听Socket成功!'); + this.serverButtonText = '测试Socket服务端'; + this.serverColor = Color.Blue; + this.serBol = true; + } catch (err) { + this.print('关闭服务端监听Socket失败,err: ' + JSON.stringify(err)); + this.serverButtonText = '关闭服务端监听Socket失败,请再试一次'; + this.serBol = true; + this.serverColor = Color.Red; + } + } catch (err) { + this.print('取消订阅spp读请求事件失败,err: ' + JSON.stringify(err)); + this.serverButtonText = '取消订阅spp读请求事件失败,请再试一次'; + this.serBol = true; + this.serverColor = Color.Red; + try { + socket.sppCloseServerSocket(this.serverNumber); + this.print('关闭服务端监听Socket成功!'); + } catch (err) { + this.print('关闭服务端监听Socket失败,err: ' + JSON.stringify(err)); + } + } + }, 3000); + return true; + } else { + return false; + } + } + + onRead=(dataBuffer: ArrayBuffer)=>{ + this.data = new Uint8Array(dataBuffer); + if (this.checkHead()) { + if (this.checkEnd()) { + return; + } + return; + } + if (this.checkTail()) { + return; + } + this.len += this.data.length; + this.packageNum++; + this.printMess(); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { + TitleBar({ title: '蓝牙Socket测试' }) + .flexGrow(0) + .onClick(() => { + this.logCnt++; + if (this.logCnt % 2 === 0) { + this.debug = false; + } else { + this.debug = true; + } + if (this.debug) { + this.logButColor = Color.Pink; + } else { + this.logButColor = Color.White; + } + this.print(`this.debug is ${this.debug}`); + this.print(`this.logButColor is ${this.logButColor}`); + }) + .backgroundColor(this.logButColor) + + // tab页签 + Column() { + Tabs({ barPosition: BarPosition.Start }) { + // 子页签:WaterFlow控制 + TabContent() { + Column() { + Row() { + Text('服务端') + Select(this.devicesSelectOptions) + .value('已配对的设备') + .backgroundColor(Color.White) + .borderRadius(19) + .constraintSize({ minWidth: 100 }) + .selected(this.deviceIndex) + .onSelect((index) => { + this.nameIndex = index; + this.serverMac = this.pairDevices[this.nameIndex].id; + }) + .width('70%') + .margin(10) + .borderRadius(2) + } + Row() { + Text('次数') + Select([{ value: '1'}, { value: '10' }, { value: '100' }, { value: '1000' }]) + .value(this.sendCnt) + .backgroundColor(Color.White) + .borderRadius(19) + .constraintSize({ minWidth: 100 }) + .selected(this.cntIndex) + .onSelect((index, value) => { + this.cntIndex = index; + this.sendCnt = value; + }) + .width(50) + .margin(10) + .borderRadius(2) + + Text('长度') + Select([{ value: '10' }, { value: '1024' }, { value: '4096' }]) + .value(this.packageSize) + .backgroundColor(Color.White) + .borderRadius(19) + .constraintSize({ minWidth: 100 }) + .selected(this.packageIndex) + .onSelect((index, value) => { + this.packageIndex = index; + this.packageSize = value; + }) + .margin(10) + .borderRadius(2) + } + + //客户端按钮 + Button(this.workParam.cliButtText) + .height(50) + .width('80%') + .onClick(() => { + this.workParam.cliButtText = '数据发送中...'; + this.workParam.cliColor = Color.Grey; + this.acceptNum = 0; + this.numberArray.length = 0;//服务端切至客户端清除收包信息列表 + this.workParam.numArr.length = 0; + this.workParam.cliCnt = 0; + this.workParam.cliLen = 0; + this.workParam.cliBol = false; + // 主线程中创建Worker对象 + const workerInstance = new worker.ThreadWorker('entry/ets/workers/Worker.ets'); + let workerParam: WorkerParam = { + cnt: Number(this.sendCnt), + packageSize: Number(this.packageSize), + deviceId: this.serverMac, + debug: this.debug + } + let paramStr = JSON.stringify(workerParam); + // 主线程向worker线程传递信息 + workerInstance.postMessage(paramStr); + // 主线程接收worker线程信息 + workerInstance.onmessage = (e: MessageEvents): void => { + this.print('main thread onmessage'); + // data:worker线程发送的信息 + let data: WorkParam = JSON.parse(e.data) + this.workParam = data; + } + workerInstance.onerror = (err: ErrorEvent) => { + this.print('main error message ' + err.message); + } + }) + .backgroundColor(this.workParam.cliColor) + .enabled(this.workParam.cliBol) + .stateEffect(true) + } + .height('100%') + }.tabBar(new SubTabBarStyle($r('app.string.Socket_client'))) + + // 子页签:WaterFlow属性 + TabContent() { + Column() { + //服务端按钮 + Button(`${this.serverButtonText}`) + .height(50) + .width('80%') + .onClick(() => { + this.serverButtonText = '数据接收中...'; + this.serverColor = Color.Grey; + this.serBol = false;//禁用按钮 + this.workParam.cliCnt = 0; + this.workParam.numArr.length = 0;//客户端切至服务端清除发包信息列表 + this.workParam.packArr.length = 0; + this.workParam.messArr.length = 0; + this.messageArr.length = 0; + this.numberArray.length = 0; + this.deltaDateArr.length = 0; + this.packageNumArr.length = 0; + this.velocityArr.length = 0; + this.messageArr.length = 0; + this.recvSize = 0; + this.recvDuration = 0; + this.recvPackageNum = 0; + this.acceptNum = 0; + let times = new Date().getTime(); + console.info(`times : ===== ${times} =====`); + //创建服务端监听Socket + socket.sppListen('server', this.sppOption, (code: BusinessError, serverId: number) => { + if (code) { + this.print('服务端监听失败,code:' + JSON.stringify(code)); + this.serverButtonText = '服务端监听失败,请再试一次'; + this.serBol = true; + this.serverColor = Color.Red; + return; + } else { + this.serverNumber = serverId; + this.print(`服务端监听成功, serverNumber = ${this.serverNumber}`); + this.print('服务端等待连接'); + try { + //与客户端连接 + socket.sppAccept(this.serverNumber, (code: BusinessError, cliendId: number) => { + if (code) { + this.print('服务端等待连接失败,code: ' + JSON.stringify(code)); + if ((code.code === -1) && (code.message === 'Inner error.')) { + this.serverButtonText = '蓝牙未打开,请再试一次'; + this.serBol = true; + this.serverColor = Color.Red; + } + return; + } else { + this.clientNumber = cliendId; + this.print(`服务端等待连接成功, clientNumber = ${this.clientNumber}`); + try { + let dataRead = this.onRead; + //服务端接收数据 + socket.on('sppRead', cliendId, dataRead); + this.print('订阅spp读请求事件成功!'); + } catch (err) { + this.print('订阅spp读请求事件失败,err: ' + JSON.stringify(err)); + this.serverButtonText = '订阅spp读请求事件失败,请再试一次'; + this.serBol = true; + this.serverColor = Color.Red; + } + } + }) + } catch (err) { + this.print('创建监听Socket服务端crash, err: ' + JSON.stringify(err)); + } + } + }) + }) + .backgroundColor(this.serverColor) + .enabled(this.serBol) + .stateEffect(true) + } + .height('100%') + }.tabBar(new SubTabBarStyle($r('app.string.Socket_server'))) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .backgroundColor(Color.Pink) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + } + .height('30%') + .width('100%') + + // List + Column() { + //客户端发送信息列表 + List({ scroller: this.controller, initialIndex: this.initIndex, space: this.space }) { + ForEach(this.workParam.numArr, (item: number, index: number) => { + ListItem() { + Column() { + Text(`第${ this.workParam.numArr[item-1] }次,发包${ this.workParam.packArr[item-1] }个,长${ + this.workParam.messArr[item-1] }字节`) + .margin(5) + .width('90%') + .align(Alignment.Center) + .textAlign(TextAlign.Center) + } + .width('100%') + .backgroundColor('#0d000000') + .height(40) + } + }) + } + + //服务端接收信息列表 + List({ scroller: this.controller, initialIndex: this.initIndex, space: this.space }) { + ForEach(this.numberArray, (item: number, index: number) => { + ListItem() { + Column() { + Text(`第${this.numberArray[item-1]}次,收包${ this.packageNumArr[item-1] }个,长${this.messageArr[item-1]}字节`) + .margin(5) + .width('90%') + .align(Alignment.TopStart) + .textAlign(TextAlign.Start) + Text(`用时${this.deltaDateArr[item-1]}毫秒,速度${ Math.round(this.velocityArr[item-1]) } KB/s`) + .margin(5) + .width('90%') + .align(Alignment.BottomEnd) + .textAlign(TextAlign.End) + } + .width('100%') + .backgroundColor('#0d000000') + .height(60) + } + }) + } + .alignListItem(this.alignListItem) + .height('100%') + .width('100%') + .listDirection(this.listDirection) + .scrollBar(this.barState) + .scrollBarColor(this.scrollBarColor) + .scrollBarWidth(this.scrollBarWidth) + .edgeEffect(this.edgeEffect) + .multiSelectable(this.multiSelectable) + .chainAnimation(this.isChainAnimation) + .lanes(this.lanes) + .divider( + { + strokeWidth: this.strokeWidth, + color: this.color + } + ) + } + .padding({ left: 12, right: 12 }) + .backgroundStyle() + .height('40%') + .width('100%') + .flexGrow(0) + + Column() { + if (this.acceptNum !== 0) { + Text() { + Span(`共测试次数: ${this.acceptNum}`) + } + + Text(`共收到字节: ${this.recvSize}字节`) + .textAlign(TextAlign.Start) + .fontColor(Color.Gray) + + Text(`共收到包数: ${this.recvPackageNum}`) + .textAlign(TextAlign.Start) + .fontColor(Color.Gray) + + Text(`总计时: ${(this.recvDuration * 0.001).toFixed(6)}s`) + .textAlign(TextAlign.Start) + .fontColor(Color.Gray) + + Text(`平均速度:${Math.round(this.recvSize * 1000 / (this.recvDuration * 1024))}KB/s`) + .textAlign(TextAlign.Start) + .fontColor(Color.Gray) + } + if (this.workParam.cliCnt !== 0) { + Text() { + Span(`共测试次数: ${this.workParam.cliCnt}`) + } + + Text(`共发送字节: ${this.workParam.cliLen}字节`) + .textAlign(TextAlign.Start) + .fontColor(Color.Gray) + } + } + .height('16%') + .width('100%') + .padding({left:12}) + .alignItems(HorizontalAlign.Start) + .justifyContent(FlexAlign.Center) + .flexGrow(0) + } + .padding({ left: 12, right: 12 }) + .height('100%') + .width('100%') + .backgroundColor('$color:index_background') + } +} \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/src/main/ets/workers/Worker.ets b/function/communication/bluetooth/sockettest/entry/src/main/ets/workers/Worker.ets new file mode 100644 index 00000000..238aaa58 --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/main/ets/workers/Worker.ets @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import socket from '@ohos.bluetooth.socket'; +import { BusinessError } from '@ohos.base'; +import worker, { ThreadWorkerGlobalScope, MessageEvents, ErrorEvent } from '@ohos.worker'; + +export interface WorkerParam { + cnt: number; //发送次数 + packageSize: number; //包长 + deviceId: string; + debug: boolean; +} + + +export interface WorkParam { + cliButtText: string; //客户端按钮文本 + cliColor: Color; //客户端按钮颜色 + numArr: Array; //发送数据次数 + packArr: Array; //每次收包次数 + messArr: Array; //每次发送的字节长 + cliCnt: number, //客户端总共发送次数 + cliLen: number, //客户端总共发送字节长度 + cliBol: boolean //是否禁用按钮 +} + +const sppOption:socket.SppOptions = { + uuid: '22001101-0000-1000-8000-77666f9b34fb', + secure: false, + type: 0 +}; +let clientNumber: number = -1; +let packNum: number = 0; //发包数 +let leng: number = 0; //每次发送字长 +let workParam: WorkParam = { + cliButtText: '数据发送中...', + cliColor: Color.Grey, + numArr: [], + packArr: [], + messArr: [], + cliCnt: 0, + cliLen: 0, + cliBol: false +} +let logSym: boolean = false; +function print(msg: string) { + if (logSym) { + console.log(msg); + } +} +const Sleep = (ms: number)=> { + return new Promise (resolve => setTimeout(resolve, ms)) +} + +// 创建worker线程中与主线程通信的对象 +const workerPort: ThreadWorkerGlobalScope = worker.workerPort; + +// worker线程接收主线程信息 +workerPort.onmessage = (e: MessageEvents) => { + // data:主线程发送的信息 + let data: string = e.data; + print('worker.ets onmessage'); + let dataOjbect: WorkerParam = JSON.parse(data); + logSym = dataOjbect.debug; + try { + //向服务端发起连接 + socket.sppConnect(dataOjbect.deviceId, sppOption, async (code: BusinessError, number: number) => { + if (code) { + print('发起连接失败,code: ' + JSON.stringify(code)); + if ((code.code === 2900003) && (code.message === 'BussinessError 2900003: Bluetooth disabled.')) { + workParam.cliButtText = '蓝牙未打开,请再试一次'; + workParam.cliBol = true; + workParam.cliColor = Color.Red; + let paraStr = JSON.stringify(workParam); + workerPort.postMessage(paraStr); + } + return; + } else { + print(`发起连接成功!bluetooth serverSocket Number: ${number}`); + clientNumber = number; + //向服务端发送数据 + let arrayBuffer = new ArrayBuffer(dataOjbect.packageSize); + let data = new Uint8Array(arrayBuffer); + //最后单独发送199表示发送完毕 + let arrayBuffer1 = new ArrayBuffer(32); + let data1 = new Uint32Array(arrayBuffer1); + data1[0] = 199; + try { + for (let k = 0; k < dataOjbect.cnt; k++) { + workParam.cliCnt++; + for (let j = 0; j < 102; j++) { + for (let i = 0; i < dataOjbect.packageSize; i++) { + data[i] = j; + if ((i === dataOjbect.packageSize - 1) && (j > 0) && (j < 101)) { + leng += (data.length); + } + } + if ((j > 0) && (j<101)) { + packNum++; + } + if (j === 1) { + workParam.numArr.push(k+1); + } + if (j === 100) { + workParam.packArr.push(packNum); + workParam.messArr.push(leng); + workParam.cliLen +=leng; + } + if (j === 101) { + packNum = 0; + leng =0; + } + socket.sppWrite(clientNumber, arrayBuffer); + print(`===========第${k+1}次发送数据============`); + print(`第${j}次发送: data[0]为${data[0]}, data.length为${data.length}, data is ${data}`); + } + await Sleep(2000); + print('wait 2s!') + let paraStr = JSON.stringify(workParam); + workerPort.postMessage(paraStr); + } + socket.sppWrite(clientNumber, arrayBuffer1); + print(`最后发送${data1},发送完毕!`); + setTimeout(() => { + print('delay 5s'); + try { + socket.sppCloseClientSocket(clientNumber); + print('客户端Socket关闭成功!'); + } catch (err) { + print('客户端Socket关闭失败,err: ' + JSON.stringify(err)); + if (err) { + workParam.cliButtText = '客户端Socket关闭失败,请再试一次'; + workParam.cliBol = true; + workParam.cliColor = Color.Red; + let paraStr = JSON.stringify(workParam); + workerPort.postMessage(paraStr); + } + } + // worker线程向主线程发送信息 + workParam.cliButtText = '测试Socket客户端'; + workParam.cliColor = Color.Blue; + workParam.cliBol = true; + let paraStr = JSON.stringify(workParam); + workerPort.postMessage(paraStr); + }, 5000); + } catch (err) { + print('数据发送失败,err:' + JSON.stringify(err)); + workParam.cliButtText = '数据发送失败,请再试一次'; + workParam.cliBol = true; + workParam.cliColor = Color.Red; + let paraStr = JSON.stringify(workParam); + workerPort.postMessage(paraStr); + } + } + }); + } catch (err) { + print('errCode: ' + (err as BusinessError).code + ', errMessage: ' + (err as BusinessError).message); + } +} +// worker线程发生error的回调 +workerPort.onerror = (err: ErrorEvent) => { + print('worker.ets onerror ' + err.message); +} \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/src/main/module.json5 b/function/communication/bluetooth/sockettest/entry/src/main/module.json5 new file mode 100644 index 00000000..c7874a4f --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/main/module.json5 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:icon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.ACCESS_BLUETOOTH" + } + ] + } +} \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/src/main/resources/base/element/color.json b/function/communication/bluetooth/sockettest/entry/src/main/resources/base/element/color.json new file mode 100644 index 00000000..9b2c4255 --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/main/resources/base/element/color.json @@ -0,0 +1,237 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "white", + "value": "#FFFFFF" + }, + { + "name": "bottom_title_divider", + "value": "#99838388" + }, + { + "name": "tab_bar_divider", + "value": "#33182431" + }, + { + "name": "font_color_shallow", + "value": "#182431" + }, + { + "name": "font_color_dark", + "value": "#000000" + }, + { + "name": "font_color_red", + "value": "#FFD22C2C" + }, + { + "name": "tab_bar_select", + "value": "#007DFF" + }, + { + "name": "tab_bar_unselect", + "value": "#66182431" + }, + { + "name": "background_shallow_grey", + "value": "#F1F3F5" + }, + { + "name": "background_dark", + "value": "#FF000000" + }, + { + "name": "background_grey", + "value": "#0d000000" + }, + { + "name": "background_orange", + "value": "#E6A23C" + }, + { + "name": "background_pink", + "value": "#F56C6C" + }, + { + "name": "background_blue", + "value": "#409EFF" + }, + { + "name": "background_green", + "value": "#67C23A" + }, + { + "name": "pop_up_background", + "value": "#0D182431" + }, + // Button + { + "name": "button_custom_color", + "value": "#80FF7500" + }, + { + "name": "button_default_bg_color", + "value": "#007DFF" + }, + // Divider + { + "name": "divider_block_color", + "value": "#1A838388" + }, + // Interpolation Calculation + { + "name": "curve_normal", + "value": "#3F56EA" + }, + { + "name": "curve_bezier", + "value": "#00BFC9" + }, + { + "name": "curve_spring", + "value": "#BCD600" + }, + { + "name": "curve_init", + "value": "#E40078" + }, + { + "name": "curve_steps", + "value": "#FF7500" + }, + // Radio + { + "name": "radio_response_region_color", + "value": "#66ffc0cb" + }, + // Select + { + "name": "select_option_bg_color", + "value": "#33007DFF" + }, + { + "name": "select_option_font_color", + "value": "#FF007DFF" + }, + // Toggle + { + "name": "toggle_selected_color", + "value": "#4D00BFC9" + }, + //Display + { + "name": "background_light_gray", + "value": "#f1f3f5" + }, + { + "name": "sub_title_color", + "value": "#182431" + }, + { + "name": "title_colorone", + "value": "#0A59F7" + }, + { + "name": "title_colortwo", + "value": "#000000" + }, + //辅助ScrollBarSample + { + "name": "scrollbar_background_color", + "value": "#ededed" + }, + { + "name": "contentArea_background_color", + "value": "#C0C0C0" + }, + // Interaction + { + "name": "normal_bg_color", + "value": "#0A59F7" + }, + { + "name": "btn_border_color", + "value": "#33000000" + }, + { + "name": "3D_background_color", + "value": "#F9BC64" + }, + { + "name": "3D_top_left_color", + "value": "#FED599" + }, + { + "name": "3D_right_buttom_color", + "value": "#D69942" + }, + { + "name": "btn_one_color", + "value": "#FFC0CB" + }, + { + "name": "btn_two_color", + "value": "#87CEFA" + }, + { + "name": "btn_three_color", + "value": "#90EE90" + }, + { + "name": "btn_onFocus_color", + "value": "#FF0000" + }, + { + "name": "focus_on_background", + "value": "#007DFE" + }, + { + "name": "COLOR_80000000", + "value": "#80000000" + }, + { + "name": "COLOR_FFFFFF", + "value": "#FFFFFF" + }, + { + "name": "COLOR_8C9BA2", + "value": "#8C9BA2" + }, + { + "name": "COLOR_99FFFFFF", + "value": "#99ffffff" + }, + { + "name": "canvas_background", + "value": "#ffff00" + }, + { + "name": "canvas_normal_button_bg", + "value": "#317aff" + }, + { + "name": "canvas_clear_button_bg", + "value": "#ffff7300" + }, + { + "name": "canvas_bg_color", + "value": "#00ffff" + }, + { + "name": "scroll_to_button_color", + "value": "#ff55c6f5" + }, + { + "name": "scroll_item_color", + "value": "#ff2a78db" + }, + { + "name": "scroll_grid_item_color", + "value": "#F9CF93" + } + ] +} \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/src/main/resources/base/element/string.json b/function/communication/bluetooth/sockettest/entry/src/main/resources/base/element/string.json new file mode 100644 index 00000000..d565c5ca --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,28 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "Socket应用" + }, + { + "name": "Socket_test", + "value": "蓝牙Socket测试" + }, + { + "name": "Socket_client", + "value": "Socket客户端" + }, + { + "name": "Socket_server", + "value": "Socket服务端" + } + ] +} \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/src/main/resources/base/media/icon.png b/function/communication/bluetooth/sockettest/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..cd45accb1dfd2fd0da16c732c72faa6e46b26521 GIT binary patch literal 2041 zcmaJ?c~nzZ9u6@;0AXaYAVN(;Kr(@>EJ+}skOWf=BA~*l4us@ELY9{%0m5QX6pnb} z(jZF|S&pLAS}3BZAfeQSvJ_h>F2Q1PYqi?o5`;m_yjZdG$1v}l_wK#F^L^iMz2}uD z#K$>1dON~kFlWvhW+Jp=tuN9J`ZlM-rl4h+ij|^D0y9;4JOuz-EdVnB6i3R-0ulk9 zApi4zAQA>!N9@-o026$1@L`d124`3G5<@_m`0f)Ug_Ie~;HT2q<_a=HH> zDwTdfD^-cW-|_xWVP$f@93UhDN-#&khZ>jZXLTi~$0`7x3REP6pk%&^2|`c>DutjN zMJD4Zs6Z}{FOpd;*mo2zm(GzXRXiCV;4m3zNCYnu3Fy=i5;2An&Lp!#LP;bRD~1&s z%VH6UY+}r6YDgG+p34OJIZ{BTn&%4s=CT&#TBkuOhdeU@g(w#guoa*b^)73=XyI65 z7Swys6)YS}?1EeZ6b!-I+yCnIya^g0>-NLsLWd8t56GZ_S3r|ZGbR+mV2ErEb9J)X zIF!njY-D-7{qtF2(?nlQ$0}!pzt=}hc*m%%)0Jb#N_K4@IC-`Pi5DahPZN7N9rH;ol;Gc*>-Go@gXKTM{eP)iJj6CYTIi}B#zLKZYD@_;m zrXmXXsFq@~ou-z!9bHoM8*(hwl>X(zm)TDcdkF4lZm$1jP*HbnD`o1$g}_R#+bu2D zr%7Y8KdsaC-V*aem5#@*M%r^GPgu%P2e-BnBClhP2yoGFe40>);=}>{NONtkXQ01p z)OX^t2Ojhddot9eg0WTIVSTNBa}7V-^_pO595w|Hx9q?k4dMp@$G7PK*TD=y;ck6J zdGRB!_RAI2nR3%tO1IkdWp*bw*?<=pM_LZb30?!oK)s;En( z!#nnd9=cXJ<}+e{XLdx(q3&ikJISe?eSHHohk+pz+$6Cv{ytvc{QXmMn2XQ9U8rvt zrJdAn(0gpSD@N=yTrI_2^P#*zQg7MTp1)k(lv(*(KtUR6@M|2WB>2wRwC-h=wk6XF zPtSes*_JwI+^d>xW489MJw5R6=t5?{R zc|E8i?RL@p9)A3ZJAQOg`}+F;<_vnWA!KxR#g%jZ@y_1Qu#Uw)kFPw_xmZ?a^e*1{ zM|ImtqA|(CaDQ@Fyvcof`MN66&VI6m6gAyAXx`%cDx6BI{Bj#}V*Rn1(b~;Am)D2u zX7(027IO?Z2VYK^1vXXpoZ@AtH~N?0rYWwtyA15`6vEf6fk&;o-L;7zFt`5nk*iOy z`<918zB+k;EytI$FAXug)jk*e@e};4e9g__w4A5ev!!)H$yC@{?vsRqJ##X1R%xPG z&_R3oDi$MtTkVqfPj)HEUDx_7wd!y{8#1%$U*Dd0sK@=#6+!XlsE-s^1f5E`R9Wo71^b~mbVdU;Fw0LG~mUQg;xsX4QYRo3B@rH_=ry>DE8ef!c2ta8UcI#26# zF|`*4wtMHe@%#eGZw`#Yj|QWuB`eRD)b~)r9mM95p_JVG%-IdcbIX5qG#GpGD+IrS zEqxb1Rg&Dadk5#7t4j68I1f!@A$efp1?I%&d*56)yl!tkz!14<$0Od_&6cGw$WW0r zjSlQA7l*6;vgfhv!cR|RmAD$+w6j`rVf=-?-D@q>kOseUVSb*~jbAS^*1h?ZL)n(9 zDa}`4etXO6`}9;{k5E^N{rcfnV_(LPwsDg``wtyS*V<19c3!PGJ3Kqy9ksvkwbJ%Z z*N(fT0{e*Wji-Ck5!3YE0j|PZ@&z`v=kitWL$bqSt!e4bH!+(|Q)CZ30^nVPfkx{s zX{6of`p=BiPb@u@IyL!tRk>?qgBqCmo-Zlt!636g?z`s~zdfwuB7DXZHvV`Usp+%Z zo*&;Biu@MHE&2j+?j^o`Cr12u<>vOe=a&8a2hlcmFjJiDR>XnD4c4DAhZWCkiAgW{ E51q9-lK=n! literal 0 HcmV?d00001 diff --git a/function/communication/bluetooth/sockettest/entry/src/main/resources/base/profile/main_pages.json b/function/communication/bluetooth/sockettest/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 00000000..1898d94f --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/function/communication/bluetooth/sockettest/entry/src/main/resources/en_US/element/string.json b/function/communication/bluetooth/sockettest/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 00000000..8fa976ae --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,34 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "SocketApp" + }, + { + "name": "Socket_test", + "value": "bluetooth socket test" + }, + { + "name": "Socket_client", + "value": "socket client" + }, + { + "name": "Socket_server", + "value": "socket server" + } + ] +} + +{ + "string": [ + + ] +} diff --git a/function/communication/bluetooth/sockettest/entry/src/main/resources/zh_CN/element/string.json b/function/communication/bluetooth/sockettest/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 00000000..d565c5ca --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,28 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "Socket应用" + }, + { + "name": "Socket_test", + "value": "蓝牙Socket测试" + }, + { + "name": "Socket_client", + "value": "Socket客户端" + }, + { + "name": "Socket_server", + "value": "Socket服务端" + } + ] +} \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/src/mock/mock-config.json5 b/function/communication/bluetooth/sockettest/entry/src/mock/mock-config.json5 new file mode 100644 index 00000000..26ed9f53 --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/mock/mock-config.json5 @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ +} \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/test/Ability.test.ets b/function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/test/Ability.test.ets new file mode 100644 index 00000000..e6d579db --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/test/Ability.test.ets @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import hilog from '@ohos.hilog'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import socket from '@ohos.bluetooth.socket'; +import bluetooth from '@ohos.bluetooth.connection'; + +export default function abilityTest() { + describe('ActsAbilityTest', () => { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(() => { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }) + beforeEach(() => { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }) + afterEach(() => { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }) + afterAll(() => { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }) + it('assertContain', 0, () => { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); + let a = 'abc'; + let b = 'b'; + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b); + expect(a).assertEqual(a); + }) + + it('testGetPairedDevices', 0, () => { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); + let macs: Array = bluetooth.getPairedDevices(); + console.info('the first bluetooth mac address is ' + macs[0]); + console.info('typeof macs[0] is ' + typeof(macs[0])); + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(typeof(macs[0])).assertContain('string'); + }) + }) +} \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/test/List.test.ets b/function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/test/List.test.ets new file mode 100644 index 00000000..e909c66a --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/test/List.test.ets @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import abilityTest from './Ability.test'; + +export default function testsuite() { + abilityTest(); +} \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/testability/TestAbility.ets b/function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/testability/TestAbility.ets new file mode 100644 index 00000000..5b4732ed --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/testability/TestAbility.ets @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import UIAbility from '@ohos.app.ability.UIAbility'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import hilog from '@ohos.hilog'; +import { Hypium } from '@ohos/hypium'; +import testsuite from '../test/List.test'; +import window from '@ohos.window'; +import Want from '@ohos.app.ability.Want'; +import AbilityConstant from '@ohos.app.ability.AbilityConstant'; + +export default class TestAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); + let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator; + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let abilityDelegatorArguments: AbilityDelegatorRegistry.AbilityDelegatorArgs; + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite); + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('testability/pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/testability/pages/Index.ets b/function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/testability/pages/Index.ets new file mode 100644 index 00000000..85a5c3d4 --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/testability/pages/Index.ets @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct Index { + @State message: string = 'Hello World'; + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets b/function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets new file mode 100644 index 00000000..afa5e3cd --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import UIAbility from '@ohos.app.ability.UIAbility'; +import TestRunner from '@ohos.application.testRunner'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import Want from '@ohos.app.ability.Want'; +import resourceManager from '@ohos.resourceManager'; +import util from '@ohos.util'; + +let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator; +let abilityDelegatorArguments: AbilityDelegatorRegistry.AbilityDelegatorArgs; +let jsonPath: string = 'mock/mock-config.json'; +let tag: string = 'testTag'; + +async function onAbilityCreateCallback(data: UIAbility) { + hilog.info(0x0000, 'testTag', 'onAbilityCreateCallback, data: ${}', JSON.stringify(data)); +} + +async function addAbilityMonitorCallback(err: BusinessError) { + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare'); + } + + async onRun() { + let tag = 'testTag'; + hilog.info(0x0000, tag, '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + let moduleName = abilityDelegatorArguments.parameters['-m']; + let context = abilityDelegator.getAppContext().getApplicationContext().createModuleContext(moduleName); + let mResourceManager = context.resourceManager; + await checkMock(abilityDelegator, mResourceManager); + const bundleName = abilityDelegatorArguments.bundleName; + const testAbilityName: string = 'TestAbility'; + let lMonitor: AbilityDelegatorRegistry.AbilityMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + moduleName: moduleName + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + const want: Want = { + bundleName: bundleName, + abilityName: testAbilityName, + moduleName: moduleName + }; + abilityDelegator.startAbility(want, (err: BusinessError, data: void) => { + hilog.info(0x0000, tag, 'startAbility : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, tag, 'startAbility : data : %{public}s', JSON.stringify(data) ?? ''); + }) + hilog.info(0x0000, tag, '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} + +async function checkMock(abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator, resourceManager: resourceManager.ResourceManager) { + let rawFile: Uint8Array; + try { + rawFile = resourceManager.getRawFileContentSync(jsonPath); + hilog.info(0x0000, tag, 'MockList file exists'); + let mockStr: string = util.TextDecoder.create("utf-8", { ignoreBOM: true }).decodeWithStream(rawFile); + let mockMap: Record = getMockList(mockStr); + try { + abilityDelegator.setMockList(mockMap) + } catch (error) { + let code = (error as BusinessError).code; + let message = (error as BusinessError).message; + hilog.error(0x0000, tag, `abilityDelegator.setMockList failed, error code: ${code}, message: ${message}.`); + } + } catch (error) { + let code = (error as BusinessError).code; + let message = (error as BusinessError).message; + hilog.error(0x0000, tag, `ResourceManager:callback getRawFileContent failed, error code: ${code}, message: ${message}.`); + } +} + +function getMockList(jsonStr: string) { + let jsonObj: Record = JSON.parse(jsonStr); + let map: Map = new Map(Object.entries(jsonObj)); + let mockList: Record = {}; + map.forEach((value: object, key: string) => { + let realValue: string = value['source'].toString(); + mockList[key] = realValue; + }); + hilog.info(0x0000, tag, '%{public}s', 'mock-json value:' + JSON.stringify(mockList) ?? ''); + return mockList; +} \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/src/ohosTest/module.json5 b/function/communication/bluetooth/sockettest/entry/src/ohosTest/module.json5 new file mode 100644 index 00000000..7690747e --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/ohosTest/module.json5 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "module": { + "name": "entry_test", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "abilities": [ + { + "name": "TestAbility", + "srcEntry": "./ets/testability/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "exported": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/function/communication/bluetooth/sockettest/entry/src/ohosTest/resources/base/element/color.json b/function/communication/bluetooth/sockettest/entry/src/ohosTest/resources/base/element/color.json new file mode 100644 index 00000000..3c712962 --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/ohosTest/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/src/ohosTest/resources/base/element/string.json b/function/communication/bluetooth/sockettest/entry/src/ohosTest/resources/base/element/string.json new file mode 100644 index 00000000..65d8fa5a --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/ohosTest/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + } + ] +} \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/src/ohosTest/resources/base/media/icon.png b/function/communication/bluetooth/sockettest/entry/src/ohosTest/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..cd45accb1dfd2fd0da16c732c72faa6e46b26521 GIT binary patch literal 2041 zcmaJ?c~nzZ9u6@;0AXaYAVN(;Kr(@>EJ+}skOWf=BA~*l4us@ELY9{%0m5QX6pnb} z(jZF|S&pLAS}3BZAfeQSvJ_h>F2Q1PYqi?o5`;m_yjZdG$1v}l_wK#F^L^iMz2}uD z#K$>1dON~kFlWvhW+Jp=tuN9J`ZlM-rl4h+ij|^D0y9;4JOuz-EdVnB6i3R-0ulk9 zApi4zAQA>!N9@-o026$1@L`d124`3G5<@_m`0f)Ug_Ie~;HT2q<_a=HH> zDwTdfD^-cW-|_xWVP$f@93UhDN-#&khZ>jZXLTi~$0`7x3REP6pk%&^2|`c>DutjN zMJD4Zs6Z}{FOpd;*mo2zm(GzXRXiCV;4m3zNCYnu3Fy=i5;2An&Lp!#LP;bRD~1&s z%VH6UY+}r6YDgG+p34OJIZ{BTn&%4s=CT&#TBkuOhdeU@g(w#guoa*b^)73=XyI65 z7Swys6)YS}?1EeZ6b!-I+yCnIya^g0>-NLsLWd8t56GZ_S3r|ZGbR+mV2ErEb9J)X zIF!njY-D-7{qtF2(?nlQ$0}!pzt=}hc*m%%)0Jb#N_K4@IC-`Pi5DahPZN7N9rH;ol;Gc*>-Go@gXKTM{eP)iJj6CYTIi}B#zLKZYD@_;m zrXmXXsFq@~ou-z!9bHoM8*(hwl>X(zm)TDcdkF4lZm$1jP*HbnD`o1$g}_R#+bu2D zr%7Y8KdsaC-V*aem5#@*M%r^GPgu%P2e-BnBClhP2yoGFe40>);=}>{NONtkXQ01p z)OX^t2Ojhddot9eg0WTIVSTNBa}7V-^_pO595w|Hx9q?k4dMp@$G7PK*TD=y;ck6J zdGRB!_RAI2nR3%tO1IkdWp*bw*?<=pM_LZb30?!oK)s;En( z!#nnd9=cXJ<}+e{XLdx(q3&ikJISe?eSHHohk+pz+$6Cv{ytvc{QXmMn2XQ9U8rvt zrJdAn(0gpSD@N=yTrI_2^P#*zQg7MTp1)k(lv(*(KtUR6@M|2WB>2wRwC-h=wk6XF zPtSes*_JwI+^d>xW489MJw5R6=t5?{R zc|E8i?RL@p9)A3ZJAQOg`}+F;<_vnWA!KxR#g%jZ@y_1Qu#Uw)kFPw_xmZ?a^e*1{ zM|ImtqA|(CaDQ@Fyvcof`MN66&VI6m6gAyAXx`%cDx6BI{Bj#}V*Rn1(b~;Am)D2u zX7(027IO?Z2VYK^1vXXpoZ@AtH~N?0rYWwtyA15`6vEf6fk&;o-L;7zFt`5nk*iOy z`<918zB+k;EytI$FAXug)jk*e@e};4e9g__w4A5ev!!)H$yC@{?vsRqJ##X1R%xPG z&_R3oDi$MtTkVqfPj)HEUDx_7wd!y{8#1%$U*Dd0sK@=#6+!XlsE-s^1f5E`R9Wo71^b~mbVdU;Fw0LG~mUQg;xsX4QYRo3B@rH_=ry>DE8ef!c2ta8UcI#26# zF|`*4wtMHe@%#eGZw`#Yj|QWuB`eRD)b~)r9mM95p_JVG%-IdcbIX5qG#GpGD+IrS zEqxb1Rg&Dadk5#7t4j68I1f!@A$efp1?I%&d*56)yl!tkz!14<$0Od_&6cGw$WW0r zjSlQA7l*6;vgfhv!cR|RmAD$+w6j`rVf=-?-D@q>kOseUVSb*~jbAS^*1h?ZL)n(9 zDa}`4etXO6`}9;{k5E^N{rcfnV_(LPwsDg``wtyS*V<19c3!PGJ3Kqy9ksvkwbJ%Z z*N(fT0{e*Wji-Ck5!3YE0j|PZ@&z`v=kitWL$bqSt!e4bH!+(|Q)CZ30^nVPfkx{s zX{6of`p=BiPb@u@IyL!tRk>?qgBqCmo-Zlt!636g?z`s~zdfwuB7DXZHvV`Usp+%Z zo*&;Biu@MHE&2j+?j^o`Cr12u<>vOe=a&8a2hlcmFjJiDR>XnD4c4DAhZWCkiAgW{ E51q9-lK=n! literal 0 HcmV?d00001 diff --git a/function/communication/bluetooth/sockettest/entry/src/ohosTest/resources/base/profile/test_pages.json b/function/communication/bluetooth/sockettest/entry/src/ohosTest/resources/base/profile/test_pages.json new file mode 100644 index 00000000..b7e7343c --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/ohosTest/resources/base/profile/test_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "testability/pages/Index" + ] +} diff --git a/function/communication/bluetooth/sockettest/entry/src/test/List.test.ets b/function/communication/bluetooth/sockettest/entry/src/test/List.test.ets new file mode 100644 index 00000000..ab6445db --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/test/List.test.ets @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import localUnitTest from './LocalUnit.test'; + +export default function testsuite() { + localUnitTest(); +} \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/entry/src/test/LocalUnit.test.ets b/function/communication/bluetooth/sockettest/entry/src/test/LocalUnit.test.ets new file mode 100644 index 00000000..50ee2629 --- /dev/null +++ b/function/communication/bluetooth/sockettest/entry/src/test/LocalUnit.test.ets @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; + +export default function localUnitTest() { + describe('localUnitTest',() => { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(() => { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }); + beforeEach(() => { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }); + afterEach(() => { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }); + afterAll(() => { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }); + it('assertContain', 0, () => { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + let a = 'abc'; + let b = 'b'; + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b); + expect(a).assertEqual(a); + }); + }); +} \ No newline at end of file -- Gitee From 57eac3fee80f62814112e595e9ecb7d26a647f59 Mon Sep 17 00:00:00 2001 From: zhangmenghan Date: Tue, 3 Dec 2024 08:20:30 +0800 Subject: [PATCH 2/6] add str res Signed-off-by: zhangmenghan --- .../main/resources/en_US/element/string.json | 1972 +++++++++++++++++ 1 file changed, 1972 insertions(+) diff --git a/function/communication/bluetooth/sockettest/entry/src/main/resources/en_US/element/string.json b/function/communication/bluetooth/sockettest/entry/src/main/resources/en_US/element/string.json index 8fa976ae..d776bf57 100644 --- a/function/communication/bluetooth/sockettest/entry/src/main/resources/en_US/element/string.json +++ b/function/communication/bluetooth/sockettest/entry/src/main/resources/en_US/element/string.json @@ -23,6 +23,1978 @@ { "name": "Socket_server", "value": "socket server" + }, + { + "name": "entry_desc", + "value": "Component Collection" + }, + { + "name": "MainAbility_desc", + "value": "ArkUI components, common attributes, common methods, etc. to classify and describe applications" + }, + { + "name": "opencv_core", + "value": "Core Operations" + }, + { + "name": "opencv_image", + "value": "Image Processing" + }, + { + "name": "opencv_video", + "value": "Video Analysis" + }, + { + "name": "opencv_machine", + "value": "machine learning" + }, + { + "name": "opencv_object_detection", + "value": "Object Detection" + }, + { + "name": "opencv_dnn", + "value": "Deep Neural Networks" + }, + { + "name": "animation", + "value": "Animation" + }, + { + "name": "component", + "value": "Component" + }, + { + "name": "universal", + "value": "Universal" + }, + { + "name": "global_method", + "value": "Global Method" + }, + { + "name": "auxiliary", + "value": "Auxiliary" + }, + { + "name": "common_properties", + "value": "Common properties" + }, + { + "name": "prop_background", + "value": "Background" + }, + + { + "name": "prop_foreground", + "value": "Foreground" + }, + { + "name": "prop_border", + "value": "Border" + }, + { + "name": "prop_font", + "value": "Font" + }, + { + "name": "prop_bluefont", + "value": "#409EFF" + }, + { + "name": "prop_orangefont", + "value": "#E6A23C" + }, + { + "name": "prop_pinkfont", + "value": "#F56C6C" + }, + { + "name": "prop_size", + "value": "Size" + }, + { + "name": "graphic_transformation", + "value": "Graphics Transform" + }, + { + "name": "common_events", + "value": "Common events" + }, + { + "name": "click_event", + "value": "Click event" + }, + { + "name": "touch_event", + "value": "Touch event" + }, + { + "name": "show_hide_event", + "value": "Show/Hide Event" + }, + { + "name": "drag_drop_event", + "value": "Drag/Drop Event" + }, + { + "name": "key_event", + "value": "Key Event" + }, + { + "name": "focus_event", + "value": "Focus Event" + }, + { + "name": "mouse_event", + "value": "Mouse Event" + }, + { + "name": "component_area_change_event", + "value": "Component Area Change Event" + }, + { + "name": "gesture_processing", + "value": "Gesture Processing" + }, + { + "name": "basic_gestures", + "value": "Basic Gestures" + }, + { + "name": "tap_gesture", + "value": "TapGesture" + }, + { + "name": "long_press_gesture", + "value": "LongPressGesture" + }, + { + "name": "pan_gesture", + "value": "PanGesture" + }, + { + "name": "pinch_gesture", + "value": "PinchGesture" + }, + { + "name": "rotation_gesture", + "value": "RotationGesture" + }, + { + "name": "swipe_gesture", + "value": "SwipeGesture" + }, + { + "name": "combined_gestures", + "value": "Combined Gestures" + }, + { + "name": "transition_animation", + "value": "Transition animation" + }, + { + "name": "interpolation_calculation", + "value": "Interpolation calculation" + }, + { + "name": "dialog", + "value": "Dialog" + }, + { + "name": "basic_operations_on_images", + "value": "Basic Operations" + }, + { + "name": "image_roi_example", + "value": "ROI Example" + }, + { + "name": "image_padding_example", + "value": "Padding Example" + }, + { + "name": "arithmetic_operations_on_images", + "value": "Arithmetic Example" + }, + { + "name": "image_bitwise_example", + "value": "Bitwise Example" + }, + { + "name": "some_data_structures", + "value": "Some Data Structures" + }, + { + "name": "data_structures", + "value": "Data structures" + }, + { + "name": "color_spaces", + "value": "Color Spaces" + }, + { + "name": "convert_color", + "value": "Convert Color" + }, + { + "name": "image_inrange", + "value": "Image Inrange" + }, + { + "name": "geometric_transformations", + "value": "Geometric Transformations" + }, + { + "name": "image_resize", + "value": "Image Resize" + }, + { + "name": "affine_transform", + "value": "Affine Transform" + }, + { + "name": "rotate_transform", + "value": "Rotate Transform" + }, + { + "name": "get_affine_transform", + "value": "Get Affine Transform" + }, + { + "name": "perspectiv_transform", + "value": "Perspectiv Transform" + }, + { + "name": "thresholding", + "value": "Thresholding" + }, + { + "name": "image_thresholding", + "value": "Image Thresholding" + }, + { + "name": "adaptive_thresholding", + "value": "Adaptive Thresholding" + }, + { + "name": "smoothing_images", + "value": "Smoothing Images" + }, + { + "name": "image_filter", + "value": "Image Filter" + }, + { + "name": "image_blur", + "value": "Image Blur" + }, + { + "name": "gaussion_blur", + "value": "Gaussion Blur" + }, + { + "name": "median_blur", + "value": "Median Blur" + }, + { + "name": "bilateral_filter", + "value": "Bilateral Filter" + }, + { + "name": "morphological_transformations", + "value": "Morphological Transformations" + }, + { + "name": "image_erode", + "value": "Image Erode" + }, + { + "name": "image_dilate", + "value": "Image Dilate" + }, + { + "name": "image_opening", + "value": "Image Opening" + }, + { + "name": "image_closing", + "value": "Image Closing" + }, + { + "name": "image_gradient", + "value": "Image Gradient" + }, + { + "name": "top_hat", + "value": "Top Hat" + }, + { + "name": "black_hat", + "value": "Black Hat" + }, + { + "name": "get_structuring_element", + "value": "Get Structuring Element" + }, + { + "name": "image_gradients", + "value": "Image Gradients" + }, + { + "name": "image_sobel", + "value": "Image Sobel" + }, + { + "name": "image_laplacian", + "value": "Image Laplacian" + }, + { + "name": "image_abssobel", + "value": "Image Abssobel" + }, + { + "name": "canny_edge_detection", + "value": "Canny Edge Detection" + }, + { + "name": "image_canny", + "value": "Image Canny" + }, + { + "name": "image_pyramids", + "value": "Image Pyramids" + }, + { + "name": "image_pyrdown", + "value": "Image Pyrdown" + }, + { + "name": "image_pyrup", + "value": "Image Pyrup" + }, + { + "name": "contours", + "value": "Contours" + }, + { + "name": "contours_basic", + "value": "Contours Basic" + }, + { + "name": "contours_features", + "value": "Contours Features" + }, + { + "name": "contours_properties", + "value": "Contours Properties" + }, + { + "name": "contours_more_functions", + "value": "Contours More Functions" + }, + { + "name": "contours_hierarchy", + "value": "Contours Hierarchy" + }, + { + "name": "histograms", + "value": "Histograms" + }, + { + "name": "find_plot_analyze", + "value": "Find Plot Analyze" + }, + { + "name": "equalization", + "value": "Equalization" + }, + { + "name": "backprojection", + "value": "Backprojection" + }, + { + "name": "image_transforms", + "value": "Image Transforms" + }, + { + "name": "fourier_transform", + "value": "Fourier Transform" + }, + { + "name": "template_matching", + "value": "Template Matching" + }, + { + "name": "template_match_example", + "value": "Template Match Example" + }, + { + "name": "hough_line_transform", + "value": "Hough Rine Transform" + }, + { + "name": "hough_lines", + "value": "Hough Lines" + }, + { + "name": "hough_linesp", + "value": "Hough Linesp" + }, + { + "name": "hough_circle_transform", + "value": "Hough Circle Transform" + }, + { + "name": "hough_circle", + "value": "Hough Circle" + }, + { + "name": "image_segmentation_with_watershed", + "value": "Image Segmentation With Watershed" + }, + { + "name": "image_threshold", + "value": "Image Threshold" + }, + { + "name": "image_background", + "value": "Image Background" + }, + { + "name": "distance_transform", + "value": "Distance Transform" + }, + { + "name": "image_foreground", + "value": "Image Foreground" + }, + { + "name": "image_watershed", + "value": "Image Watershed" + }, + { + "name": "forground_extraction_using_grabcut", + "value": "Forground Extraction Using Grabcut" + }, + { + "name": "image_grabcut", + "value": "Image Grabcut" + }, + { + "name": "image_processing_for_video_capture", + "value": "Image Processing For Video Capture" + }, + { + "name": "image_processing_video_example", + "value": "Image Processing Video Example" + }, + { + "name": "intelligent_scissors", + "value": "Intelligent Scissors" + }, + { + "name": "meanshift_camshift", + "value": "Meanshift Camshift" + }, + { + "name": "meanshift", + "value": "Meanshift" + }, + { + "name": "camshift", + "value": "Camshift" + }, + { + "name": "optical_flow", + "value": "Optical Flow" + }, + { + "name": "lucas_kanade_optical_flow", + "value": "Lucas Kanade Optical Flow" + }, + { + "name": "dense_optical_flow", + "value": "Dense Optical Flow" + }, + { + "name": "background_subtraction", + "value": "Background Subtraction" + }, + { + "name": "face_detection_using_haar_cascades", + "value": "Face Detection Using Haar Cascades" + }, + { + "name": "face_detection", + "value": "Face Detection" + }, + { + "name": "face_detection_in_video_capture", + "value": "Face Detection In Video Capture" + }, + { + "name": "image_classification", + "value": "Image Classification" + }, + { + "name": "image_classification_with_camera", + "value": "Image Classification With Camera" + }, + { + "name": "object_detection", + "value": "Object Detection" + }, + { + "name": "object_detection_with_camera", + "value": "Object Detection With Camera" + }, + { + "name": "semantic_segmentation", + "value": "Semantic Segmentation" + }, + { + "name": "style_transfer", + "value": "Style Transfer" + }, + { + "name": "pose_estimation", + "value": "Pose Estimation" + }, + + { + "name": "image_basic_title", + "value": "Image Basic Opertor" + }, + { + "name": "image_histogram_title", + "value": "image histogram" + }, + { + "name": "image_filter_title", + "value": "image filter" + }, + { + "name": "image_morphology_title", + "value": "image morphology" + }, + { + "name": "image_objdetect_title", + "value": "image objdetect" + }, + { + "name": "information_presentation_and_dynamic_effects", + "value": "Information presentation and dynamic effects" + }, + { + "name": "blank_and_divider", + "value": "Blank and divider" + }, + { + "name": "text_and_input", + "value": "Text and input" + }, + { + "name": "rows_and_columns", + "value": "Rows and columns" + }, + { + "name": "stack_flex_and_grid", + "value": "Stack, flex and grid" + }, + { + "name": "list_and_grid", + "value": "List and grid" + }, + { + "name": "navigation", + "value": "Navigation" + }, + { + "name": "canvas_and_graphic_drawing", + "value": "Canvas and graphic drawing" + }, + // layout Animation + { + "name": "layout_animation_expansion", + "value": "Layout animation" + }, + { + "name": "layout_animation_expansion_align", + "value": "Align animation" + }, + { + "name": "layout_animation_expansion_size", + "value": "Size animation" + }, + { + "name": "layout_animation_expansion_padding", + "value": "Padding animation" + }, + { + "name": "layout_animation_expansion_margin", + "value": "Margin animation" + }, + { + "name": "layout_animation_expansion_offset", + "value": "Offset animation" + }, + { + "name": "layout_animation_expansion_position", + "value": "Position animation" + }, + { + "name": "layout_animation_expansion_markAnchor", + "value": "MarkAnchor animation" + }, + { + "name": "layout_animation_expansion_alignRules", + "value": "AlignRules animation" + }, + { + "name": "layout_animation_expansion_direction", + "value": "Direction animation" + }, + // size transition + { + "name": "size_transition_expansion", + "value": "Size transition" + }, + { + "name": "size_transition_flex", + "value": "Flex" + }, + { + "name": "size_transition_grid_item", + "value": "GridItem" + }, + { + "name": "size_transition_list_item", + "value": "ListItem" + }, + { + "name": "size_transition_swiper_item", + "value": "SwiperItem" + }, + { + "name": "size_transition_font_size", + "value": "FontSize" + }, + { + "name": "size_transition_expansion_tabContent", + "value": "TabContent" + }, + // AlertDialog + { + "name": "alert_dialog", + "value": "Alert dialog" + }, + { + "name": "alert_dialog_type_one", + "value": "One button alert dialog" + }, + { + "name": "alert_dialog_type_two", + "value": "Two button alert dialog" + }, + { + "name": "alert_dialog_type_two_button_one", + "value": "This is button one" + }, + { + "name": "alert_dialog_type_two_button_two", + "value": "This is button two" + }, + { + "name": "alert_dialog_prompt", + "value": "Hint" + }, + { + "name": "alert_dialog_warning", + "value": "Warning" + }, + { + "name": "alert_dialog_info", + "value": "You are performing an action" + }, + { + "name": "alert_dialog_confirm", + "value": "Confirm" + }, + { + "name": "alert_dialog_cancel", + "value": "Cancel" + }, + { + "name": "alert_dialog_type", + "value": "Dialog type" + }, + { + "name": "alert_dialog_location", + "value": "Dialog position" + }, + { + "name": "alert_dialog_auto_cancel", + "value": "Click on the mask layer to close the dialog" + }, + { + "name": "alert_dialog_true", + "value": "Closeable" + }, + { + "name": "alert_dialog_false", + "value": "Non-closing" + }, + { + "name": "alert_dialog_top", + "value": "Vertical top" + }, + { + "name": "alert_dialog_center", + "value": "Vertical center" + }, + { + "name": "alert_dialog_bottom", + "value": "Vertical bottom" + }, + { + "name": "alert_dialog_offset", + "value": "Relative position offset dialog" + }, + { + "name": "alert_dialog_left", + "value": "Upper left offset" + }, + { + "name": "alert_dialog_right", + "value": "Lower right offset" + }, + { + "name": "alert_dialog_grid", + "value": "Different grid width dialog" + }, + { + "name": "alert_dialog_grid_two", + "value": "2 grid width" + }, + { + "name": "alert_dialog_grid_three", + "value": "3 grid width" + }, + { + "name": "alert_dialog_grid_four", + "value": "4 grid width" + }, + // Foreground + { + "name": "foreground_color", + "value": "Set foreground color" + }, + // Background + { + "name": "background_color", + "value": "Set background color" + }, + { + "name": "background_gradient", + "value": "Set background gradient" + }, + { + "name": "background_gradient_linear", + "value": "linear gradient" + }, + { + "name": "background_gradient_sweep", + "value": "angle gradient" + }, + { + "name": "background_gradient_radial", + "value": "Radial gradient" + }, + { + "name": "background_image_transformation_effect", + "value": "Background image transformation effect" + }, + { + "name": "set_background_image_size", + "value": "Set background image size" + }, + { + "name": "set_background_image_position", + "value": "Set background image position" + }, + { + "name": "set_background_blur_style_color_mode", + "value": "Set background blur style color mode" + }, + { + "name": "set_background_blur_style_adaptive_color", + "value": "Set background blur style adaptive color" + }, + { + "name": "blur_style_system", + "value": "System" + }, + { + "name": "blur_style_light", + "value": "Light" + }, + { + "name": "blur_style_dark", + "value": "Dark" + }, + { + "name": "blur_style_default", + "value": "Default" + }, + { + "name": "set_shadow_type", + "value": "Set shadow type" + }, + { + "name": "shadow_type_color", + "value": "COLOR" + }, + { + "name": "shadow_type_blur", + "value": "BLUR" + }, + { + "name": "blur_style_average", + "value": "Average" + }, + { + "name": "background_image_size_cover", + "value": "Cover" + }, + { + "name": "background_image_size_contain", + "value": "Contain" + }, + + { + "name": "background_image_position_top_start", + "value": "TopStart" + }, + { + "name": "background_image_position_top", + "value": "Top" + }, + { + "name": "background_image_position_top_end", + "value": "TopEnd" + }, + { + "name": "background_image_position_start", + "value": "Top" + }, + { + "name": "background_image_position_center", + "value": "Center" + }, + { + "name": "background_image_position_end", + "value": "End" + }, + { + "name": "background_image_position_bottom_start", + "value": "BottomStart" + }, + { + "name": "background_image_position_bottom", + "value": "Bottom" + }, + + { + "name": "background_image_position_bottom_end", + "value": "BottomEnd" + }, + + { + "name": "background_image", + "value": "Set background image" + }, + { + "name": "background_image_default", + "value": "default" + }, + { + "name": "background_image_repeat", + "value": "XY axis repeat plot" + }, + { + "name": "background_image_size", + "value": "Image size 50% wide and 100% high" + }, + { + "name": "background_image_offset", + "value": "Picture position offset to the right and down" + }, + // Badge + { + "name": "auxiliary_badge", + "value": "Badge" + }, + { + "name": "badge_type", + "value": "Tag type" + }, + { + "name": "badge_number", + "value": "Number marker" + }, + { + "name": "badge_string", + "value": "Text tag" + }, + { + "name": "badge_max", + "value": "Number tag maximum number of messages" + }, + { + "name": "badge_number_normal", + "value": "Normal badge" + }, + { + "name": "badge_number_max", + "value": "Maximum Badge" + }, + { + "name": "badge_location", + "value": "Mark position" + }, + { + "name": "badge_left", + "value": "Left marker" + }, + { + "name": "badge_top", + "value": "Top right tag" + }, + { + "name": "badge_right", + "value": "Right marker" + }, + { + "name": "badge_style", + "value": "Marker style" + }, + { + "name": "badge_blue", + "value": "Large blue marker" + }, + { + "name": "badge_green", + "value": "Small green marker" + }, + // Border + { + "name": "border_type", + "value": "Border type" + }, + { + "name": "border_type_dashed", + "value": "Dotted line" + }, + { + "name": "border_type_dotted", + "value": "Dot" + }, + { + "name": "border_type_solid", + "value": "Solid line" + }, + { + "name": "border_border_style", + "value": "Border width, color, rounded corners" + }, + { + "name": "border_border_width", + "value": "Width" + }, + { + "name": "border_border_color", + "value": "Color" + }, + { + "name": "border_border_radius", + "value": "Rounded corners" + }, + { + "name": "border_edge_style", + "value": "Set the border and style and properties separately" + }, + { + "name": "border_style_top", + "value": "Top border" + }, + { + "name": "border_style_bottom", + "value": "Bottom border" + }, + { + "name": "border_style_left", + "value": "Left border" + }, + { + "name": "border_style_right", + "value": "Right border" + }, + { + "name": "border_radius", + "value": "Set the rounded corners of each of the four corners" + }, + { + "name": "border_3D", + "value": "Set the border 3D" + }, + { + "name": "border_radius_left_top", + "value": "Top left border" + }, + { + "name": "border_radius_left_bottom", + "value": "Bottom left border" + }, + { + "name": "border_radius_right_top", + "value": "Top right border" + }, + { + "name": "border_radius_right_bottom", + "value": "Bottom right border" + }, + // Button + { + "name": "button_title", + "value": "Button" + }, + { + "name": "button_type", + "value": "Type" + }, + { + "name": "button_confirm", + "value": "Confirm" + }, + { + "name": "button_type_capsule", + "value": "Capsule" + }, + { + "name": "button_type_normal", + "value": "Normal" + }, + { + "name": "button_type_circle", + "value": "Circle" + }, + { + "name": "button_state_effect", + "value": "State effect" + }, + { + "name": "button_state_effect_true", + "value": "Has effect" + }, + { + "name": "button_state_effect_false", + "value": "No effect" + }, + { + "name": "button_disable_style", + "value": "Disable" + }, + { + "name": "button_custom_style", + "value": "Custom style" + }, + { + "name": "button_border_radius", + "value": " Rounded button" + }, + { + "name": "button_with_icon", + "value": "Icon button" + }, + { + "name": "button_custom_bg_color", + "value": "Custom color" + }, + { + "name": "button_click", + "value": "Button is clicked" + }, + // Click Event + { + "name": "click_action_tips", + "value": "Click the gray area to change the crosshair position" + }, + { + "name": "touch_action_tips", + "value": "Touch the gray area and move to change the crosshair position" + }, + { + "name": "component_area_change_action_tips", + "value": "Slide to change the gray area size or position for controlling the ball motion area" + }, + { + "name": "get_click_event_detail", + "value": "Click location information" + }, + // Drag Event + { + "name": "drag_drop_action_tips", + "value": "Long press the application icon and drag to different areas" + }, + { + "name": "component_drag_and_drop", + "value": "Component drag and drop" + }, + { + "name": "griditem", + "value": "GridItem" + }, + { + "name": "listitem", + "value": "ListItem" + }, + { + "name": "hyperlink", + "value": "Hyperlink" + }, + { + "name": "text", + "value": "Text" + }, + { + "name": "image", + "value": "Image" + }, + { + "name": "video", + "value": "Video" + }, + { + "name": "formcomponent", + "value": "FormComponent" + }, + // CustomDialog + { + "name": "custom_dialog", + "value": "Custom dialog" + }, + { + "name": "custom_dialog_style_custom", + "value": "Whether the dialog style is customized" + }, + { + "name": "custom_dialog_style_custom_true", + "value": "Custom" + }, + { + "name": "custom_dialog_style_custom_false", + "value": "Non-custom" + }, + { + "name": "custom_dialog_title", + "value": "The component collection requests to enable the following permissions" + }, + { + "name": "custom_dialog_permission_microphone", + "value": "Microphone permission" + }, + { + "name": "custom_dialog_permission_microphone_info", + "value": "Microphone permission is required for voice calls" + }, + { + "name": "custom_dialog_permission_location", + "value": "Location permissions" + }, + { + "name": "custom_dialog_permission_location_info", + "value": "Location permission is required for navigation" + }, + { + "name": "custom_dialog_start", + "value": "One-click opening" + }, + // DatePickerDialog + { + "name": "date_picker_dialog", + "value": "DatePickerDialog" + }, + { + "name": "date_picker_dialog_date", + "value": "Show date dialog" + }, + { + "name": "date_picker_dialog_date_lunar", + "value": "Lunar date:" + }, + { + "name": "date_picker_dialog_date_gregorian", + "value": "Gregorian calendar date:" + }, + { + "name": "date_picker_dialog_cancel", + "value": "Cancel" + }, + { + "name": "date_picker_toast_date", + "value": "Selected time:" + }, + { + "name": "date_picker_dialog_datetimeone", + "value": "2022-10-01" + }, + { + "name": "date_picker_dialog_datetimetwo", + "value": "1970-1-1" + }, + { + "name": "date_picker_dialog_datetimethree", + "value": "2100-12-31" + }, + // DatePicker + { + "name": "date_picker_title", + "value": "DatePicker" + }, + { + "name": "date_picker_lunar", + "value": "Is lunar" + }, + // Divider + { + "name": "divider_title", + "value": "Divider" + }, + { + "name": "divider_stroke_width", + "value": "Stroke width" + }, + { + "name": "divider_line_color", + "value": "Line color" + }, + { + "name": "divider_line_cap", + "value": "LineCapStyle" + }, + { + "name": "divider_horizontal", + "value": "Horizontal" + }, + { + "name": "divider_vertical", + "value": "Vertical" + }, + { + "name": "divider_attribute", + "value": "Divider" + }, + { + "name": "divider_color_blue", + "value": "Blue" + }, + { + "name": "divider_color_green", + "value": "Green" + }, + { + "name": "divider_color_orange", + "value": "Orange" + }, + { + "name": "divider_color_pink", + "value": "Pink" + }, + { + "name": "divider_line_type_butt", + "value": "Butt" + }, + { + "name": "divider_line_type_round", + "value": "Round" + }, + { + "name": "divider_line_type_square", + "value": "Square" + }, + // Font + { + "name": "font_color", + "value": "Color" + }, + { + "name": "font_size", + "value": "Size" + }, + { + "name": "font_thickness", + "value": "Thickness" + }, + { + "name": "font_style", + "value": "Style" + }, + // Interpolation Calculation + { + "name": "interpolation_calculation_cubic_bezier_curve", + "value": "Third-order Bézier curve object" + }, + { + "name": "interpolation_calculation_spring", + "value": "Spring curve object" + }, + { + "name": "interpolation_calculation_init_curve", + "value": "EaseIn (deceleration start) difference curve" + }, + { + "name": "interpolation_calculation_steps_curve", + "value": "step curve object" + }, + // Page Transition + { + "name": "page_transition", + "value": "Transitions between pages" + }, + { + "name": "page_transition_left", + "value": "Left Entry/Right Exit" + }, + { + "name": "page_transition_right", + "value": "Right Entry/Left Exit" + }, + { + "name": "page_transition_top", + "value": "Top Entry/Bottom Exit" + }, + { + "name": "page_transition_bottom", + "value": "Bottom Entry/Top Exit" + }, + { + "name": "page_transition_scale", + "value": "Zoom in/out" + }, + { + "name": "page_transition_rotate", + "value": "Spin in/out" + }, + { + "name": "page_transition_back", + "value": "Back to page transition between pages" + }, + // QRCode + { + "name": "qrcode_title", + "value": "QRCode" + }, + { + "name": "qrcode_content", + "value": "Content" + }, + { + "name": "qrcode_color", + "value": "Color" + }, + { + "name": "qrcode_enter_content", + "value": "Enter to change QR code" + }, + // Search + { + "name": "search_placeholder", + "value": "Type to search..." + }, + { + "name": "search_name", + "value": "search" + }, + // Radio + { + "name": "radio_title", + "value": "Radio" + }, + { + "name": "radio_no_response_region", + "value": "Not add response region(take effect when click the button)" + }, + { + "name": "radio_has_response_region", + "value": "Add response region (click row of button take effect)" + }, + { + "name": "radio_beijing", + "value": "Beijing" + }, + { + "name": "radio_shanghai", + "value": "Shanghai" + }, + { + "name": "radio_shenzhen", + "value": "Shenzhen" + }, + { + "name": "radio_guangzhou", + "value": "Guangzhou" + }, + // Rotate + { + "name": "graphic_transformation_rotate", + "value": "Rotate" + }, + { + "name": "rotate_photo", + "value": "Image rotation" + }, + { + "name": "rotate_container", + "value": "Component rotation" + }, + { + "name": "rotate_before_image", + "value": "Original image" + }, + { + "name": "rotate_before_component", + "value": "Container component" + }, + { + "name": "rotate_image_angle", + "value": "Rotate 15°" + }, + // SaveArea + { + "name": "safe_area_type_and_safe_area_edge", + "value": "SafeAreaType And SafeAreaEdge" + }, + { + "name": "safe_area", + "value": "SafeArea" + }, + { + "name": "save_area_input_text", + "value": "input your word ..." + }, + { + "name": "safe_area_type", + "value": "SafeAreaType" + }, + { + "name": "safe_area_edge", + "value": "SafeAreaEdge" + }, + { + "name": "safe_area_edge_top", + "value": "TOP" + }, + { + "name": "safe_area_edge_bottom", + "value": "BOTTOM" + }, + { + "name": "safe_area_edge_start", + "value": "START" + }, + { + "name": "safe_area_edge_end", + "value": "END" + }, + { + "name": "safe_area_type_system", + "value": "SYSTEM" + }, + { + "name": "safe_area_type_cutout", + "value": "CUTOUT" + }, + { + "name": "safe_area_type_keyboard", + "value": "KEYBOARD" + }, + // Select + { + "name": "select_title", + "value": "Select" + }, + { + "name": "select_has_icon", + "value": "Select with icon" + }, + { + "name": "select_option_bg_and_text_style", + "value": "Selected item background color and text style" + }, + { + "name": "select_unselect_option_style", + "value": "Option item background and text style" + }, + { + "name": "select_button_style", + "value": "Drop-down button text style" + }, + { + "name": "select_picture", + "value": "Picture" + }, + { + "name": "select_collection", + "value": "Collection" + }, + { + "name": "select_gesture", + "value": "Gesture" + }, + { + "name": "select_index", + "value": "Select option index:" + }, + { + "name": "select_value", + "value": "The value of the selected option:" + }, + // Shareelement Transition + { + "name": "share_element_transition", + "value": "Shared element transition" + }, + { + "name": "Multiplex_interface", + "value": "multiplex" + }, + { + "name": "Floating_window", + "value": "floating window" + }, + { + "name": "Tips_call", + "value": "Waiting" + }, + { + "name": "Font_family_regular", + "value": "HarmonyOS Sans SC-Regular" + }, + { + "name": "Font_family_medium", + "value": "HarmonyOS Sans SC-Medium" + }, + { + "name": "Folder_expansion", + "value": "folder expansion" + }, + { + "name": "Shop_card_expansion", + "value": "shop card expansion" + }, + { + "name": "System_icon", + "value": "System Icon" + }, + { + "name": "Today", + "value": "today" + }, + { + "name": "Gallery_card_expansion", + "value": "gallery card expansion" + }, + // Size + { + "name": "size_width", + "value": "Width" + }, + { + "name": "size_width_fixed_100vp", + "value": "Width is 100vp" + }, + { + "name": "size_width_percent", + "value": "width is 60%" + }, + { + "name": "size_width_fixed_60vw", + "value": "Width is 60vw" + }, + { + "name": "size_height", + "value": "Height" + }, + { + "name": "size_height_fixed_60vh", + "value": "Width is 60vh" + }, + { + "name": "size_height_fixed_100vp", + "value": "Height is 100vp" + }, + { + "name": "size_height_percent", + "value": "Height is 60%" + }, + { + "name": "size_height_fixed_calc", + "value": "Height is calc(200vp-100vp)" + }, + // Slider + { + "name": "slider_title", + "value": "Slider" + }, + { + "name": "slider_step_tip", + "value": "Step and tip (step is 10)" + }, + { + "name": "slider_current_value", + "value": "Show current value (min-50/max-130)" + }, + { + "name": "slider_events", + "value": "Events" + }, + { + "name": "slider_attributes", + "value": "Attributes" + }, + { + "name": "slider_vertical_reverse", + "value": "Vertical and reverse" + }, + { + "name": "slider_forward", + "value": "Forward" + }, + { + "name": "slider_reverse", + "value": "Reverse" + }, + { + "name": "slider_select_color", + "value": "Select color" + }, + { + "name": "slider_track_color", + "value": "Track color" + }, + { + "name": "slider_block_color", + "value": "Block color" + }, + { + "name": "slider_track_thickness", + "value": "Track thickness" + }, + { + "name": "slider_event_begin", + "value": "Start dragging the slider" + }, + { + "name": "slider_event_moving", + "value": "In the process of dragging the slider" + }, + { + "name": "slider_event_end", + "value": "End drag slider" + }, + { + "name": "slider_event_click", + "value": "Click the slider to move the slider position" + }, + { + "name": "slider_title_value", + "value": "Slider slide as a percentage of the total length:" + }, + // Span + { + "name": "span_title", + "value": "Span" + }, + { + "name": "span_attribute", + "value": "Configure different span attributes" + }, + { + "name": "span_content_one", + "value": "Steel is tempered in fire and sharp cooling, " + }, + { + "name": "span_content_two", + "value": "so it can be hard and not afraid of anything. " + }, + { + "name": "span_content_three", + "value": "It is also in this way that our generation has been tempered in struggles and terrible trials, " + }, + { + "name": "span_content_four", + "value": "learning not to succumb to life." + }, + { + "name": "span_decoration_and_letter_spacing", + "value": "Decoration and letter spacing" + }, + { + "name": "span_letter_spacing", + "value": "LetterSpacing" + }, + { + "name": "span_line_height", + "value": "LineHeight" + }, + { + "name": "span_decoration_type", + "value": "Decoration type" + }, + { + "name": "span_text_decoration", + "value": "Decoration test text" + }, + { + "name": "span_text_spacing", + "value": " LetterSpacing test text" + }, + { + "name": "span_inherits_text_attribute", + "value": " Span inherits text attribute" + }, + { + "name": "span_does_not_inherit_text_attribute", + "value": " Span does not inherits text attribute" + }, + { + "name": "span_upper_lower", + "value": "Upper or lower case" + }, + { + "name": "span_decoration_color", + "value": "Decoration color" + }, + { + "name": "span_decoration_none", + "value": "None" + }, + { + "name": "span_decoration_linethrough", + "value": "LineThrough" + }, + { + "name": "span_decoration_underline", + "value": "Underline" + }, + { + "name": "span_decoration_overline", + "value": "Overline" + }, + //ImageSpan + { + "name": "image_span_title", + "value": "Image Span" + }, + { + "name": "image_span_vertical_align", + "value": "Vertical Align" + }, + { + "name": "image_span_alignment_baseline", + "value": "Baseline" + }, + { + "name": "image_span_alignment_bottom", + "value": "Bottom" + }, + { + "name": "image_span_alignment_center", + "value": "Center" + }, + { + "name": "image_span_alignment_top", + "value": "Top" + }, + { + "name": "image_span_object_fit", + "value": "Object Fit" + }, + { + "name": "image_fit_contain", + "value": "Contain" + }, + { + "name": "image_fit_auto", + "value": "Auto" + }, + { + "name": "image_fit_fill", + "value": "Fill" + }, + { + "name": "image_fit_none", + "value": "None" + }, + { + "name": "image_fit_scale_down", + "value": "Scale Down" + }, + { + "name": "image_fit_cover", + "value": "Cover" + }, + { + "name": "image_span_and_span", + "value": "image span and span" + }, + { + "name": "image_span_vertical_align_and_object_fit", + "value": "image span vertical align and object fit" + }, + // Text + { + "name": "text_title", + "value": "Text" + }, + { + "name": "text_content", + "value": "Steel is tempered in fire and sharp cooling, so it can be hard and not afraid of anything. It is also in this way that our generation has been tempered in struggles and terrible trials, learning not to succumb to life." + }, + { + "name": "text_content_en", + "value": "Steel is tempered in fire and sharp cooling, so it can be hard and not afraid of anything. It is also in this way that our generation has been tempered in struggles and terrible trials, learning not to succumb to life." + }, + { + "name": "text_width", + "value": "Text width" + }, + { + "name": "text_height", + "value": "Text height" + }, + { + "name": "text_content_en_first", + "value": "Steel is tempered in fire and sharp cooling, so it can be hard and not afraid of anything. " + }, + { + "name": "text_content_en_last", + "value": "It is also in this way that our generation has been tempered in struggles and terrible trials, learning not to succumb to life. " + }, + { + "name": "text_text_align_center", + "value": "Center" + }, + { + "name": "text_text_align_start", + "value": "Start" + }, + { + "name": "text_text_align_end", + "value": "End" + }, + { + "name": "text_decoration_type", + "value": "Text decoration type" + }, + { + "name": "text_decoration_type_under_line", + "value": "Under line" + }, + { + "name": "text_decoration_type_line_through", + "value": "Line through" + }, + { + "name": "text_decoration_type_over_line", + "value": "Over line" + }, + { + "name": "text_text_align_type", + "value": "Text alignment" + }, + { + "name": "text_letter_spacing", + "value": "Letter spacing" + }, + { + "name": "text_overflow", + "value": "Text overflow" + }, + { + "name": "text_none", + "value": "None" + }, + { + "name": "text_text_over_flow_clip", + "value": "Clip" + }, + { + "name": "text_text_over_flow_ellipsis", + "value": "Ellipsis" + }, + { + "name": "text_line_height", + "value": "Line height " + }, + { + "name": "text_font_color", + "value": "Font color" + }, + { + "name": "text_over_flow", + "value": "Text over flow" + }, + { + "name": "text_text_case_normal", + "value": "Normal" + }, + { + "name": "text_text_case", + "value": "Text case" + }, + { + "name": "text_text_case_uppercase", + "value": "Uppercase" + }, + { + "name": "text_text_case_lowercase", + "value": "Lowercase" + }, + // TextArea + { + "name": "text_area_set_text_selection", + "value": "Set Text Selection" + }, + { + "name": "text_area_set_text_selection_start_select_error", + "value": "Set Text Selection Start Select Error" + }, + { + "name": "text_area_set_text_selection_end_select_error", + "value": "Set Text Selection End Select Error" + }, + { + "name": "text_input_set_text_selection_start_select", + "value": "Start Select:" + }, + { + "name": "text_input_set_text_selection_end_select", + "value": "End Select:" + }, + // TextInput + { + "name": "avoiding_input_method_testing", + "value": "Avoiding Input Method Testing" + }, + { + "name": "text_input_title", + "value": "TextInput" + }, + { + "name": "text_input_normal_type", + "value": "Digits, letters, underline(_), spaces, and special characters." } ] } -- Gitee From 4b6396cef7150f44dc40650821f54ec4b29da7c9 Mon Sep 17 00:00:00 2001 From: zhangmenghan Date: Tue, 3 Dec 2024 08:23:24 +0800 Subject: [PATCH 3/6] add str res Signed-off-by: zhangmenghan --- .../main/resources/en_US/element/string.json | 1913 ++++++++++++++++- 1 file changed, 1907 insertions(+), 6 deletions(-) diff --git a/function/communication/bluetooth/sockettest/entry/src/main/resources/en_US/element/string.json b/function/communication/bluetooth/sockettest/entry/src/main/resources/en_US/element/string.json index d776bf57..f76d39bb 100644 --- a/function/communication/bluetooth/sockettest/entry/src/main/resources/en_US/element/string.json +++ b/function/communication/bluetooth/sockettest/entry/src/main/resources/en_US/element/string.json @@ -1995,12 +1995,1913 @@ { "name": "text_input_normal_type", "value": "Digits, letters, underline(_), spaces, and special characters." + }, + { + "name": "text_input_password_type", + "value": "Input password" + }, + { + "name": "text_input_email_type", + "value": "Input email" + }, + { + "name": "text_input_number_type", + "value": "Digit input mode" + }, + { + "name": "text_input_phone_type", + "value": "Digits, plus signs (+), hyphens (-), asterisks (*), and number signs (#)" + }, + { + "name": "text_input_input_type", + "value": "Input type" + }, + { + "name": "text_input_current_type", + "value": "Current type" + }, + { + "name": "text_input_show_password_icon", + "value": "Show password icon" + }, + { + "name": "text_input_icon_show", + "value": "Show" + }, + { + "name": "text_input_icon_hide", + "value": "Hide" + }, + { + "name": "text_input_event", + "value": "Event" + }, + { + "name": "text_input_event_placeholder", + "value": "Copy,paste,cut,submit,edit event" + }, + { + "name": "text_input_placeholder_style", + "value": "Placeholder style" + }, + { + "name": "text_input_placeholder", + "value": "Placeholder" + }, + { + "name": "text_input_filter", + "value": "Input filter" + }, + { + "name": "text_input_only_input_english", + "value": "Only english letters can be entered" + }, + { + "name": "text_input_set_text_selection", + "value": "Set Text Selection" + }, + { + "name": "text_input_caret_position", + "value": "Caret position" + }, + { + "name": "text_input_max_length", + "value": "Limit the input character length" + }, + { + "name": "text_input_placeholder_max_length", + "value": "12 characters max" + }, + { + "name": "text_input_toast_paste", + "value": "Pasted text is:" + }, + { + "name": "text_input_toast_cut", + "value": "Cut text is:" + }, + { + "name": "text_input_toast_copy", + "value": "The copied text is:" + }, + { + "name": "text_input_toast_submit", + "value": "The submitted text is:" + }, + { + "name": "text_input_toast_edit", + "value": "The edited text is:" + }, + // TimePickerDialog + { + "name": "time_picker_dialog", + "value": "TimePickerDialog" + }, + { + "name": "time_picker_dialog_time", + "value": "Show time dialog" + }, + { + "name": "time_picker_dialog_24_hour", + "value": "24 hours:" + }, + { + "name": "time_picker_dialog_12_hour", + "value": "12 hours:" + }, + { + "name": "time_picker_dialog_cancel", + "value": "Cancel" + }, + { + "name": "time_picker_toast_time", + "value": "Selected time:" + }, + { + "name": "time_picker_options_usemilitarytime", + "value": "useMilitaryTime" + }, + { + "name": "time_picker_dialog_timeone", + "value": "00:00" + }, + { + "name": "time_picker_dialog_timetwo", + "value": "10/01/2022 12:00" + }, + // Toggle + { + "name": "toggle_title", + "value": "Toggle" + }, + { + "name": "toggle_select", + "value": "Select" + }, + { + "name": "toggle_unselect", + "value": "Unselect" + }, + { + "name": "toggle_type_switch", + "value": "Switch" + }, + { + "name": "toggle_type_checkbox", + "value": "Check box" + }, + { + "name": "toggle_type_button", + "value": "Button" + }, + { + "name": "toggle_state", + "value": "Checked: " + }, + // Translate + { + "name": "graphic_transformation_translate", + "value": "Translate" + }, + { + "name": "translate_image", + "value": "Image panning" + }, + { + "name": "translate_container", + "value": "Component panning" + }, + { + "name": "translate_x_axis", + "value": "X-axis:" + }, + { + "name": "translate_y_axis", + "value": "Y-axis:" + }, + //Display + { + "name": "components_display", + "value": "Display" + }, + { + "name": "components_interaction", + "value": "Interaction" + }, + { + "name": "components_interaction_menuone", + "value": "Menu Item 1" + }, + { + "name": "components_interaction_menutwo", + "value": "Menu Item 2" + }, + { + "name": "components_interaction_menuthree", + "value": "Menu Item 3" + }, + { + "name": "components_interaction_menufour", + "value": "Menu Item 4" + }, + { + "name": "components_interaction_clicktextone", + "value": "Background" + }, + { + "name": "components_interaction_clicktexttwo", + "value": "Forground" + }, + { + "name": "components_interaction_clicktextthree", + "value": "Forground Child" + }, + { + "name": "components_interaction_hittestbehavior", + "value": "hitTestBehavior:" + }, + { + "name": "components_interaction_hovereffect", + "value": "hoverEffect" + }, + { + "name": "components_interaction_backgroundresponse", + "value": "Background response click\n" + }, + { + "name": "components_interaction_foregroundresponse", + "value": "Foreground response click\n" + }, + { + "name": "components_interaction_contentresponse", + "value": "Content response click\n" + }, + { + "name": "components_display_content", + "value": "ABCDEFG abcdefg" + }, + { + "name": "components_display_center", + "value": "center" + }, + { + "name": "components_display_topstart", + "value": "top start" + }, + { + "name": "components_display_topend", + "value": "top end" + }, + { + "name": "components_display_top", + "value": "top" + }, + { + "name": "components_display_start", + "value": "start" + }, + { + "name": "components_display_end", + "value": "end" + }, + { + "name": "components_display_bottomstart", + "value": "bottom start" + }, + { + "name": "components_display_bottom", + "value": "bottom" + }, + { + "name": "components_display_bottomend", + "value": "bottom end" + }, + { + "name": "components_display_none", + "value": "None" + }, + { + "name": "components_display_hidden", + "value": "Hidden" + }, + { + "name": "components_display_visible", + "value": "Visible" + }, + { + "name": "components_effects", + "value": "Effects" + }, + { + "name": "blur_effects", + "value": "Blur effects" + }, + { + "name": "blur_radius_modify", + "value": "Blur radius" + }, + { + "name": "background_blur", + "value": "Background Blur" + }, + { + "name": "background_blur_style", + "value": "Background Blur Style" + }, + { + "name": "shadow_effects", + "value": "Shadow Effect" + }, + { + "name": "shadow_effects_content", + "value": "Shadow Effect Shadow Effect Shadow Effect Shadow Effect Shadow Effect Shadow Effect Shadow Effect Shadow Effect" + }, + { + "name": "offset_min", + "value": "-40" + }, + { + "name": "offset_max", + "value": "40" + }, + { + "name": "x_offset", + "value": "X Offset" + }, + { + "name": "y_offset", + "value": "Y Offset" + }, + { + "name": "shadow", + "value": "Shadow" + }, + { + "name": "blur", + "value": "Blur" + }, + { + "name": "effects", + "value": "Effect" + }, + { + "name": "effects_display", + "value": "Display" + }, + { + "name": "grayscale_change", + "value": "GrayScale" + }, + { + "name": "brightness_change", + "value": "Brightness" + }, + { + "name": "saturate_change", + "value": "Saturate" + }, + { + "name": "constrast_change", + "value": "Constrast" + }, + { + "name": "invert_change", + "value": "Invert" + }, + { + "name": "sepia_change", + "value": "Sepia" + }, + { + "name": "hueRotate_change", + "value": "HueRoate" + }, + { + "name": "color_blend_change", + "value": "Colorblend" + }, + { + "name": "spherical_effect_change", + "value": "sphericalEffect" + }, + { + "name": "light_up_effect_change", + "value": "lightUpEffect" + }, + { + "name": "pixel_stretch_effect_change", + "value": "pixelStretchEffect" + }, + { + "name": "z_index", + "value": "Z-Index" + }, + { + "name": "overlay", + "value": "Overlay" + }, + { + "name": "visibility", + "value": "Visibility" + }, + { + "name": "opacity", + "value": "Opacity" + }, + { + "name": "z_index_display", + "value": "Z-Index" + }, + { + "name": "Red", + "value": "Red" + }, + { + "name": "Blue", + "value": "Blue" + }, + { + "name": "Yellow", + "value": "Yellow" + }, + { + "name": "positon_modify", + "value": "Position" + }, + { + "name": "offset_modify", + "value": "Offset" + }, + { + "name": "visibility_change", + "value": "Visibility" + }, + { + "name": "opacity_change", + "value": "Opacity" + }, + { + "name": "opacity_display", + "value": "Opacity Display" + }, + { + "name": "item_select", + "value": "Menu Item" + }, + { + "name": "disabled", + "value": "Disabled" + }, + { + "name": "button_disabled", + "value": "Button Disabled" + }, + { + "name": "list_disabled", + "value": "List Disabled" + }, + { + "name": "button", + "value": "Button" + }, + { + "name": "focus", + "value": "Focus" + }, + { + "name": "popup_window", + "value": "Popup" + }, + { + "name": "touch_test", + "value": "Touch" + }, + { + "name": "touch_region", + "value": "Region" + }, + { + "name": "hovereffect", + "value": "Hover" + }, + { + "name": "bind_menu_customBuilder", + "value": "Bind menu customBuilder" + }, + { + "name": "bind_content_menu", + "value": "Bind content menu" + }, + { + "name": "click_on_any_action_below", + "value": "Click on any action below" + }, + { + "name": "long_press_any_action_below", + "value": "Long press any action below" + }, + { + "name": "bind_menu_content", + "value": "Bind menu content" + }, + { + "name": "menu", + "value": "Menu" + }, + { + "name": "multiState", + "value": "MultiState" + }, + { + "name": "multi_short_key", + "value": "multi short key" + }, + { + "name": "set_mouse_style", + "value": "Set mouse style" + }, + { + "name": "multimode_input", + "value": "multimode input" + }, + { + "name": "short_key_pressed", + "value": "Short key pressed" + }, + { + "name": "on_short_key", + "value": "Simultaneously press the shortcut key ctrl+a to trigger the following button click event" + }, + { + "name": "alert", + "value": "Alert" + }, + { + "name": "result", + "value": "Result" + }, + { + "name": "popup", + "value": "Popup" + }, + { + "name": "custom_popup", + "value": "Custom Popup" + }, + { + "name": "touch_test_region", + "value": "Touch test region" + }, + { + "name": "touch_hit_test", + "value": "Click the hot area: set the hot area as the green area" + }, + { + "name": "response_region", + "value": "Response Region" + }, + { + "name": "touch_hit_subtitle", + "value": "Click the green area to trigger the blue area response" + }, + { + "name": "option", + "value": "option" + }, + { + "name": "hover_region", + "value": "Hover the mouse over the green area to observe the effect" + }, + { + "name": "multistatus_region", + "value": "Switch status and observe the effect" + }, + { + "name": "status_select", + "value": "Status selection" + }, + // 侧边栏 + { + "name": "side_bar_effects_title", + "value": "SideBar effects" + }, + { + "name": "set_side_bar_type", + "value": "Set sideBarType" + }, + { + "name": "side_bar_container_content", + "value": "SideBar container content" + }, + { + "name": "hide_side_bar", + "value": "Hide sideBar" + }, + { + "name": "show_side_bar", + "value": "Show sideBar" + }, + { + "name": "side_bar_type_embed", + "value": "Embed" + }, + { + "name": "side_bar_type_overlay", + "value": "Overlay" + }, + { + "name": "side_bar_type_auto", + "value": "Auto" + }, + // 辅助 + { + "name": "scroll_bar", + "value": "ScrollBar" + }, + { + "name": "scroll_vertical_title", + "value": "vertical scroll" + }, + { + "name": "scroll_horizontal_title", + "value": "horizontal scroll" + }, + // 刷新 + { + "name": "auxiliary_refresh", + "value": "Refresh" + }, + { + "name": "auxiliary_refresh_refreshing", + "value": "Refreshing" + }, + { + "name": "auxiliary_refresh_offset", + "value": "offset:" + }, + { + "name": "auxiliary_refresh_minvalue", + "value": "0" + }, + { + "name": "auxiliary_refresh_maxvalue", + "value": "100" + }, + { + "name": "auxiliary_refresh_friction", + "value": "friction:" + }, + { + "name": "auxiliary_panel", + "value": "Panel" + }, + { + "name": "auxiliary_alphabetIndexer", + "value": "AlphabetIndexer" + }, + { + "name": "loading_progress", + "value": "LoadingProgress" + }, + { + "name": "marquee_name", + "value": "Marquee" + }, + { + "name": "marquee_src", + "value": "Hello ArkUI String Length Larger Than Content" + }, + { + "name": "marquee_fromstart", + "value": "fromStart" + }, + { + "name": "marquee_step", + "value": "step" + }, + { + "name": "marquee_loop", + "value": "loop" + }, + { + "name": "text_timer", + "value": "TextTimer" + }, + { + "name": "text_timer_start", + "value": "start" + }, + { + "name": "text_timer_pause", + "value": "pause" + }, + { + "name": "text_timer_reset", + "value": "reset" + }, + { + "name": "text_timer_iscountdown", + "value": "isCountDown" + }, + { + "name": "text_timer_timeformatone", + "value": "mm:ss:SS" + }, + { + "name": "text_timer_groupformat", + "value": "format" + }, + { + "name": "text_timer_timeformattwo", + "value": "HH:mm:ss" + }, + { + "name": "text_timer_timeformatthree", + "value": "DD-HH-mm-ss.SSS" + }, + { + "name": "text_clock", + "value": "TextClock" + }, + { + "name": "text_clock_start", + "value": "start" + }, + { + "name": "text_clock_stop", + "value": "stop" + }, + { + "name": "text_clock_timeformatone", + "value": "HH:mm:ss" + }, + { + "name": "text_clock_groupformat", + "value": "format" + }, + { + "name": "text_clock_timeformattwo", + "value": "YY:MM:dd" + }, + { + "name": "text_clock_timeformatthree", + "value": "hh-mm-ss" + }, + { + "name": "progress_name", + "value": "Progress" + }, + { + "name": "gauge_name", + "value": "Gauge" + }, + { + "name": "gauge_value", + "value": "value" + }, + { + "name": "gauge_strokewidth", + "value": "strokeWidth" + }, + { + "name": "gauge_startangle", + "value": "startAngle" + }, + { + "name": "gauge_endangle", + "value": " endAngle" + }, + { + "name": "data_panel", + "value": "DataPanel" + }, + { + "name": "checkbox_checkboxgroup", + "value": "Checkbox && CheckboxGroup" + }, + { + "name": "checkbox", + "value": "Checkbox" + }, + { + "name": "checkbox_title", + "value": "Checkbox" + }, + { + "name": "checkbox_checkbox1", + "value": "Checkbox1" + }, + { + "name": "checkbox_checkbox2", + "value": "Checkbox2" + }, + { + "name": "checkbox_checkbox3", + "value": "Checkbox3" + }, + { + "name": "checkbox_checkgroup", + "value": "checkboxGroup" + }, + { + "name": "checkbox_checkgroup_title", + "value": "CheckboxGroup" + }, + { + "name": "text_picker", + "value": "TextPicker" + }, + { + "name": "time_picker", + "value": "TimePicker" + }, + { + "name": "counter_name", + "value": "Counter" + }, + { + "name": "rating_name", + "value": "Rating" + }, + { + "name": "rating_options_indicator", + "value": "indicator" + }, + { + "name": "rating_options_value", + "value": "value" + }, + { + "name": "rating_options_stars", + "value": "stars" + }, + { + "name": "rich_text", + "value": "RichText" + }, + { + "name": "scroll_swiper", + "value": "Scroll and Swipe" + }, + { + "name": "scroll_name", + "value": "Scroll" + }, + { + "name": "swiper_name", + "value": "Swiper" + }, + { + "name": "nav_router", + "value": "NavRouter" + }, + { + "name": "tabs_name", + "value": "Tabs" + }, + { + "name": "select_name", + "value": "Select" + }, + { + "name": "slider_name", + "value": "Slider" + }, + { + "name": "swiper_set_next_margin_and_previous_margin", + "value": "set next margin and previous margin" + }, + { + "name": "swiper_next_margin", + "value": "next margin" + }, + { + "name": "swiper_previous_margin", + "value": "previous margin" + }, + { + "name": "alphabetindexer_an", + "value": "An" + }, + { + "name": "alphabetindexer_bu", + "value": "Bu" + }, + { + "name": "alphabetindexer_bai", + "value": "Bai" + }, + { + "name": "alphabetindexer_bao", + "value": "Bao" + }, + { + "name": "alphabetindexer_bi", + "value": "Bi" + }, + { + "name": "alphabetindexer_bing", + "value": "Bing" + }, + { + "name": "alphabetindexer_cao", + "value": "Cao" + }, + { + "name": "alphabetindexer_chen", + "value": "Chen" + }, + { + "name": "alphabetindexer_cheng", + "value": "Cheng" + }, + { + "name": "alphabetindexer_lv", + "value": "Lv" + }, + { + "name": "alphabetindexer_liu3", + "value": "Liu3" + }, + { + "name": "alphabetindexer_liu", + "value": "Liu" + }, + { + "name": "alphabetindexer_li", + "value": "Li" + }, + { + "name": "alphabetindexer_lou", + "value": "Lou" + }, + { + "name": "alphabetindexer_liang", + "value": "Liang" + }, + { + "name": "alphabetindexer_lei", + "value": "Lei" + }, + { + "name": "alphabetindexer_lu", + "value": "Lu" + }, + { + "name": "alphabetindexer_cui", + "value": "Cui" + }, + { + "name": "alphabetindexer_list_display", + "value": "List Display" + }, + { + "name": "alphabetindexer_color_select", + "value": "Color Select" + }, + { + "name": "alphabetindexer_selectedcolor_selectedcolor", + "value": "selectedColor" + }, + { + "name": "alphabetindexer_selectedcolor_selectedbgcolor", + "value": "selectedBackColor" + }, + { + "name": "alphabetindexer_selectedcolor_popupcolor", + "value": "popupColor" + }, + { + "name": "alphabetindexer_selectedcolor_popupbackground", + "value": "popupBackground" + }, + { + "name": "alphabetindexer_selectedcolor_usingpopup", + "value": "usingPopup" + }, + { + "name": "panel_show_minibar", + "value": "Show Minibar Type Panel" + }, + { + "name": "panel_close_minibar", + "value": "Close Minibar Type Panel" + }, + { + "name": "panel_show_foldable", + "value": "Show Foldable Type Panel" + }, + { + "name": "panel_close_foldable", + "value": "Close Foldable Type Panel" + }, + { + "name": "panel_show_temporary", + "value": "Show Temporary Type Panel" + }, + { + "name": "panel_close_temporary", + "value": "Close Temporary Type Panel" + }, + { + "name": "panel_radio_groupname", + "value": "fruit" + }, + { + "name": "checkbox_apple", + "value": "Apple" + }, + { + "name": "checkbox_blueberry", + "value": "Blueberry" + }, + { + "name": "checkbox_banbana", + "value": "Banana" + }, + { + "name": "checkbox_cherries", + "value": "Cherries" + }, + { + "name": "checkbox_durian", + "value": "Durian" + }, + { + "name": "checkbox_orange", + "value": "Orange" + }, + { + "name": "checkbox_select_color", + "value": "Select Color" + }, + { + "name": "checkbox_select_all", + "value": "Select All" + }, + { + "name": "delete_list_item", + "value": "Delete listItem" + }, + { + "name": "normal_display", + "value": "Display" + }, + { + "name": "normal_options", + "value": "Options" + }, + { + "name": "datapanel_circle", + "value": "Circle" + }, + { + "name": "datapanel_line", + "value": "Line" + }, + { + "name": "progress_linear", + "value": "Linear Progress" + }, + { + "name": "progress_eclipse", + "value": "Eclipse Progress" + }, + { + "name": "progress_scalering", + "value": "ScaleRing Progress" + }, + { + "name": "progress_ring", + "value": "Ring Progress" + }, + { + "name": "progress_capsule", + "value": "Capsule Progress" + }, + { + "name": "progress_change", + "value": "Change Progress" + }, + { + "name": "textclock_timeformat", + "value": "Time Format" + }, + { + "name": "scroll_horizontal", + "value": "Horizontal Scroll" + }, + { + "name": "scroll_vertical", + "value": "Vertical Scroll" + }, + { + "name": "interaction_disable_list", + "value": "Disable List" + }, + { + "name": "interaction_show_one_alert", + "value": "Click to show one button alert" + }, + { + "name": "interaction_show_two_alert", + "value": "Click to show two button alert" + }, + { + "name": "interaction_placementontop", + "value": "PlacementOnTop:" + }, + { + "name": "interaction_arrowoffset", + "value": "Change arrowOffset:" + }, + { + "name": "interaction_mask", + "value": "isMask:" + }, + // ComponentTransitionSample + { + "name": "component_transition", + "value": "Component transition" + }, + { + "name": "component_transition_show", + "value": "Show" + }, + { + "name": "component_transition_hide", + "value": "Hide" + }, + { + "name": "motion_path", + "value": "MotionPath" + }, + { + "name": "animate_to", + "value": "AnimateTo" + }, + { + "name": "attribute_animation", + "value": "AttributeAnimation" + }, + { + "name": "attribute_animation_change_size", + "value": "ChangeSize" + }, + { + "name": "attribute_animation_change_rotation", + "value": "ChangeRotation" + }, + { + "name": "attribute_animation_set_curve", + "value": "SetCurve" + }, + { + "name": "attribute_animation_delay", + "value": "delay3s" + }, + { + "name": "attribute_animation_play_speed", + "value": "PlaySpeed" + }, + { + "name": "attribute_animation_unlimited_playback", + "value": "UnlimitedPlayback" + }, + { + "name": "attribute_animation_play_complete", + "value": "PlayComplete" + }, + { + "name": "attribute_animation_play_count", + "value": "PlayCount" + }, + { + "name": "motion_path_click_me", + "value": "ClickMe" + }, + { + "name": "animate_over", + "value": "AnimateOver" + },{ + "name": "interaction_showpopup", + "value": "Show Popup" + }, + { + "name": "interaction_showcustompopup", + "value": "Show Custom Popup" + }, + { + "name": "interaction_disable", + "value": "Disable Component:" + }, + { + "name": "action_sheet_dialog_click_content", + "value": "点击内容" + }, + { + "name": "text_picker_click_text", + "value": "点击文字" + }, + { + "name": "global_menu", + "value": "BindContextMenu" + }, + { + "name": "global_menu_create_way", + "value": "创建方式" + }, + { + "name": "global_menu_click_right", + "value": "右击" + }, + { + "name": "global_menu_long_press", + "value": "长按" + }, + { + "name": "global_menu_close", + "value": "点击关闭菜单" + }, + { + "name": "general_mount", + "value": "挂载卸载事件" + }, + { + "name": "general_mount_toast", + "value": "挂载图片" + }, + { + "name": "general_unmount_toast", + "value": "卸载图片" + }, + { + "name": "general_mount_text", + "value": "点击我挂载卸载图片" + }, + { + "name": "general_drag", + "value": "拖拽事件" + }, + { + "name": "general_drag_text_one", + "value": "这里有三个文本元素,长按文本拖到下方列表中" + }, + { + "name": "general_drag_text_two", + "value": "这是一个列表元素" + }, + { + "name": "drag_list_one", + "value": "One" + }, + { + "name": "drag_list_two", + "value": "Two" + }, + { + "name": "drag_list_three", + "value": "Three" + }, + { + "name": "drag_list_four", + "value": "Four" + }, + { + "name": "size_size", + "value": "大小" + }, + { + "name": "size_padding", + "value": "内边距" + }, + { + "name": "size_margin", + "value": "外边距" + }, + { + "name": "size_constraintSize", + "value": "约束大小" + }, + { + "name": "size_size_description_one", + "value": "宽高为100vp" + }, + { + "name": "size_size_description_two", + "value": "宽高为100%" + }, + { + "name": "size_size_padding_one", + "value": "上下左右内边距10vp" + }, + { + "name": "size_size_padding_two", + "value": "上内边距20%" + }, + { + "name": "size_size_margin_one", + "value": "上下左右外边距10vp" + }, + { + "name": "size_size_margin_two", + "value": "上外距20%" + }, + { + "name": "size_size_constraintSize_one", + "value": "约束最大宽高90vp" + }, + { + "name": "size_size_constraintSize_two", + "value": "约束最小宽高80vp" + }, + { + "name": "keyPress_event", + "value": "按压事件" + }, + { + "name": "focus_event_description", + "value": "按压外接键盘Tab键获取焦点,再按上下键切换焦点" + }, + { + "name": "focus_event_button_one", + "value": "第一个按钮" + }, + { + "name": "focus_event_button_two", + "value": "第二个按钮" + }, + { + "name": "focus_event_button_three", + "value": "第三个按钮" + }, + { + "name": "focus_event_toast_text", + "value": "触发焦点" + }, + { + "name": "press_event_toast_text", + "value": "触发按键事件" + }, + { + "name": "press_event_toast_description", + "value": "按压外接键盘任何键" + }, + { + "name": "mouse_event_move_description", + "value": "使用外接鼠标移入按钮" + }, + { + "name": "mouse_event_click_description", + "value": "使用外接鼠标点击按钮" + }, + { + "name": "mouse_event_hover_description", + "value": "鼠标移入" + }, + { + "name": "mouse_event_onHover_description", + "value": "鼠标未移入" + }, + { + "name": "mouse_event_onMouse_text", + "value": "onMouse" + }, + { + "name": "mouse_event_mouseBtn_none", + "value": "None" + }, + { + "name": "mouse_event_mouseBtn_left", + "value": "Left" + }, + { + "name": "mouse_event_mouseBtn_right", + "value": "Right" + }, + { + "name": "mouse_event_mouseBtn_back", + "value": "Back" + }, + { + "name": "mouse_event_mouseBtn_forward", + "value": "Forward" + }, + { + "name": "mouse_event_mouseBtn_middle", + "value": "Middle" + }, + { + "name": "mouse_event_mouseAction_hover", + "value": "Hover" + }, + { + "name": "mouse_event_mouseAction_press", + "value": "Press" + }, + { + "name": "mouse_event_mouseAction_move", + "value": "Move" + }, + { + "name": "mouse_event_mouseAction_release", + "value": "Release" + }, + { + "name": "scroll_event", + "value": "组件可见区域变化事件" + }, + { + "name": "scroll_event_description", + "value": "滑动列表使图片消失和显示" + }, + { + "name": "scroll_event_toast_visible", + "value": "爱心图片完全可见" + }, + { + "name": "scroll_event_toast_invisible", + "value": "爱心图片完全消失" + }, + { + "name": "location_settings", + "value": "Location settings" + }, + { + "name": "location_settings_align", + "value": "对齐方式" + }, + { + "name": "location_settings_direction", + "value": "水平布局" + }, + { + "name": "location_settings_position", + "value": "绝对定位" + }, + { + "name": "location_settings_markAnchor", + "value": "设置锚点" + }, + { + "name": "location_settings_offset", + "value": "相对定位" + }, + { + "name": "location_settings_alignRules", + "value": "对齐规则" + }, + { + "name": "location_settings_bottom_end", + "value": "Bottom end" + }, + { + "name": "location_settings_top_start", + "value": "Top start" + }, + { + "name": "location_settings_center", + "value": "Center" + }, + { + "name": "location_settings_position_text", + "value": "position(30, 10)" + }, + { + "name": "location_settings_position_offSet_text", + "value": "offset(15, 30)" + }, + { + "name": "layout_constrain", + "value": "布局约束" + }, + { + "name": "layout_constrain_aspectRatio", + "value": "组件宽高比" + }, + { + "name": "layout_constrain_displayPriority", + "value": "组件优先级" + }, + { + "name": "layout_constrain_big_container", + "value": "大型容器" + }, + { + "name": "layout_constrain_middle_container", + "value": "中型容器" + }, + { + "name": "layout_constrain_small_container", + "value": "小型容器" + }, + { + "name": "layout_constrain_children_one", + "value": "1:(priority:2)" + }, + { + "name": "layout_constrain_children_two", + "value": "2:(priority:1)" + }, + { + "name": "layout_constrain_children_three", + "value": "3:(priority:3)" + }, + { + "name": "layout_constrain_children_four", + "value": "4:(priority:1)" + }, + { + "name": "layout_constrain_children_five", + "value": "5:(priority:2)" + }, + { + "name": "layout_constrain_one", + "value": "1" + }, + { + "name": "layout_constrain_two", + "value": "2" + }, + { + "name": "flex", + "value": "flex" + }, + { + "name": "flex_flexBasis", + "value": "flexBasis" + }, + { + "name": "flex_flexGrow", + "value": "FlexGrow" + }, + { + "name": "flex_flexShrink", + "value": "FlexShrink" + }, + { + "name": "flex_alignSelf", + "value": "AlignSelf" + }, + { + "name": "flex_layoutWeight", + "value": "LayoutWeight" + }, + { + "name": "flex_no_layoutWeight", + "value": "On layoutWeight" + }, + { + "name": "flex_no_alignSelf_70", + "value": "On alignSelf,height:70%" + }, + { + "name": "flex_end_alignSelf", + "value": "AlignSelf end" + }, + { + "name": "flex_end_alignSelf_100", + "value": "AlignSelf end" + }, + { + "name": "flex_shrink_0", + "value": "FlexShrink(0)" + }, + { + "name": "flex_shrink_default", + "value": "Default flexShrink" + }, + { + "name": "flex_shrink_1", + "value": "FlexShrink(1)" + }, + { + "name": "flex_grow_1", + "value": "FlexGrow(1)" + }, + { + "name": "flex_grow_2", + "value": "FlexGrow(2)" + }, + { + "name": "flex_no_alignSelf_100", + "value": "On alignSelf,height:100%" + }, + { + "name": "flex_basis_100", + "value": "FlexBasis(100)" + }, + { + "name": "flex_basis_auto", + "value": "FlexBasis(auto)" + }, + { + "name": "picture_border", + "value": "图片边框设置" + }, + { + "name": "scale", + "value": "Scale" + }, + { + "name": "transform", + "value": "Transform" + }, + { + "name": "scale_image", + "value": "ScaleImage" + }, + { + "name": "transform_image", + "value": "TransformImage" + }, + { + "name": "transform_init", + "value": "创建四阶矩阵" + }, + { + "name": "transform_copy", + "value": "矩阵复制" + }, + { + "name": "transform_combine", + "value": "矩阵效果叠加" + }, + { + "name": "transform_invert", + "value": "矩阵效果反转" + }, + { + "name": "transform_translate", + "value": "矩阵平移效果" + }, + { + "name": "transform_scale", + "value": "矩阵缩放效果" + }, + { + "name": "transform_rotate", + "value": "矩阵旋转效果" + }, + { + "name": "transform_transformPoint", + "value": "矩阵坐标点转换效果" + }, + { + "name": "transform_combine_text", + "value": "x平移20,x放大两倍" + }, + { + "name": "transform_translate_text", + "value": "平移 x: 40, y: 40, z: 20" + }, + { + "name": "transform_scale_text", + "value": "宽高缩小一倍" + }, + { + "name": "transform_rotate_text", + "value": "旋转30度" + }, + { + "name": "transform_transformPoint_before", + "value": "矩阵变换后的坐标:[50,50]" + }, + { + "name": "transform_transformPoint_after", + "value": "矩阵变换后的坐标:[100,0]" + }, + { + "name": "shape_crop", + "value": "形状裁剪" + }, + { + "name": "shape_crop_clip", + "value": "裁剪" + }, + { + "name": "shape_crop_mask", + "value": "遮盖" + }, + { + "name": "grid_settings", + "value": "栅格设置" + }, + { + "name": "grid_settings_sm", + "value": "设备宽度为SM" + }, + { + "name": "grid_settings_md", + "value": "设备宽度为MD" + }, + { + "name": "grid_settings_lg", + "value": "设备宽度为LG" + }, + { + "name": "grid_settings_useSize", + "value": "UseSizeType" + }, + { + "name": "grid_settings_gridSpan", + "value": "GridSpan gridOffset" + }, + { + "name": "grid_edgeEffect_spring", + "value": "Grid edgeEffect spring" + }, + { + "name": "focus_control", + "value": "焦点控制" + }, + { + "name": "focus_control_tab", + "value": "按外接键盘Tab键切换焦点" + }, + { + "name": "focus_control_lastPageId", + "value": "LastPageId" + }, + { + "name": "focus_control_success", + "value": "请求成功" + }, + { + "name": "focus_control_failed", + "value": "请求失败" + }, + { + "name": "focus_control_group1", + "value": "Group1" + }, + { + "name": "focus_control_group2", + "value": "Group2" + }, + { + "name": "focus_control_group3", + "value": "Group3" + }, + { + "name": "focus_control_input", + "value": "Input" + }, + { + "name": "focus_control_request_focus", + "value": "选择水果请求聚焦" + }, + { + "name": "component_id", + "value": "组件标识" + }, + { + "name": "component_id_onKeyTab", + "value": "OnKeyTab" + }, + { + "name": "component_id_click", + "value": "Click to start" + }, + { + "name": "component_id_longClick", + "value": "LongClick" + }, + { + "name": "component_id_onTouch", + "value": "OnTouch" + }, + { + "name": "component_id_onMouse", + "value": "OnMouse" + }, + { + "name": "component_id_click_text", + "value": "Button 'click to start' is clicked" + }, + { + "name": "component_id_longClick_text", + "value": "Button 'longClick' is longClicked" + }, + { + "name": "component_id_onTouch_text", + "value": "Button 'onTouch' is clicked" + }, + { + "name": "component_id_onMouse_text", + "value": "Button 'onMouse' in onMouse" + }, + { + "name": "component_blurred", + "value": "组件背景模糊" + }, + { + "name": "component_blurred_thin", + "value": "薄材料" + }, + { + "name": "restore_id", + "value": "分布式迁移标识" + }, + { + "name": "gesture_process", + "value": "手势处理" + }, + { + "name": "bind_gesture_methods", + "value": "绑定手势方法" + }, + { + "name": "bind_gesture_priorityGesture", + "value": "priorityGesture会忽略text,优先识别父组件column" + }, + { + "name": "bind_gesture_parallelGesture", + "value": "parallelGesture识别父子组件column,text" + }, + { + "name": "bind_gesture_tapGesture", + "value": "TapGesture:" + }, + { + "name": "bind_gesture_text", + "value": "\nText" + }, + { + "name": "bind_gesture_column", + "value": "\nColumn" + }, + { + "name": "double_click", + "value": "单指双击触发" + }, + { + "name": "onAction", + "value": "onAction:" + }, + { + "name": "long_press", + "value": "单指长按文本" + }, + { + "name": "long_press_cancel", + "value": "取消事件" + }, + { + "name": "long_press_text", + "value": "请单指长按我" + }, + { + "name": "pan_text", + "value": "双指任意方式拖动黑色框" + }, + { + "name": "pan_text_one", + "value": "单指左右拖动黑色框" + }, + { + "name": "pan_start", + "value": "开始" + }, + { + "name": "pan_end", + "value": "结束" + }, + { + "name": "pan_button", + "value": "修改PanGesture触发条件" + }, + { + "name": "pan_offset", + "value": "PanGesture offset:\nX:" + }, + { + "name": "pan_offset_y", + "value": "\nY:" + }, + { + "name": "pinch_description", + "value": "三指捏合黑色框" + }, + { + "name": "pinch_scale", + "value": "PinchGesture scale:\n" + }, + { + "name": "pinch_center", + "value": "PinchGesture center:\nx:" + }, + { + "name": "rotation_description", + "value": "双指旋转黑色框" + }, + { + "name": "rotation_text", + "value": "RotationGesture \n angle:" + }, + { + "name": "swipe_description", + "value": "单指任一方向快速滑动黑色框" } ] } - -{ - "string": [ - - ] -} -- Gitee From bc8e9ea030c2d7a0c0cf41330ce06f411bf6a8b6 Mon Sep 17 00:00:00 2001 From: zhangmenghan Date: Tue, 3 Dec 2024 08:23:44 +0800 Subject: [PATCH 4/6] add str res Signed-off-by: zhangmenghan --- .../main/resources/en_US/element/string.json | 1930 +++++++++++++++++ 1 file changed, 1930 insertions(+) diff --git a/function/communication/bluetooth/sockettest/entry/src/main/resources/en_US/element/string.json b/function/communication/bluetooth/sockettest/entry/src/main/resources/en_US/element/string.json index f76d39bb..cdeed547 100644 --- a/function/communication/bluetooth/sockettest/entry/src/main/resources/en_US/element/string.json +++ b/function/communication/bluetooth/sockettest/entry/src/main/resources/en_US/element/string.json @@ -3902,6 +3902,1936 @@ { "name": "swipe_description", "value": "单指任一方向快速滑动黑色框" + }, + { + "name": "swipe_text_speed", + "value": "SwipeGesture\n speed:" + }, + { + "name": "swipe_text_angle", + "value": "SwipeGesture\n angle" + }, + { + "name": "combinded_description", + "value": "先长按再拖动黑色框" + }, + { + "name": "combinded_pan_start", + "value": "Pan start" + }, + { + "name": "combinded_pan_update", + "value": "Pan update" + }, + { + "name": "combinded_pan_end", + "value": "Pan end" + }, + { + "name": "combinded_longPress_onAction", + "value": "LongPress onAction" + }, + { + "name": "combinded_longPress_end", + "value": "LongPress end" + }, + { + "name": "combinded_sequence", + "value": "sequence gesture\n" + }, + { + "name": "combinded_longPress", + "value": "LongPress onAction:" + }, + { + "name": "combinded_offset", + "value": "\nPanGesture offset:\nX:" + }, + { + "name": "combinded_x", + "value": "\nX:" + }, + { + "name": "transform_translate_invert", + "value": "放大两倍反转(缩小两倍)" + }, + { + "name": "key_press_description", + "value": "按压外接键盘Tab键,再按压任意键" + }, + { + "name": "key_press_keyType", + "value": "KeyType:" + }, + { + "name": "key_press_keyCode", + "value": "\nkeyCode:" + }, + { + "name": "key_press_keyText", + "value": "\nkeyText:" + }, + { + "name": "key_press_down", + "value": "Down" + }, + { + "name": "key_press_up", + "value": "Up" + }, + { + "name": "componentId_longClick", + "value": "longClick" + }, + { + "name": "componentId_onTouch", + "value": "onTouch" + }, + { + "name": "componentId_onMouse", + "value": "onMouse" + }, + { + "name": "flex_auto", + "value": "auto" + }, + { + "name": "april", + "value": "april" + }, + { + "name": "bind_click", + "value": "点击我" + }, + // ActionSheetDialog + { + "name": "action_sheet_dialog", + "value": "ActionSheetDialog" + }, + { + "name": "action_sheet_click_sheets", + "value": "点击选项内容" + }, + // TextPickerDialog + { + "name": "text_picker_text_peach", + "value": "peach" + }, + { + "name": "text_picker_text_apple", + "value": "apple" + }, + { + "name": "text_picker_text_orange", + "value": "orange" + }, + { + "name": "text_picker_text_grape", + "value": "grape" + }, + { + "name": "text_picker_text_banana", + "value": "banana" + }, + { + "name": "text_picker_dialog", + "value": "TextPickerDialog 文本滑动选择器弹窗" + }, + { + "name": "text_picker_show", + "value": "显示文本弹窗" + }, + //Row + { + "name": "row_title", + "value": "Row" + }, + { + "name": "row_introduction_arguments", + "value": "Modifying Row parameters" + }, + { + "name": "row_introduction_properties", + "value": "Modifying Row properties" + }, + { + "name": "row_element_spacing", + "value": "element spacing" + }, + { + "name": "row_alignitems_top", + "value": "Top" + }, + { + "name": "row_alignitems_bottom", + "value": "Bottom" + }, + { + "name": "row_alignitems_center", + "value": "Center" + }, + { + "name": "row_justifycontent_start", + "value": "Start" + }, + { + "name": "row_justifycontent_center", + "value": "Center" + }, + { + "name": "row_justifycontent_end", + "value": "End" + }, + { + "name": "row_justifycontent_spacebetween", + "value": "SpaceBetween" + }, + { + "name": "row_justifycontent_spacearound", + "value": "SpaceAround" + }, + { + "name": "row_justifycontent_spaceevenly", + "value": "SpaceEvenly" + }, + { + "name": "row_justifycontent_description", + "value": "Spindle alignment format" + }, + { + "name": "row_alignitems_description", + "value": "Cross axis alignment format" + }, + { + "name": "row_introduction_tips", + "value": "Tips:" + }, + { + "name": "row_tips", + "value": "When the spindle is of type SpaceBetween, SpaceAround, or SpaceEven, the parameter space of the Row component does not take effect" + }, + // RowSplit + { + "name": "rowsplit_title", + "value": "RowSplit Indicates the horizontal split layout" + }, + { + "name": "rowsplit_introduction_properties", + "value": "Modify the drag-and-drop property of RowSplit" + }, + { + "name": "rowsplit_drag", + "value": "drag switch" + }, + { + "name": "rowsplit_drag_divider", + "value": "Drag the dividers left and right to change position" + }, + // Column + { + "name": "column_title", + "value": "Column" + }, + { + "name": "column_introduction_arguments", + "value": "Modifying Row parameters" + }, + { + "name": "column_introduction_properties", + "value": "Modifying Row properties" + }, + { + "name": "column_element_spacing", + "value": "element spacing" + }, + { + "name": "column_alignitems_start", + "value": "Start" + }, + { + "name": "column_alignitems_end", + "value": "End" + }, + { + "name": "column_alignitems_center", + "value": "Center" + }, + { + "name": "column_justifycontent_start", + "value": "Start" + }, + { + "name": "column_justifycontent_center", + "value": "Center" + }, + { + "name": "column_justifycontent_end", + "value": "End" + }, + { + "name": "column_justifycontent_spacebetween", + "value": "SpaceBetween" + }, + { + "name": "column_justifycontent_spacearound", + "value": "SpaceAround" + }, + { + "name": "column_justifycontent_spaceevenly", + "value": "SpaceEvenly" + }, + { + "name": "column_justifycontent_description", + "value": "Spindle alignment format" + }, + { + "name": "column_alignitems_description", + "value": "Cross axis alignment format" + }, + { + "name": "column_introduction_tips", + "value": "tips:" + }, + { + "name": "column_tips", + "value": "When the spindle is of type SpaceBetween, SpaceAround, or SpaceEven, the parameter space of the Row component does not take effect" + }, + // ColumnSplit + { + "name": "columnsplit_title", + "value": "RowSplit Indicates the vertical split layout" + }, + { + "name": "columnsplit_introduction_properties", + "value": "Modify the drag-and-drop property of ColumnSplit" + }, + { + "name": "columnsplit_drag", + "value": "drag switch" + }, + { + "name": "columnsplit_introduction_drag_divider", + "value": "Drag the split line up and down to change the position" + }, + // SideBarContainer + { + "name": "sidebarcontainer_title", + "value": "SideBarContainer" + }, + { + "name": "sidebarcontainer_content_text", + "value": "SideBarContainer: A sidebar container that provides a sidebar that can be displayed and hidden. The sidebar and content area are defined by subcomponents, the first subcomponent representing the sidebar and the second subcomponent representing the content area. This component is supported starting with API Version 8. If new content is added in later versions, the upper corner mark is used to separately mark the beginning version of the content." + }, + { + "name": "sidebarcontainer_sidebar_text_one", + "value": "Collect" + }, + { + "name": "sidebarcontainer_sidebar_text_two", + "value": "Home" + }, + { + "name": "sidebarcontainer_argument", + "value": "Example Modify SideBarContainer" + }, + { + "name": "sidebarcontainer_property", + "value": "Modify the SideBarContainer property" + }, + { + "name": "sidebarcontainer_argument_type", + "value": "The sidebar shows the type" + }, + { + "name": "sidebarcontainer_type_embed", + "value": "Embed" + }, + { + "name": "sidebarcontainer_type_overlay", + "value": "Overlay" + }, + { + "name": "sidebarcontainer_show_switch", + "value": "Display switch" + }, + { + "name": "sidebarcontainer_left_margin", + "value": "Control button left margin" + }, + { + "name": "sidebarcontainer_top_margin", + "value": "Control button upper margin" + }, + { + "name": "sidebarcontainer_show_button_switch", + "value": "Control button display switch" + }, + { + "name": "sidebarcontainer_position_title", + "value": "The sidebar shows the location" + }, + { + "name": "sidebarcontainer_sidebar_show_position_start", + "value": "Start" + }, + { + "name": "sidebarcontainer_sidebar_show_position_end", + "value": "End" + }, + { + "name": "sidebarcontainer_min_width", + "value": "Minimum width of sidebar" + }, + { + "name": "sidebarcontainer_max_width", + "value": "Maximum width of sidebar" + }, + { + "name": "sidebarcontainer_auto_hide", + "value": "Whether the sidebar is hidden in its smallest state" + }, + { + "name": "sidebarcontainer_divider_width", + "value": "Dividing line width" + }, + { + "name": "sidebarcontainer_drag_divider", + "value": "Drag the divider to change the sidebar size" + }, + { + "name": "sidebarcontainer__is_show_true", + "value": "The sidebar has expanded" + }, + { + "name": "sidebarcontainer__is_show_false", + "value": "The sidebar is closed" + }, + // Stack + { + "name": "stack_title", + "value": "Stack" + }, + { + "name": "stack_alignments_topstart", + "value": "TopStart" + }, + { + "name": "stack_alignments_top", + "value": "Top" + }, + { + "name": "stack_alignments_topend", + "value": "TopEnd" + }, + { + "name": "stack_alignments_start", + "value": "Start" + }, + { + "name": "stack_alignment_center", + "value": "Center" + }, + { + "name": "stack_alignment_end", + "value": "End" + }, + { + "name": "stack_alignments_bottomstart", + "value": "BottomStart" + }, + { + "name": "stack_alignments_bottom", + "value": "Bottom" + }, + { + "name": "stack_alignments_bottomend", + "value": "BottomEnd" + }, + { + "name": "stack_alignment", + "value": "AlignContent" + }, + { + "name": "stack_introduction", + "value": "The Stack attribute & parameter alignContent is updated" + }, + { + "name": "stack_introduction_zindex", + "value": "sub three zindex" + }, + { + "name": "stack_zindex_four", + "value": "4" + }, + { + "name": "stack_zindex_one", + "value": "1" + }, + { + "name": "stack_zindex", + "value": "ZIndex" + }, + // Flex + { + "name": "flex_title", + "value": "Flex" + }, + { + "name": "flex_introduction_arguments", + "value": "Modify the Flex elastic layout parameters" + }, + { + "name": "flex_argument_direction", + "value": "direction" + }, + { + "name": "flex_argument_direction_row", + "value": "Row" + }, + { + "name": "flex_argument_direction_row_reverse", + "value": "RowReverse" + }, + { + "name": "flex_argument_direction_column", + "value": "Column" + }, + { + "name": "flex_argument_direction_column_reverse", + "value": "ColumnReverse" + }, + { + "name": "flex_argument_wrap", + "value": "Modify the wrap for this flex" + }, + { + "name": "flex_argument_wrap_no_wrap", + "value": "NoWrap" + }, + { + "name": "flex_argument_wrap_wrap", + "value": "Wrap" + }, + { + "name": "flex_argument_wrap_wrap_reverse", + "value": "WrapReverse" + }, + { + "name": "flex_introduction_direction", + "value": "Change the direction of all flex" + }, + { + "name": "flex_argument_justifycontent", + "value": "Revised this Flex justifyContent" + }, + { + "name": "flex_argument_justifycontent_start", + "value": "Start" + }, + { + "name": "flex_argument_justifycontent_center", + "value": "Center" + }, + { + "name": "flex_argument_justifycontent_End", + "value": "End" + }, + { + "name": "flex_argument_justifycontent_space_between", + "value": "SpaceBetween" + }, + { + "name": "flex_argument_justifycontent_space_around", + "value": "SpaceAround" + }, + { + "name": "flex_argument_justifycontent_speac_evenly", + "value": "SpaceEvenly" + }, + { + "name": "flex_argument_alignItems", + "value": "Modify alignItems in this Flex" + }, + { + "name": "flex_argumen_alignItems_auto", + "value": "auto" + }, + { + "name": "flex_argumen_alignItems_start", + "value": "Start" + }, + { + "name": "flex_argumen_alignItems_center", + "value": "Center" + }, + { + "name": "flex_argumen_alignItems_end", + "value": "End" + }, + { + "name": "flex_argumen_alignItems_stretch", + "value": "Stretch" + }, + { + "name": "flex_argumen_alignItems_baseline", + "value": "Baseline" + }, + { + "name": "flex_argument_alignContent", + "value": "Modify the alignContent of this Flex" + }, + { + "name": "gridcontainer_title", + "value": "GridContainer Grid system" + }, + { + "name": "gridcontainer_introdional_arguments", + "value": "Modify the GridContainer parameters" + }, + { + "name": "gridcontainer_introdional_properties", + "value": "Modify the GridContainer property" + }, + { + "name": "gridcontainer_sizetype", + "value": "sizeType" + }, + { + "name": "gridcontainer_sizetype_xs", + "value": "XS" + }, + { + "name": "gridcontainer_sizetype_sm", + "value": "SM" + }, + { + "name": "gridcontainer_sizetype_md", + "value": "MD" + }, + { + "name": "gridcontainer_sizetype_lg", + "value": "LG" + }, + { + "name": "gridcontainer_sizetype_auto", + "value": "Auto" + }, + { + "name": "gridcontainer_column", + "value": "columns" + }, + { + "name": "gridcontainer_gutter", + "value": "gutter" + }, + { + "name": "gridcontainer_margin", + "value": "margin" + }, + { + "name": "image_video_and_media", + "value": "Image Video And Media" + }, + { + "name": "image_title", + "value": "Image" + }, + { + "name": "image_animator_title", + "value": "ImageAnimator" + }, + { + "name": "video_title", + "value": "Video" + }, + { + "name": "plugin_component_title", + "value": "PluginComponent" + }, + { + "name": "xcomponent_title", + "value": "XComponent" + }, + { + "name": "image_show_test", + "value": "Show the image" + }, + { + "name": "image_object_fit", + "value": "ObjectFit" + }, + { + "name": "image_sourcesize_height", + "value": "SizeHeight" + }, + { + "name": "image_sourcesize_width", + "value": "SizeWidth" + }, + { + "name": "object_fit_cover", + "value": "Cover" + }, + { + "name": "object_fit_contain", + "value": "Contain" + }, + { + "name": "object_fit_auto", + "value": "Auto" + }, + { + "name": "object_fit_fill", + "value": "Fill" + }, + { + "name": "object_fit_scale_down", + "value": "ScaleDown" + }, + { + "name": "object_fit_none", + "value": "None" + }, + { + "name": "object_fit_change", + "value": "ObjectFitChange" + }, + { + "name": "image_sourcesize_change", + "value": "SourceSizeChange" + }, + { + "name": "image_rendermode_original", + "value": "RenderModeOriginal" + }, + { + "name": "image_rendermode_template", + "value": "RenderModeTemplate" + }, + { + "name": "image_renderMode_change", + "value": "RenderModeChange" + }, + { + "name": "image_repeat_xy", + "value": "RepeatXY" + }, + { + "name": "image_repeat_x", + "value": "RepeatX" + }, + { + "name": "image_repeat_y", + "value": "RepeatY" + }, + { + "name": "image_repeat_no", + "value": "NoRepeat" + }, + { + "name": "image_repeat_change", + "value": "RepeatChange" + }, + { + "name": "image_fill_color_title", + "value": "FillColorTitle" + }, + { + "name": "image_animator_show", + "value": "ImageAnimatorShow" + }, + { + "name": "image_animator_control", + "value": "ImageAnimatorControl" + }, + { + "name": "video_show", + "value": "VideoShow" + }, + { + "name": "video_auto_play", + "value": "AutoPlay" + }, + { + "name": "video_controls_show", + "value": "ControlsShow" + }, + { + "name": "video_muted_show", + "value": "MutedShow" + }, + { + "name": "video_fit_change", + "value": "VideoFit" + }, + { + "name": "video_loop_show", + "value": "LoopShow" + }, + { + "name": "video_current_rate_change", + "value": "CurrentRateChange" + }, + { + "name": "video_play_mode", + "value": "VideoPlayMode" + }, + { + "name": "video_play_switch", + "value": "VideoPlaySwitch" + }, + { + "name": "web_title", + "value": "Web" + }, + { + "name": "web_show", + "value": "WebShow" + }, + { + "name": "web_use_reason", + "value": "reason" + }, + { + "name": "xcomponent_show", + "value": "XComponentShow" + }, + { + "name": "textarea_title", + "value": "TextArea" + }, + { + "name": "patternlock_title", + "value": "PatternLock" + }, + { + "name": "search_title", + "value": "Search" + }, + { + "name": "textarea_textalign_start", + "value": "Start" + }, + { + "name": "textarea_textalign_center", + "value": "Center" + }, + { + "name": "textarea_textalign_end", + "value": "End" + }, + { + "name": "textareaa_textalign_change", + "value": "textAreatextAlignChange" + }, + { + "name": "textarea_show", + "value": "TextAreaShow" + }, + { + "name": "textarea_control", + "value": "TextAreaControl" + }, + { + "name": "textarea_copyoptions_none", + "value": "None" + }, + { + "name": "textarea_copyoptions_inapp", + "value": "InApp" + }, + { + "name": "textarea_copyoptions_localdevice", + "value": "LocalDevice" + }, + { + "name": "textarea_copyoptions_change", + "value": "CopyOptionsChange" + }, + { + "name": "textarea_placeholder_change", + "value": "PlaceholderChange" + }, + { + "name": "textarea_caretcolor_change", + "value": "CaretcolorChage" + }, + { + "name": "patternlock_active_color", + "value": "PatternLockActiveColor" + }, + { + "name": "patternlock_path_color", + "value": "PatternLockParhColor" + }, + { + "name": "patternlock_select_color", + "value": "PatternLockSelectColor" + }, + { + "name": "patternlock_regular_color", + "value": "PatternLockRegularColor" + }, + { + "name": "patternlock_side_length", + "value": "PatternLockSideLengh" + }, + { + "name": "patternlock_circle_radius", + "value": "PatternLockCircleRadius" + }, + { + "name": "patternlock_pathstroke_width", + "value": "PatternLockPathStrokeWidth" + }, + { + "name": "patternlock_change", + "value": "PatternLockChange" + }, + { + "name": "search_textalign_change", + "value": "SearchTextAlignChange" + }, + { + "name": "search_placeholder_change", + "value": "SearchPlaceholderChange" + }, + { + "name": "search_copyOption_change", + "value": "SearchCopyOptionChange" + }, + { + "name": "search_change", + "value": "SearchChange" + }, + // List + { + "name": "list_title", + "value": "List" + }, + { + "name": "list_introduction_arguments", + "value": "Modifying List arguments" + }, + { + "name": "list_introduction_properties", + "value": "Modifying List properties" + }, + { + "name": "list_introduction_state", + "value": "Status bar" + }, + { + "name": "list_properties_direction", + "value": "listDirection" + }, + { + "name": "list_properties_direction_vertical", + "value": "Vertical" + }, + { + "name": "list_properties_direction_Horizontal", + "value": "Horizontal" + }, + { + "name": "list_argument_space", + "value": "space" + }, + { + "name": "list_properties_divider_stroke_width", + "value": "divider - strokeWidth" + }, + { + "name": "list_properties_divider_color", + "value": "divider - color" + }, + { + "name": "list_properties_scroll_bar", + "value": "scrollBar" + }, + { + "name": "list_properties_scroll_bar_off", + "value": "Off" + }, + { + "name": "list_properties_scroll_bar_on", + "value": "On" + }, + { + "name": "list_properties_scroll_bar_auto", + "value": "Auto" + }, + { + "name": "list_properties_initial_index", + "value": "initialIndex" + }, + { + "name": "list_properties_edge_effect", + "value": "edgeEffect" + }, + { + "name": "list_properties_edge_effect_spring", + "value": "Spring" + }, + { + "name": "list_properties_edge_effect_fade", + "value": "Fade" + }, + { + "name": "list_properties_edge_effect_none", + "value": "None" + }, + { + "name": "list_properties_chain_animation", + "value": "chainAnimation" + }, + { + "name": "list_properties_multi_selectable", + "value": "multiSelectable " + }, + { + "name": "list_properties_lanes", + "value": "lanes" + }, + { + "name": "list_properties_align_list_item", + "value": "alignListItem" + }, + { + "name": "list_properties_align_list_item_start", + "value": "Start" + }, + { + "name": "list_properties_align_list_item_Center", + "value": "Center" + }, + { + "name": "list_properties_align_list_item_End", + "value": "End" + }, + { + "name": "list_introduction_delete", + "value": "Left-click item to delete it" + }, + { + "name": "list_item_title", + "value": "ListItem" + }, + { + "name": "list_item_properties_selectable", + "value": "selectable" + }, + { + "name": "list_item_introduction_drag", + "value": "Drag the item with your mouse to see the selectable property effect" + }, + { + "name": "list_item_introduction_properties", + "value": "修改 ListItem 的属性" + }, + // Grid + { + "name": "grid_title", + "value": "Grid" + }, + { + "name": "grid_item_title", + "value": "GridItem" + }, + { + "name": "grid_properties_columns_template", + "value": "columnsTemplate(Control the proportion of the third column)" + }, + { + "name": "grid_properties_columns_gap", + "value": "columnsGap" + }, + { + "name": "girid_properties_rows_gap", + "value": "rowsGap" + }, + { + "name": "grid_properties_layout_direction", + "value": "layoutDirection" + }, + { + "name": "grid_properties_layout_direction_row", + "value": "Row" + }, + { + "name": "grid_properties_layout_direction_column", + "value": "Column" + }, + { + "name": "grid_properties_layout_direction_row_reverse", + "value": "RowReverse" + }, + { + "name": "grid_properties_layout_direction_column_reverse", + "value": "ColumnReverse" + }, + { + "name": "grid_properties_rows_template", + "value": "rowsTemplate(Control the proportion of the third rows)" + }, + // GridItem + { + "name": "grid_item_introduction", + "value": "Change the position of 1" + }, + { + "name": "grid_item_row_start", + "value": "Change the start line number" + }, + { + "name": "grid_item_row_end", + "value": "Modify the end line number" + }, + { + "name": "grid_item_column_start", + "value": "Change the start column number" + }, + { + "name": "grid_item_column_end", + "value": "Modify the end column number" + }, + // Swiper + { + "name": "swiper_title", + "value": "swiper" + }, + { + "name": "swiper_introduction", + "value": "Swipe left or right to switch pages" + }, + { + "name": "swiper_introduction_arguments", + "value": "SwiperController Controller" + }, + { + "name": "swiper_introduction_properties", + "value": "Modify the properties of Swiper" + }, + { + "name": "swiper_properties_disable_swipe", + "value": "Disable swipe left or right to switch function" + }, + { + "name": "swiper_properties_item_space", + "value": "Space between sliding pages" + }, + { + "name": "swiper_properties_vertical", + "value": "Is it vertical sliding" + }, + { + "name": "swiper_properties_duration", + "value": "Duration of slide switching animation (unit: ms)" + }, + { + "name": "swiper_properties_loop", + "value": "Enable loop from beginning to end" + }, + { + "name": "swiper_properties_auto_play", + "value": "Enable automatic loop playback" + }, + { + "name": "swiper_properties_interval", + "value": "Interval of automatic playback (unit: ms)" + }, + { + "name": "swiper_controller_next", + "value": "Next page" + }, + { + "name": "swiper_controller_previous", + "value": "Previous page" + }, + // Navigation + { + "name": "navRouter_title", + "value": "NavRouter" + }, + { + "name": "navigation_title", + "value": "Navigation" + }, + { + "name": "navigation_first_page", + "value": "First page of Navigation" + }, + { + "name": "navigation_second_page", + "value": "Second page of Navigation" + }, + { + "name": "navigation_third_page", + "value": "Third page of Navigation" + }, + { + "name": "navigation_first_page_push", + "value": "Go to the second page" + }, + { + "name": "navigation_first_page_active", + "value": "Click to toggle activate status" + }, + { + "name": "navigation_second_page_push", + "value": "Go to the third page" + }, + { + "name": "navigation_third_page_back", + "value": "Go back to the first page" + }, + // Tabs + { + "name": "tabs_title", + "value": "Tabs" + }, + { + "name": "tabs_introduction_arguments", + "value": "Modify the parameters of Tabs" + }, + { + "name": "tabs_introduction_properties", + "value": "Modify the properties of Tabs" + }, + { + "name": "tabs_arguments_bar_position", + "value": "barPosition" + }, + { + "name": "tabs_arguments_bar_position_start", + "value": "Start" + }, + { + "name": "tabs_arguments_bar_position_end", + "value": "End" + }, + { + "name": "tabs_properties_vertical", + "value": "vertical" + }, + { + "name": "tabs_properties_bar_mode", + "value": "barMode" + }, + { + "name": "tabs_properties_bar_mode_fixed", + "value": "Fixed" + }, + { + "name": "tabs_properties_bar_scrollable", + "value": "Scrollable" + }, + { + "name": "tabs_properties_is_scrollable", + "value": "scrollable" + }, + { + "name": "tabs_properties_animation_duration", + "value": "animationDuration(ms)" + }, + { + "name": "tabs_arguments_controller", + "value": "Switches to the specified index" + }, + // TabsContent + { + "name": "tab_content_title", + "value": "TabContent" + }, + { + "name": "tab_content_introduction", + "value": "Subtab/Bottom tab switcher" + }, + { + "name": "tab_content_side", + "value": "Switch sidebar" + }, + // Stepper + { + "name": "stepper_title", + "value": "Stepper&StepperItem" + }, + { + "name": "canvas_title", + "value": "Canvas" + }, + { + "name": "circle_title", + "value": "Circle" + }, + { + "name": "ellipse_title", + "value": "Ellipse" + }, + { + "name": "line_title", + "value": "Line" + }, + { + "name": "polyline_title", + "value": "Polyline" + }, + { + "name": "path_title", + "value": "Path" + }, + { + "name": "polygon_title", + "value": "Polygon" + }, + { + "name": "rect_title", + "value": "Rect" + }, + { + "name": "shape_title", + "value": "shape" + }, + { + "name": "circle_change", + "value": "CircleChange" + }, + { + "name": "circle_change_fill", + "value": "CircleChangeFill" + }, + { + "name": "circle_change_radius", + "value": "CircleRadius" + }, + { + "name": "circle_change_fillopacity", + "value": "CircleChangeFillOpacity" + }, + { + "name": "circle_change_strokewidth", + "value": "CircleStrokeWidth" + }, + { + "name": "circle_stroke_dash", + "value": "CircleStrokeDash" + }, + { + "name": "circle_stroke_color", + "value": "CircleStokeColor" + }, + { + "name": "circle_stroke_opacity", + "value": "CircleStrokeOpacity" + }, + { + "name": "ellipse_fill", + "value": "EllipseFill" + }, + { + "name": "ellipse_stroke_color", + "value": "EllipseStrokeColor" + }, + { + "name": "ellipse_stroke_width", + "value": "EllipseStrokeWidth" + }, + { + "name": "ellipse_width", + "value": "EllipseWidth" + }, + { + "name": "ellipse_height", + "value": "EllipseHeight" + }, + { + "name": "ellipse_fill_opacity", + "value": "EllipseFillOpacity" + }, + { + "name": "ellipse_stroke_opacity", + "value": "EllipseStrokeOpacity" + }, + { + "name": "ellipse_stroke_dash", + "value": "EllipseStrokeDash" + }, + { + "name": "line_start_point_x", + "value": "LineStartPointX" + }, + { + "name": "line_start_point_y", + "value": "LineStartPointY" + }, + { + "name": "line_end_point_x", + "value": "LineEndPointY" + }, + { + "name": "line_end_point_y", + "value": "LineEndPointY" + }, + { + "name": "line_stroke_width", + "value": "LineSrokeWidth" + }, + { + "name": "line_stroke_color", + "value": "LineStrokeColor" + }, + { + "name": "line_stroke_opacity", + "value": "LineStrokeOpacity" + }, + { + "name": "line_stroke_dash", + "value": "LineStrokeDash" + }, + { + "name": "polygon_fill", + "value": "PolygonFill" + }, + { + "name": "polygon_fill_opacity", + "value": "PolygonFillOpacity" + }, + { + "name": "polygon_stroke_color", + "value": "PolygonStrokeColor" + }, + { + "name": "polygon_stroke_opacity", + "value": "PolygonStrokeOpacity" + }, + { + "name": "polygon_stroke_width", + "value": "PolygonStrokeWidth" + }, + { + "name": "polygon_stroke_dash", + "value": "PolygonStrokeDash" + }, + { + "name": "polyline_first_x", + "value": "PolylineFirstX" + }, + { + "name": "polyline_first_y", + "value": "PolylineFirstY" + }, + { + "name": "polyline_second_x", + "value": "PolylineSecondX" + }, + { + "name": "polyline_second_y", + "value": "PolylineSecondY" + }, + { + "name": "polyline_third_x", + "value": "PolylineThirdX" + }, + { + "name": "polyline_third_y", + "value": "PolylineThirdY" + }, + { + "name": "polyline_stroke_width", + "value": "PolylineStrokeWidth" + }, + { + "name": "polyline_stroke_color", + "value": "PolylineStrokeColor" + }, + { + "name": "polyline_stroke_dash", + "value": "PolylineStrokeDash" + }, + { + "name": "polyline_stroke_opacity", + "value": "PolylineStrokeOpacity" + }, + { + "name": "rect_height", + "value": "RectHeight" + }, + { + "name": "rect_width", + "value": "RectWidth" + }, + { + "name": "rect_radius_width", + "value": "RectRadiusWidth" + }, + { + "name": "rect_radius_height", + "value": "RectRadiusHeight" + }, + { + "name": "rect_fill_opacity", + "value": "RectFillOpacity" + }, + { + "name": "rect_stroke", + "value": "RectStroke" + }, + { + "name": "rect_stroke_width", + "value": "RectStrokeWidth" + }, + { + "name": "rect_stroke_dash", + "value": "RectSrokeDash" + }, + { + "name": "rect_stroke_opacity", + "value": "RectStrokeOpacity" + }, + { + "name": "rect_fill", + "value": "RectFill" + }, + { + "name": "path_line", + "value": "PathLine" + }, + { + "name": "path_triangle", + "value": "PathTriangle" + }, + { + "name": "path_square", + "value": "PathSquare" + }, + { + "name": "path_polygon", + "value": "PathPolygon" + }, + { + "name": "path_camber_first", + "value": "PathCamberFirst" + }, + { + "name": "path_camber_second", + "value": "PathCamberSecond" + }, + { + "name": "path_camber_third", + "value": "PathCamberThird" + }, + { + "name": "path_commands_select", + "value": "PathCommandsSelect" + }, + { + "name": "path_fill", + "value": "PathFill" + }, + { + "name": "path_fill_opacity", + "value": "PathFillOpacity" + }, + { + "name": "path_stroke_color", + "value": "PathStrokeColor" + }, + { + "name": "path_stroke_opacity", + "value": "PathStrokeOpacity" + }, + { + "name": "path_stroke_dash", + "value": "PathStrokeDash" + }, + { + "name": "path_stroke_width", + "value": "PathStrokeWidth" + }, + { + "name": "shape_fill", + "value": "ShapeFill" + }, + { + "name": "shape_stroke_color", + "value": "ShapeStrokeColor" + }, + { + "name": "shape_view_port_x", + "value": "ShapeViewPortX" + }, + { + "name": "shape_view_port_y", + "value": "ShapeViewPortY" + }, + { + "name": "shape_view_port_width", + "value": "ShapeViewPortWidth" + }, + { + "name": "shape_view_port_height", + "value": "ShapeViewPortHeight" + }, + { + "name": "shape_stroke_opacity", + "value": "ShapeStrokeOpacity" + }, + { + "name": "shape_fill_opacity", + "value": "ShapeFillOpacity" + }, + { + "name": "shape_stroke_width", + "value": "ShapeStrokeWidth" + }, + { + "name": "shape_stroke_dash", + "value": "ShapeStrokeDash" + }, + { + "name": "web", + "value": "Web" + }, + { + "name": "canvas_components", + "value": "Canvas components" + }, + { + "name": "canvas_component_attributes", + "value": "Base attributes" + }, + { + "name": "canvas_component_transform", + "value": "Transform" + }, + { + "name": "canvas_component_gradient", + "value": "CanvasGradient" + }, + { + "name": "canvas_component_path_2d", + "value": "Path2D" + }, + { + "name": "canvas_component_image_bitmap", + "value": "ImageBitmap" + }, + { + "name": "canvas_component_method", + "value": "Base methods" + }, + { + "name": "canvas_fillStyle", + "value": "fillStyle" + }, + { + "name": "canvas_lineWidth", + "value": "lineWidth" + }, + { + "name": "canvas_strokeStyle", + "value": "strokeStyle" + }, + { + "name": "canvas_lineCap", + "value": "lineCap" + }, + { + "name": "canvas_lineJoin", + "value": "lineJoin" + }, + { + "name": "canvas_miterLimit", + "value": "miterLimit" + }, + { + "name": "canvas_font", + "value": "font" + }, + { + "name": "canvas_textAlign", + "value": "textAlign" + }, + { + "name": "canvas_textBaseline", + "value": "textBaseline" + }, + { + "name": "canvas_globalAlpha", + "value": "globalAlpha" + }, + { + "name": "canvas_lineDashOffset", + "value": "lineDashOffset" + }, + { + "name": "canvas_globalCompositeOperation", + "value": "globalCompositeOperation" + }, + { + "name": "canvas_imageSmoothingEnabled", + "value": "imageSmoothingEnabled" + }, + { + "name": "canvas_createLinearGradient", + "value": "createLinearGradient" + }, + { + "name": "cavas_createRadialGradient", + "value": "createRadialGradient" + }, + { + "name": "canvas_createRadialGradient", + "value": "createRadialGradient" + }, + { + "name": "canvas_fillRect", + "value": "fillRect" + }, + { + "name": "canvas_strokeRect", + "value": "strokeRect" + }, + { + "name": "canvas_fillText", + "value": "fillText" + }, + { + "name": "canvas_strokeText", + "value": "strokeText" + }, + { + "name": "canvas_measureText", + "value": "measureText" + }, + { + "name": "canvas_stroke", + "value": "stroke" + }, + { + "name": "canvas_createPattern", + "value": "createPattern" + }, + { + "name": "canvas_fill", + "value": "fill" + }, + { + "name": "canvas_clip", + "value": "clip" + }, + { + "name": "canvas_rotate", + "value": "rotate" + }, + { + "name": "canvas_scale", + "value": "scale" + }, + { + "name": "canvas_drawImage", + "value": "drawImage" + }, + { + "name": "canvas_getImageData", + "value": "getImageData" + }, + { + "name": "canvas_putImageData", + "value": "putImageData" + }, + { + "name": "canvas_setLineDash", + "value": "setLineDash" + }, + { + "name": "canvas_getLineDash", + "value": "getLineDash" + }, + { + "name": "canvas_transferFromImageBitmap", + "value": "transferFromImageBitmap" + }, + { + "name": "canvas_toDataURL", + "value": "toDataURL" + }, + { + "name": "canvas_canvasZone", + "value": "Canvas Zone" + }, + { + "name": "canvas_attributesOperations", + "value": "Attributes Operations" + }, + { + "name": "canvas_clearEffects", + "value": "Clear Effects" + }, + { + "name": "cavnas_clearRect", + "value": "clearRect" + }, + { + "name": "canvas_clearRect", + "value": "clearRect" + }, + { + "name": "canvas_shadowBlur", + "value": "shadowBlur" + }, + { + "name": "canvas_shadowColor", + "value": "shadowColor" + }, + { + "name": "canvas_shadowOffsetX", + "value": "shadowOffsetX" + }, + { + "name": "canvas_shadowOffsetY", + "value": "shadowOffsetY" + }, + { + "name": "canvas_addColorStop", + "value": "addColorStop" + }, + { + "name": "canvas_beginPath", + "value": "beginPath" + }, + { + "name": "canvas_moveTo", + "value": "moveTo" + }, + { + "name": "canvas_lineTo", + "value": "lineTo" + }, + { + "name": "canvas_closePath", + "value": "closePath" + }, + { + "name": "canvas_bezierCurveTo", + "value": "bezierCurveTo" + }, + { + "name": "canvas_quadraticCurveTo", + "value": "quadraticCurveTo" + }, + { + "name": "canvas_arc", + "value": "arc" + }, + { + "name": "canvas_arcTo", + "value": "arcTo" + }, + { + "name": "canvas_ellipse", + "value": "ellipse" + }, + { + "name": "canvas_rect", + "value": "rect" + }, + { + "name": "canvas_show_message", + "value": "Printed to the console" + }, + { + "name": "canvas_transform", + "value": "transform" + }, + { + "name": "canvas_setTransform", + "value": "setTransform" + }, + { + "name": "canvas_translate", + "value": "translate" + }, + { + "name": "canvas_imageSmoothingQuality", + "value": "imageSmoothingQuality" + }, + // scrollTo 动效增强 + { + "name": "scroll_To_effect", + "value": "ScrollTo effect" + }, + { + "name": "scroller", + "value": "Scroller" + }, + { + "name": "list", + "value": "List" + }, + { + "name": "grid", + "value": "Grid" + }, + { + "name": "waterFlow", + "value": "WaterFlow" + }, + { + "name": "tabs_switch_effect", + "value": "Tabs switch effect" + }, + { + "name": "image_fit_Full_effect", + "value": "Image fit/full effect" + }, + { + "name": "particle_effect", + "value": "Particle Effect" + }, + { + "name": "particle_spawn", + "value": "Spawn" + }, + { + "name": "particle_spawn_stop", + "value": "Stop" + }, + { + "name": "navigator_title", + "value": "Navigator" + }, + { + "name": "navigator_first_page", + "value": "First page of Navigaor" + }, + { + "name": "navigator_second_page", + "value": "Second page of Navigator" + }, + { + "name": "navigator_third_page", + "value": "Third page of Navigator" + }, + { + "name": "navigator_first_page_push", + "value": "Go to the second page" + }, + { + "name": "navigator_first_page_active", + "value": "Click to toggle activate status" + }, + { + "name": "navigator_second_page_push", + "value": "Go to the third page" + }, + { + "name": "navigator_third_page_back", + "value": "Go back to the first page" + }, + { + "name": "navigator_return_message", + "value": "hello! This is a param form the first page" } ] } -- Gitee From 000c3703930ca79f18832738aa0826598404a025 Mon Sep 17 00:00:00 2001 From: zhangmenghan Date: Tue, 3 Dec 2024 08:24:13 +0800 Subject: [PATCH 5/6] add sockettest Signed-off-by: zhangmenghan --- .../bluetooth/sockettest/.gitignore | 12 +++ .../bluetooth/sockettest/AppScope/app.json5 | 25 ++++++ .../resources/base/element/string.json | 8 ++ .../resources/base/media/app_icon.png | Bin 0 -> 2041 bytes .../bluetooth/sockettest/README.md | 72 ++++++++++++++++++ .../bluetooth/sockettest/build-profile.json5 | 64 ++++++++++++++++ .../sockettest/hvigor/hvigor-config.json5 | 37 +++++++++ .../sockettest/hvigor/hvigor-wrapper.js | 16 ++++ .../bluetooth/sockettest/hvigorfile.ts | 21 +++++ .../bluetooth/sockettest/hvigorw | 69 +++++++++++++++++ .../bluetooth/sockettest/hvigorw.bat | 69 +++++++++++++++++ .../bluetooth/sockettest/oh-package.json5 | 29 +++++++ 12 files changed, 422 insertions(+) create mode 100644 function/communication/bluetooth/sockettest/.gitignore create mode 100644 function/communication/bluetooth/sockettest/AppScope/app.json5 create mode 100644 function/communication/bluetooth/sockettest/AppScope/resources/base/element/string.json create mode 100644 function/communication/bluetooth/sockettest/AppScope/resources/base/media/app_icon.png create mode 100644 function/communication/bluetooth/sockettest/README.md create mode 100644 function/communication/bluetooth/sockettest/build-profile.json5 create mode 100644 function/communication/bluetooth/sockettest/hvigor/hvigor-config.json5 create mode 100644 function/communication/bluetooth/sockettest/hvigor/hvigor-wrapper.js create mode 100644 function/communication/bluetooth/sockettest/hvigorfile.ts create mode 100644 function/communication/bluetooth/sockettest/hvigorw create mode 100644 function/communication/bluetooth/sockettest/hvigorw.bat create mode 100644 function/communication/bluetooth/sockettest/oh-package.json5 diff --git a/function/communication/bluetooth/sockettest/.gitignore b/function/communication/bluetooth/sockettest/.gitignore new file mode 100644 index 00000000..ce22a24e --- /dev/null +++ b/function/communication/bluetooth/sockettest/.gitignore @@ -0,0 +1,12 @@ +/node_modules +/oh_modules +/local.properties +/.idea +**/build +/.hvigor +.cxx +/.clangd +/.clang-format +/.clang-tidy +**/.test +/.oh-package-lock.json5 \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/AppScope/app.json5 b/function/communication/bluetooth/sockettest/AppScope/app.json5 new file mode 100644 index 00000000..4e4fded8 --- /dev/null +++ b/function/communication/bluetooth/sockettest/AppScope/app.json5 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "app": { + "bundleName": "com.example.bluetoothsocket", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/function/communication/bluetooth/sockettest/AppScope/resources/base/element/string.json b/function/communication/bluetooth/sockettest/AppScope/resources/base/element/string.json new file mode 100644 index 00000000..cc48f4ec --- /dev/null +++ b/function/communication/bluetooth/sockettest/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "BluetoothSocket" + } + ] +} diff --git a/function/communication/bluetooth/sockettest/AppScope/resources/base/media/app_icon.png b/function/communication/bluetooth/sockettest/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..cd45accb1dfd2fd0da16c732c72faa6e46b26521 GIT binary patch literal 2041 zcmaJ?c~nzZ9u6@;0AXaYAVN(;Kr(@>EJ+}skOWf=BA~*l4us@ELY9{%0m5QX6pnb} z(jZF|S&pLAS}3BZAfeQSvJ_h>F2Q1PYqi?o5`;m_yjZdG$1v}l_wK#F^L^iMz2}uD z#K$>1dON~kFlWvhW+Jp=tuN9J`ZlM-rl4h+ij|^D0y9;4JOuz-EdVnB6i3R-0ulk9 zApi4zAQA>!N9@-o026$1@L`d124`3G5<@_m`0f)Ug_Ie~;HT2q<_a=HH> zDwTdfD^-cW-|_xWVP$f@93UhDN-#&khZ>jZXLTi~$0`7x3REP6pk%&^2|`c>DutjN zMJD4Zs6Z}{FOpd;*mo2zm(GzXRXiCV;4m3zNCYnu3Fy=i5;2An&Lp!#LP;bRD~1&s z%VH6UY+}r6YDgG+p34OJIZ{BTn&%4s=CT&#TBkuOhdeU@g(w#guoa*b^)73=XyI65 z7Swys6)YS}?1EeZ6b!-I+yCnIya^g0>-NLsLWd8t56GZ_S3r|ZGbR+mV2ErEb9J)X zIF!njY-D-7{qtF2(?nlQ$0}!pzt=}hc*m%%)0Jb#N_K4@IC-`Pi5DahPZN7N9rH;ol;Gc*>-Go@gXKTM{eP)iJj6CYTIi}B#zLKZYD@_;m zrXmXXsFq@~ou-z!9bHoM8*(hwl>X(zm)TDcdkF4lZm$1jP*HbnD`o1$g}_R#+bu2D zr%7Y8KdsaC-V*aem5#@*M%r^GPgu%P2e-BnBClhP2yoGFe40>);=}>{NONtkXQ01p z)OX^t2Ojhddot9eg0WTIVSTNBa}7V-^_pO595w|Hx9q?k4dMp@$G7PK*TD=y;ck6J zdGRB!_RAI2nR3%tO1IkdWp*bw*?<=pM_LZb30?!oK)s;En( z!#nnd9=cXJ<}+e{XLdx(q3&ikJISe?eSHHohk+pz+$6Cv{ytvc{QXmMn2XQ9U8rvt zrJdAn(0gpSD@N=yTrI_2^P#*zQg7MTp1)k(lv(*(KtUR6@M|2WB>2wRwC-h=wk6XF zPtSes*_JwI+^d>xW489MJw5R6=t5?{R zc|E8i?RL@p9)A3ZJAQOg`}+F;<_vnWA!KxR#g%jZ@y_1Qu#Uw)kFPw_xmZ?a^e*1{ zM|ImtqA|(CaDQ@Fyvcof`MN66&VI6m6gAyAXx`%cDx6BI{Bj#}V*Rn1(b~;Am)D2u zX7(027IO?Z2VYK^1vXXpoZ@AtH~N?0rYWwtyA15`6vEf6fk&;o-L;7zFt`5nk*iOy z`<918zB+k;EytI$FAXug)jk*e@e};4e9g__w4A5ev!!)H$yC@{?vsRqJ##X1R%xPG z&_R3oDi$MtTkVqfPj)HEUDx_7wd!y{8#1%$U*Dd0sK@=#6+!XlsE-s^1f5E`R9Wo71^b~mbVdU;Fw0LG~mUQg;xsX4QYRo3B@rH_=ry>DE8ef!c2ta8UcI#26# zF|`*4wtMHe@%#eGZw`#Yj|QWuB`eRD)b~)r9mM95p_JVG%-IdcbIX5qG#GpGD+IrS zEqxb1Rg&Dadk5#7t4j68I1f!@A$efp1?I%&d*56)yl!tkz!14<$0Od_&6cGw$WW0r zjSlQA7l*6;vgfhv!cR|RmAD$+w6j`rVf=-?-D@q>kOseUVSb*~jbAS^*1h?ZL)n(9 zDa}`4etXO6`}9;{k5E^N{rcfnV_(LPwsDg``wtyS*V<19c3!PGJ3Kqy9ksvkwbJ%Z z*N(fT0{e*Wji-Ck5!3YE0j|PZ@&z`v=kitWL$bqSt!e4bH!+(|Q)CZ30^nVPfkx{s zX{6of`p=BiPb@u@IyL!tRk>?qgBqCmo-Zlt!636g?z`s~zdfwuB7DXZHvV`Usp+%Z zo*&;Biu@MHE&2j+?j^o`Cr12u<>vOe=a&8a2hlcmFjJiDR>XnD4c4DAhZWCkiAgW{ E51q9-lK=n! literal 0 HcmV?d00001 diff --git a/function/communication/bluetooth/sockettest/README.md b/function/communication/bluetooth/sockettest/README.md new file mode 100644 index 00000000..50ed720a --- /dev/null +++ b/function/communication/bluetooth/sockettest/README.md @@ -0,0 +1,72 @@ +蓝牙 Socket 应用开发和使用文档 +本文档主要讲解蓝牙 Socket 应用的开发流程和使用方法。 + +应用开发 +本文使用的 DevEcoStudio 版本是 4.1.0.400,API 版本为 11。 + +通过 DevEcoStudio 创建项目“File->New->Create Project”创建一个工程。 +image.png + +工程创建完毕后,在 entry\src\main\ets 创建蓝牙 socket 相关目录,并且 entry\build-profile.json5 中配置 worker。 +ets +├─ workers +│ └─ Worker.ets +├─ pages +│ └─ Index.ets +└─ entryability + └─ EntryAbility.ets +​ +界面入口为 Index.ets,此处也为蓝牙测试页面 +蓝牙 Socket 相关接口可在 @ohos.bluetooth.socket(蓝牙 socket 模块)(推荐) (openharmony.cn)中查找和学习 + +image.png + +客户端传送次数和包长度可供选择,每次传输 102 个包,包中数组元素为 0-101,如第一个包中元素皆为 0,长度为应用界面规定长度,以此类推,客户端计算发包 1~100 的发包的发包个数和长度,共发送字节为收到的长度的累加。在以上数据发送完毕后,再发送一个首个元素为 199 的数组表示发送完毕。 + +服务端接收数据流程如下图所示。 + +image.png + + +需要注意的是,因为客户端在主线程发送数据会存在 appfreeze 的问题,所以需要让客户端在与主线程并行的 worker 线程中发送数据,具体可参考 @ohos.worker (启动一个 Worker) (openharmony.cn)。 + +应用使用 +准备 +两块 dayu200 开发板 +在使用前确保两块开发板的蓝牙是开启状态,且两块开发板蓝牙配对成功 +安装应用程序:hdc install xxx.hap +关于两块开发板所用镜像适配情况: +(1) 5.0.0Release(OpenHarmony 5.0.0.71)版本安装应用无法出现授权弹框且会出现闪退状况,需自行在设置-隐私-权限管理-应用-Socket 应用中允许使用蓝牙权限; +(2) 4.1.1Release(OpenHarmony 4.1.7.8)版本服务端接收完毕后取消订阅 spp 读请求事件失败,但不影响使用; +(3) 5.0 Beta1(OpenHarmony 5.0.0.25)版本使用无故障。 +使用 +在两块开发板上安装此应用; + +点击运行 Socket 应用,允许蓝牙权限; + +一台开发板选 Socket 客户端,一台选 Socket 服务端; + +客户端选择已配对的服务端蓝牙名称,并选择测试次数和包长度; + +先点击“测试 Socket 服务端”按钮,再点击“测试 Socket 客户端”按钮; + +客户端页面显示每次发包次数及包长,并在底部显示共测试次数和共发送字节长度,服务端会显示每次收包个数、包长、用时及速度,并在底部显示共测试次数、共收到字节、总计时以及平均速度。(点击顶部文字”蓝牙 Socket 测试“可变换背景颜色,颜色为白色时,不打印日志,为粉色时打印日志) + +测试结果:本测试结果为在三种镜像下测试次数为 100 情况下的平均速度,具体结果如下: + +4.1.1Release 版本(OpenHarmony 4.1.7.8) 5.0 Beta 版本(OpenHarmony 5.0.0.25) 5.0.0Release 版本(OpenHarmony 5.0.0.71) +包长为 10 字节时的平均速度(单位:KB/s) 13 17 24 +包长为 1024 字节时的平均速度(单位:KB/s) 153 155 184 +包长为 4096 字节时的平均速度(单位:KB/s) 160 160 189 +包长为 10 字节时的总收包个数(单位:个) 1497 1552 1651 +包长为 1024 字节时的总收包个数(单位:个) 11530 12366 12962 +包长为 4096 字节时的总收包个数(单位:个) 47407 51999 55193 +相比之下,包长为 10 字节时的传输速率较低,其原因可能是:每次回调中内存包含 1 到 100 的每次回调包含数据较少,而较小的数据包可能会导致更多的头部信息和开销,从而降低实际的传输速率。相反,较大的数据包可以减少这种开销,故传输速率较大。 + +常见问题及解决办法 +问题描述:应用打开出现闪退情况 +可能原因:该开发板蓝牙处于关闭状态 +解决方法:在设置中打开蓝牙 +问题描述:点击按钮,按钮变成红色,按钮中显示“蓝牙未打开,请再试一次“ +可能原因:开发板蓝牙处于关闭状态或按钮点击顺序有误 +解决方法:检查两块开发板蓝牙状态,将处于关闭状态的蓝牙打开,如两端蓝牙皆处于开启状态,则为按钮点击顺序有误,应先点击“测试 Socket 服务端”按钮,再点击“测试 Socket 客户端”按钮 \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/build-profile.json5 b/function/communication/bluetooth/sockettest/build-profile.json5 new file mode 100644 index 00000000..a384bbf1 --- /dev/null +++ b/function/communication/bluetooth/sockettest/build-profile.json5 @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "app": { + "signingConfigs": [ + { + "name": "default", + "material": { + "certpath": "C:/Users/zxj/.ohos/config/openharmony/default_BluetoothSocket3_LUv2_etETeHIl1vpG64jTAN7uYZaBGaJlIvhf86fUeE=.cer", + "storePassword": "0000001AF42F09C2996897179A9DBDDF54E62D233983900F261538AA575464B941F3A8D495E52282DB0A", + "keyAlias": "debugKey", + "keyPassword": "0000001A6DC25A7AF45F76ECB89526A7B56DDC54A6FE3F799B5EA695A1BA539354D3322134FECC348258", + "profile": "C:/Users/zxj/.ohos/config/openharmony/default_BluetoothSocket3_LUv2_etETeHIl1vpG64jTAN7uYZaBGaJlIvhf86fUeE=.p7b", + "signAlg": "SHA256withECDSA", + "storeFile": "C:/Users/zxj/.ohos/config/openharmony/default_BluetoothSocket3_LUv2_etETeHIl1vpG64jTAN7uYZaBGaJlIvhf86fUeE=.p12" + } + } + ], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compileSdkVersion": 11, + "compatibleSdkVersion": 11, + "runtimeOS": "OpenHarmony", + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/hvigor/hvigor-config.json5 b/function/communication/bluetooth/sockettest/hvigor/hvigor-config.json5 new file mode 100644 index 00000000..87532ee1 --- /dev/null +++ b/function/communication/bluetooth/sockettest/hvigor/hvigor-config.json5 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "hvigorVersion": "3.2.4", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "3.2.4" + }, + "execution": { + // "analyze": "default", /* Define the build analyze mode. Value: [ "default" | "verbose" | false ]. Default: "default" */ + // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */ + // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */ + // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */ + }, + "nodeOptions": { + // "maxOldSpaceSize": 4096 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process */ + } +} diff --git a/function/communication/bluetooth/sockettest/hvigor/hvigor-wrapper.js b/function/communication/bluetooth/sockettest/hvigor/hvigor-wrapper.js new file mode 100644 index 00000000..6647e200 --- /dev/null +++ b/function/communication/bluetooth/sockettest/hvigor/hvigor-wrapper.js @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +"use strict";var u=require("path"),D=require("os"),e=require("fs"),t=require("crypto"),r=require("child_process"),n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={},C={},F=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(C,"__esModule",{value:!0}),C.maxPathLength=C.isMac=C.isLinux=C.isWindows=void 0;const E=F(D),A="Windows_NT",o="Darwin";function a(){return E.default.type()===A}function c(){return E.default.type()===o}C.isWindows=a,C.isLinux=function(){return"Linux"===E.default.type()},C.isMac=c,C.maxPathLength=function(){return c()?1016:a()?259:4095},function(e){var t=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),r=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),i=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&t(D,u,e);return r(D,u),D};Object.defineProperty(e,"__esModule",{value:!0}),e.WORK_SPACE=e.HVIGOR_PROJECT_WRAPPER_HOME=e.HVIGOR_PROJECT_ROOT_DIR=e.HVIGOR_PROJECT_CACHES_HOME=e.HVIGOR_PNPM_STORE_PATH=e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=e.PROJECT_CACHES=e.HVIGOR_WRAPPER_TOOLS_HOME=e.HVIGOR_USER_HOME=e.DEFAULT_PACKAGE_JSON=e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=e.PNPM=e.HVIGOR=e.NPM_TOOL=e.PNPM_TOOL=e.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const F=i(D),E=i(u),A=C;e.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",e.PNPM_TOOL=(0,A.isWindows)()?"pnpm.cmd":"pnpm",e.NPM_TOOL=(0,A.isWindows)()?"npm.cmd":"npm",e.HVIGOR="hvigor",e.PNPM="pnpm",e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",e.DEFAULT_PACKAGE_JSON="package.json",e.HVIGOR_USER_HOME=E.resolve(F.homedir(),".hvigor"),e.HVIGOR_WRAPPER_TOOLS_HOME=E.resolve(e.HVIGOR_USER_HOME,"wrapper","tools"),e.PROJECT_CACHES="project_caches",e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=E.resolve(e.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",e.PNPM_TOOL),e.HVIGOR_PNPM_STORE_PATH=E.resolve(e.HVIGOR_USER_HOME,"caches"),e.HVIGOR_PROJECT_CACHES_HOME=E.resolve(e.HVIGOR_USER_HOME,e.PROJECT_CACHES),e.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),e.HVIGOR_PROJECT_WRAPPER_HOME=E.resolve(e.HVIGOR_PROJECT_ROOT_DIR,e.HVIGOR),e.WORK_SPACE="workspace"}(i);var s={},l={};Object.defineProperty(l,"__esModule",{value:!0}),l.logInfoPrintConsole=l.logErrorAndExit=void 0,l.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)},l.logInfoPrintConsole=function(u){console.log(u)};var B=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),d=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),f=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&B(D,u,e);return d(D,u),D};Object.defineProperty(s,"__esModule",{value:!0});var _=s.executeBuild=void 0;const p=f(e),O=f(u),h=l;_=s.executeBuild=function(u){const D=O.resolve(u,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const u=p.realpathSync(D);require(u)}catch(e){(0,h.logErrorAndExit)(`Error: ENOENT: no such file ${D},delete ${u} and retry.`)}};var P={},v={};!function(u){var D=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(u,"__esModule",{value:!0}),u.hashFile=u.hash=u.createHash=void 0;const r=D(t),i=D(e);u.createHash=(u="MD5")=>r.default.createHash(u);u.hash=(D,e)=>(0,u.createHash)(e).update(D).digest("hex");u.hashFile=(D,e)=>{if(i.default.existsSync(D))return(0,u.hash)(i.default.readFileSync(D,"utf-8"),e)}}(v);var g={},m={},R={};Object.defineProperty(R,"__esModule",{value:!0}),R.Unicode=void 0;class y{}R.Unicode=y,y.SPACE_SEPARATOR=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,y.ID_START=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,y.ID_CONTINUE=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Object.defineProperty(m,"__esModule",{value:!0}),m.JudgeUtil=void 0;const I=R;m.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&I.Unicode.SPACE_SEPARATOR.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||I.Unicode.ID_START.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||I.Unicode.ID_CONTINUE.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var N=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(g,"__esModule",{value:!0}),g.parseJsonText=g.parseJsonFile=void 0;const b=N(e),S=N(D),w=N(u),H=m;var x;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(x||(x={}));let M,T,V,G,j,J,W="start",U=[],L=0,$=1,k=0,K=!1,z="default",q="'",Z=1;function X(u,D=!1){T=String(u),W="start",U=[],L=0,$=1,k=0,G=void 0,K=D;do{M=Q(),nu[W]()}while("eof"!==M.type);return G}function Q(){for(z="default",j="",q="'",Z=1;;){J=Y();const u=Du[z]();if(u)return u}}function Y(){if(T[L])return String.fromCodePoint(T.codePointAt(L))}function uu(){const u=Y();return"\n"===u?($++,k=0):u?k+=u.length:k++,u&&(L+=u.length),u}g.parseJsonFile=function(u,D=!1,e="utf-8"){const t=b.default.readFileSync(w.default.resolve(u),{encoding:e});try{return X(t,D)}catch(D){if(D instanceof SyntaxError){const e=D.message.split("at");if(2===e.length)throw new Error(`${e[0].trim()}${S.default.EOL}\t at ${u}:${e[1].trim()}`)}throw new Error(`${u} is not in valid JSON/JSON5 format.`)}},g.parseJsonText=X;const Du={default(){switch(J){case"/":return uu(),void(z="comment");case void 0:return uu(),eu("eof")}if(!H.JudgeUtil.isIgnoreChar(J)&&!H.JudgeUtil.isSpaceSeparator(J))return Du[W]();uu()},start(){z="value"},beforePropertyName(){switch(J){case"$":case"_":return j=uu(),void(z="identifierName");case"\\":return uu(),void(z="identifierNameStartEscape");case"}":return eu("punctuator",uu());case'"':case"'":return q=J,uu(),void(z="string")}if(H.JudgeUtil.isIdStartChar(J))return j+=uu(),void(z="identifierName");throw Eu(x.Char,uu())},afterPropertyName(){if(":"===J)return eu("punctuator",uu());throw Eu(x.Char,uu())},beforePropertyValue(){z="value"},afterPropertyValue(){switch(J){case",":case"}":return eu("punctuator",uu())}throw Eu(x.Char,uu())},beforeArrayValue(){if("]"===J)return eu("punctuator",uu());z="value"},afterArrayValue(){switch(J){case",":case"]":return eu("punctuator",uu())}throw Eu(x.Char,uu())},end(){throw Eu(x.Char,uu())},comment(){switch(J){case"*":return uu(),void(z="multiLineComment");case"/":return uu(),void(z="singleLineComment")}throw Eu(x.Char,uu())},multiLineComment(){switch(J){case"*":return uu(),void(z="multiLineCommentAsterisk");case void 0:throw Eu(x.Char,uu())}uu()},multiLineCommentAsterisk(){switch(J){case"*":return void uu();case"/":return uu(),void(z="default");case void 0:throw Eu(x.Char,uu())}uu(),z="multiLineComment"},singleLineComment(){switch(J){case"\n":case"\r":case"\u2028":case"\u2029":return uu(),void(z="default");case void 0:return uu(),eu("eof")}uu()},value(){switch(J){case"{":case"[":return eu("punctuator",uu());case"n":return uu(),tu("ull"),eu("null",null);case"t":return uu(),tu("rue"),eu("boolean",!0);case"f":return uu(),tu("alse"),eu("boolean",!1);case"-":case"+":return"-"===uu()&&(Z=-1),void(z="numerical");case".":case"0":case"I":case"N":return void(z="numerical");case'"':case"'":return q=J,uu(),j="",void(z="string")}if(void 0===J||!H.JudgeUtil.isDigitWithoutZero(J))throw Eu(x.Char,uu());z="numerical"},numerical(){switch(J){case".":return j=uu(),void(z="decimalPointLeading");case"0":return j=uu(),void(z="zero");case"I":return uu(),tu("nfinity"),eu("numeric",Z*(1/0));case"N":return uu(),tu("aN"),eu("numeric",NaN)}if(void 0!==J&&H.JudgeUtil.isDigitWithoutZero(J))return j=uu(),void(z="decimalInteger");throw Eu(x.Char,uu())},zero(){switch(J){case".":case"e":case"E":return void(z="decimal");case"x":case"X":return j+=uu(),void(z="hexadecimal")}return eu("numeric",0)},decimalInteger(){switch(J){case".":case"e":case"E":return void(z="decimal")}if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},decimal(){switch(J){case".":j+=uu(),z="decimalFraction";break;case"e":case"E":j+=uu(),z="decimalExponent"}},decimalPointLeading(){if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalFraction");throw Eu(x.Char,uu())},decimalFraction(){switch(J){case"e":case"E":return j+=uu(),void(z="decimalExponent")}if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},decimalExponent(){switch(J){case"+":case"-":return j+=uu(),void(z="decimalExponentSign")}if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalExponentInteger");throw Eu(x.Char,uu())},decimalExponentSign(){if(H.JudgeUtil.isDigit(J))return j+=uu(),void(z="decimalExponentInteger");throw Eu(x.Char,uu())},decimalExponentInteger(){if(!H.JudgeUtil.isDigit(J))return eu("numeric",Z*Number(j));j+=uu()},hexadecimal(){if(H.JudgeUtil.isHexDigit(J))return j+=uu(),void(z="hexadecimalInteger");throw Eu(x.Char,uu())},hexadecimalInteger(){if(!H.JudgeUtil.isHexDigit(J))return eu("numeric",Z*Number(j));j+=uu()},identifierNameStartEscape(){if("u"!==J)throw Eu(x.Char,uu());uu();const u=ru();switch(u){case"$":case"_":break;default:if(!H.JudgeUtil.isIdStartChar(u))throw Eu(x.Identifier)}j+=u,z="identifierName"},identifierName(){switch(J){case"$":case"_":case"‌":case"‍":return void(j+=uu());case"\\":return uu(),void(z="identifierNameEscape")}if(!H.JudgeUtil.isIdContinueChar(J))return eu("identifier",j);j+=uu()},identifierNameEscape(){if("u"!==J)throw Eu(x.Char,uu());uu();const u=ru();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!H.JudgeUtil.isIdContinueChar(u))throw Eu(x.Identifier)}j+=u,z="identifierName"},string(){switch(J){case"\\":return uu(),void(j+=function(){const u=Y(),D=function(){switch(Y()){case"b":return uu(),"\b";case"f":return uu(),"\f";case"n":return uu(),"\n";case"r":return uu(),"\r";case"t":return uu(),"\t";case"v":return uu(),"\v"}return}();if(D)return D;switch(u){case"0":if(uu(),H.JudgeUtil.isDigit(Y()))throw Eu(x.Char,uu());return"\0";case"x":return uu(),function(){let u="",D=Y();if(!H.JudgeUtil.isHexDigit(D))throw Eu(x.Char,uu());if(u+=uu(),D=Y(),!H.JudgeUtil.isHexDigit(D))throw Eu(x.Char,uu());return u+=uu(),String.fromCodePoint(parseInt(u,16))}();case"u":return uu(),ru();case"\n":case"\u2028":case"\u2029":return uu(),"";case"\r":return uu(),"\n"===Y()&&uu(),""}if(void 0===u||H.JudgeUtil.isDigitWithoutZero(u))throw Eu(x.Char,uu());return uu()}());case'"':case"'":if(J===q){const u=eu("string",j);return uu(),u}return void(j+=uu());case"\n":case"\r":case void 0:throw Eu(x.Char,uu());case"\u2028":case"\u2029":!function(u){console.warn(`JSON5: '${Fu(u)}' in strings is not valid ECMAScript; consider escaping.`)}(J)}j+=uu()}};function eu(u,D){return{type:u,value:D,line:$,column:k}}function tu(u){for(const D of u){if(Y()!==D)throw Eu(x.Char,uu());uu()}}function ru(){let u="",D=4;for(;D-- >0;){const D=Y();if(!H.JudgeUtil.isHexDigit(D))throw Eu(x.Char,uu());u+=uu()}return String.fromCodePoint(parseInt(u,16))}const nu={start(){if("eof"===M.type)throw Eu(x.EOF);iu()},beforePropertyName(){switch(M.type){case"identifier":case"string":return V=M.value,void(W="afterPropertyName");case"punctuator":return void Cu();case"eof":throw Eu(x.EOF)}},afterPropertyName(){if("eof"===M.type)throw Eu(x.EOF);W="beforePropertyValue"},beforePropertyValue(){if("eof"===M.type)throw Eu(x.EOF);iu()},afterPropertyValue(){if("eof"===M.type)throw Eu(x.EOF);switch(M.value){case",":return void(W="beforePropertyName");case"}":Cu()}},beforeArrayValue(){if("eof"===M.type)throw Eu(x.EOF);"punctuator"!==M.type||"]"!==M.value?iu():Cu()},afterArrayValue(){if("eof"===M.type)throw Eu(x.EOF);switch(M.value){case",":return void(W="beforeArrayValue");case"]":Cu()}},end(){}};function iu(){const u=function(){let u;switch(M.type){case"punctuator":switch(M.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=M.value}return u}();if(K&&"object"==typeof u&&(u._line=$,u._column=k),void 0===G)G=u;else{const D=U[U.length-1];Array.isArray(D)?K&&"object"!=typeof u?D.push({value:u,_line:$,_column:k}):D.push(u):D[V]=K&&"object"!=typeof u?{value:u,_line:$,_column:k}:u}!function(u){if(u&&"object"==typeof u)U.push(u),W=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=U[U.length-1];W=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Cu(){U.pop();const u=U[U.length-1];W=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function Fu(u){const D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){const D=u.charCodeAt(0).toString(16);return`\\x${`00${D}`.substring(D.length)}`}return u}function Eu(u,D){let e="";switch(u){case x.Char:e=void 0===D?`JSON5: invalid end of input at ${$}:${k}`:`JSON5: invalid character '${Fu(D)}' at ${$}:${k}`;break;case x.EOF:e=`JSON5: invalid end of input at ${$}:${k}`;break;case x.Identifier:k-=5,e=`JSON5: invalid identifier character at ${$}:${k}`}const t=new Au(e);return t.lineNumber=$,t.columnNumber=k,t}class Au extends SyntaxError{}var ou={},au=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),cu=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),su=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&au(D,u,e);return cu(D,u),D},lu=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(ou,"__esModule",{value:!0}),ou.isFileExists=ou.offlinePluginConversion=ou.executeCommand=ou.getNpmPath=ou.hasNpmPackInPaths=void 0;const Bu=r,du=lu(e),fu=su(u),_u=i,pu=l;ou.hasNpmPackInPaths=function(u,D){try{return require.resolve(u,{paths:[...D]}),!0}catch(u){return!1}},ou.getNpmPath=function(){const u=process.execPath;return fu.join(fu.dirname(u),_u.NPM_TOOL)},ou.executeCommand=function(u,D,e){0!==(0,Bu.spawnSync)(u,D,e).status&&(0,pu.logErrorAndExit)(`Error: ${u} ${D} execute failed.See above for details.`)},ou.offlinePluginConversion=function(u,D){return D.startsWith("file:")||D.endsWith(".tgz")?fu.resolve(u,_u.HVIGOR,D.replace("file:","")):D},ou.isFileExists=function(u){return du.default.existsSync(u)&&du.default.statSync(u).isFile()};var Ou=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),hu=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),Pu=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&Ou(D,u,e);return hu(D,u),D},vu=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(P,"__esModule",{value:!0});var gu=P.initProjectWorkSpace=void 0;const mu=Pu(e),Ru=vu(D),yu=Pu(u),Iu=v,Nu=i,bu=g,Su=l,wu=ou;let Hu,xu,Mu;function Tu(u,D,e){return void 0!==e.dependencies&&(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,D.dependencies[u])===yu.normalize(e.dependencies[u])}function Vu(){const u=yu.join(Mu,Nu.WORK_SPACE);if((0,Su.logInfoPrintConsole)("Hvigor cleaning..."),!mu.existsSync(u))return;const D=mu.readdirSync(u);if(!D||0===D.length)return;const e=yu.resolve(Mu,"node_modules","@ohos","hvigor","bin","hvigor.js");mu.existsSync(e)&&(0,wu.executeCommand)(process.argv[0],[e,"--stop-daemon"],{});try{D.forEach((D=>{mu.rmSync(yu.resolve(u,D),{recursive:!0})}))}catch(D){(0,Su.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${u}.`)}}gu=P.initProjectWorkSpace=function(){if(Hu=function(){const u=yu.resolve(Nu.HVIGOR_PROJECT_WRAPPER_HOME,Nu.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);mu.existsSync(u)||(0,Su.logErrorAndExit)(`Error: Hvigor config file ${u} does not exist.`);return(0,bu.parseJsonFile)(u)}(),Mu=function(u){let D;D=function(u){let D=u.hvigorVersion;if(D.startsWith("file:")||D.endsWith(".tgz"))return!1;const e=u.dependencies,t=Object.getOwnPropertyNames(e);for(const u of t){const D=e[u];if(D.startsWith("file:")||D.endsWith(".tgz"))return!1}if(1===t.length&&"@ohos/hvigor-ohos-plugin"===t[0])return D>"2.5.0";return!1}(u)?function(u){let D=`${Nu.HVIGOR_ENGINE_PACKAGE_NAME}@${u.hvigorVersion}`;const e=u.dependencies;if(e){Object.getOwnPropertyNames(e).sort().forEach((u=>{D+=`,${u}@${e[u]}`}))}return(0,Iu.hash)(D)}(u):(0,Iu.hash)(process.cwd());return yu.resolve(Ru.default.homedir(),".hvigor","project_caches",D)}(Hu),xu=function(){const u=yu.resolve(Mu,Nu.WORK_SPACE,Nu.DEFAULT_PACKAGE_JSON);return mu.existsSync(u)?(0,bu.parseJsonFile)(u):{dependencies:{}}}(),!(0,wu.hasNpmPackInPaths)(Nu.HVIGOR_ENGINE_PACKAGE_NAME,[yu.join(Mu,Nu.WORK_SPACE)])||(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,Hu.hvigorVersion)!==xu.dependencies[Nu.HVIGOR_ENGINE_PACKAGE_NAME]||!function(){function u(u){const D=null==u?void 0:u.dependencies;return void 0===D?0:Object.getOwnPropertyNames(D).length}const D=u(Hu),e=u(xu);if(D+1!==e)return!1;for(const u in null==Hu?void 0:Hu.dependencies)if(!(0,wu.hasNpmPackInPaths)(u,[yu.join(Mu,Nu.WORK_SPACE)])||!Tu(u,Hu,xu))return!1;return!0}()){Vu();try{!function(){(0,Su.logInfoPrintConsole)("Hvigor installing...");for(const u in Hu.dependencies)Hu.dependencies[u]&&(Hu.dependencies[u]=(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,Hu.dependencies[u]));const u={dependencies:{...Hu.dependencies}};u.dependencies[Nu.HVIGOR_ENGINE_PACKAGE_NAME]=(0,wu.offlinePluginConversion)(Nu.HVIGOR_PROJECT_ROOT_DIR,Hu.hvigorVersion);const D=yu.join(Mu,Nu.WORK_SPACE);try{mu.mkdirSync(D,{recursive:!0});const e=yu.resolve(D,Nu.DEFAULT_PACKAGE_JSON);mu.writeFileSync(e,JSON.stringify(u))}catch(u){(0,Su.logErrorAndExit)(u)}(function(){const u=["config","set","store-dir",Nu.HVIGOR_PNPM_STORE_PATH],D={cwd:yu.join(Mu,Nu.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,wu.executeCommand)(Nu.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,D)})(),function(){const u=["install"],D={cwd:yu.join(Mu,Nu.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,wu.executeCommand)(Nu.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,D)}(),(0,Su.logInfoPrintConsole)("Hvigor install success.")}()}catch(u){Vu()}}return Mu};var Gu={};!function(t){var C=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),F=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),E=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&C(D,u,e);return F(D,u),D},A=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.executeInstallPnpm=t.isPnpmInstalled=t.environmentHandler=t.checkNpmConifg=t.PNPM_VERSION=void 0;const o=r,a=E(e),c=A(D),s=E(u),B=i,d=l,f=ou;t.PNPM_VERSION="7.30.0",t.checkNpmConifg=function(){const u=s.resolve(B.HVIGOR_PROJECT_ROOT_DIR,".npmrc"),D=s.resolve(c.default.homedir(),".npmrc");if((0,f.isFileExists)(u)||(0,f.isFileExists)(D))return;const e=(0,f.getNpmPath)(),t=(0,o.spawnSync)(e,["config","get","prefix"],{cwd:B.HVIGOR_PROJECT_ROOT_DIR});if(0!==t.status||!t.stdout)return void(0,d.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");const r=s.resolve(`${t.stdout}`.replace(/[\r\n]/gi,""),".npmrc");(0,f.isFileExists)(r)||(0,d.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.")},t.environmentHandler=function(){process.env["npm_config_update-notifier"]="false"},t.isPnpmInstalled=function(){return!!a.existsSync(B.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,f.hasNpmPackInPaths)("pnpm",[B.HVIGOR_WRAPPER_TOOLS_HOME])},t.executeInstallPnpm=function(){(0,d.logInfoPrintConsole)(`Installing pnpm@${t.PNPM_VERSION}...`);const u=(0,f.getNpmPath)();!function(){const u=s.resolve(B.HVIGOR_WRAPPER_TOOLS_HOME,B.DEFAULT_PACKAGE_JSON);try{a.existsSync(B.HVIGOR_WRAPPER_TOOLS_HOME)||a.mkdirSync(B.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const D={dependencies:{}};D.dependencies[B.PNPM]=t.PNPM_VERSION,a.writeFileSync(u,JSON.stringify(D))}catch(D){(0,d.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,f.executeCommand)(u,["install","pnpm"],{cwd:B.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"],env:process.env}),(0,d.logInfoPrintConsole)("Pnpm install success.")}}(Gu),function(){Gu.checkNpmConifg(),Gu.environmentHandler(),Gu.isPnpmInstalled()||Gu.executeInstallPnpm();const D=gu();_(u.join(D,i.WORK_SPACE))}(); \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/hvigorfile.ts b/function/communication/bluetooth/sockettest/hvigorfile.ts new file mode 100644 index 00000000..804bc346 --- /dev/null +++ b/function/communication/bluetooth/sockettest/hvigorfile.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { appTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/function/communication/bluetooth/sockettest/hvigorw b/function/communication/bluetooth/sockettest/hvigorw new file mode 100644 index 00000000..acf5b015 --- /dev/null +++ b/function/communication/bluetooth/sockettest/hvigorw @@ -0,0 +1,69 @@ +#/* +# * Copyright (c) 2024 Huawei Device Co., Ltd. +# * Licensed under the Apache License, Version 2.0 (the "License"); +# * you may not use this file except in compliance with the License. +# * You may obtain a copy of the License at +# * +# * http://www.apache.org/licenses/LICENSE-2.0 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# */ + +#!/bin/bash + +# ---------------------------------------------------------------------------- +# Hvigor startup script, version 1.0.0 +# +# Required ENV vars: +# ------------------ +# NODE_HOME - location of a Node home dir +# or +# Add /usr/local/nodejs/bin to the PATH environment variable +# ---------------------------------------------------------------------------- + +HVIGOR_APP_HOME="`pwd -P`" +HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js +#NODE_OPTS="--max-old-space-size=4096" + +fail() { + echo "$*" + exit 1 +} + +set_executable_node() { + EXECUTABLE_NODE="${NODE_HOME}/bin/node" + if [ -x "$EXECUTABLE_NODE" ]; then + return + fi + + EXECUTABLE_NODE="${NODE_HOME}/node" + if [ -x "$EXECUTABLE_NODE" ]; then + return + fi + fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed" +} + +# Determine node to start hvigor wrapper script +if [ -n "${NODE_HOME}" ]; then + set_executable_node +else + EXECUTABLE_NODE="node" + command -v ${EXECUTABLE_NODE} &> /dev/null || fail "ERROR: NODE_HOME not set and 'node' command not found" +fi + +# Check hvigor wrapper script +if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ]; then + fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}" +fi + +if [ -z "${NODE_OPTS}" ]; then + NODE_OPTS="--" +fi + +# start hvigor-wrapper script +exec "${EXECUTABLE_NODE}" "${NODE_OPTS}" \ + "${HVIGOR_WRAPPER_SCRIPT}" "$@" diff --git a/function/communication/bluetooth/sockettest/hvigorw.bat b/function/communication/bluetooth/sockettest/hvigorw.bat new file mode 100644 index 00000000..4e5a54e9 --- /dev/null +++ b/function/communication/bluetooth/sockettest/hvigorw.bat @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@rem +@rem ---------------------------------------------------------------------------- +@rem Hvigor startup script for Windows, version 1.0.0 +@rem +@rem Required ENV vars: +@rem ------------------ +@rem NODE_HOME - location of a Node home dir +@rem or +@rem Add %NODE_HOME%/bin to the PATH environment variable +@rem ---------------------------------------------------------------------------- +@rem +@echo off + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js +set NODE_EXE=node.exe +@rem set NODE_OPTS="--max-old-space-size=4096" + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +if not defined NODE_OPTS set NODE_OPTS="--" + +@rem Find node.exe +if defined NODE_HOME ( + set NODE_HOME=%NODE_HOME:"=% + set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE% +) + +%NODE_EXE% --version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" ( + "%NODE_EXE%" "%NODE_OPTS%" "%WRAPPER_MODULE_PATH%" %* +) else if exist "%NODE_EXE_PATH%" ( + "%NODE_EXE%" "%NODE_OPTS%" "%WRAPPER_MODULE_PATH%" %* +) else ( + echo. + echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. + echo. + echo Please set the NODE_HOME variable in your environment to match the + echo location of your NodeJs installation. +) + +if "%ERRORLEVEL%" == "0" ( + if "%OS%" == "Windows_NT" endlocal +) else ( + exit /b %ERRORLEVEL% +) \ No newline at end of file diff --git a/function/communication/bluetooth/sockettest/oh-package.json5 b/function/communication/bluetooth/sockettest/oh-package.json5 new file mode 100644 index 00000000..0855fb4b --- /dev/null +++ b/function/communication/bluetooth/sockettest/oh-package.json5 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "name": "bluetoothsocket", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.13", + "@ohos/hamock": "1.0.0" + } +} -- Gitee From 1b962110b9aa7fb82f9f0830080d705491b6b372 Mon Sep 17 00:00:00 2001 From: zhangmenghan Date: Tue, 3 Dec 2024 08:58:39 +0800 Subject: [PATCH 6/6] add sockettest Signed-off-by: zhangmenghan --- function/communication/bluetooth/sockettest/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/function/communication/bluetooth/sockettest/README.md b/function/communication/bluetooth/sockettest/README.md index 50ed720a..e71b0be6 100644 --- a/function/communication/bluetooth/sockettest/README.md +++ b/function/communication/bluetooth/sockettest/README.md @@ -21,7 +21,7 @@ ets image.png -客户端传送次数和包长度可供选择,每次传输 102 个包,包中数组元素为 0-101,如第一个包中元素皆为 0,长度为应用界面规定长度,以此类推,客户端计算发包 1~100 的发包的发包个数和长度,共发送字节为收到的长度的累加。在以上数据发送完毕后,再发送一个首个元素为 199 的数组表示发送完毕。 +客户端传送次数和包长度可供选择,每次传输 102 个包,包中数组元素为 0-101,如第一个包中元素皆为 0,长度为应用界面规定长度,以此类推,客户端计算发包 1~100 的发包的发包个数和长度,共发送字节为收到的长度的累加。在以上数据发送完毕后,再发送一个元素为 199 的数组表示发送完毕。 服务端接收数据流程如下图所示。 -- Gitee