From 5d53e73ee2cc2e11feeb3bf4c16415b00ccba1a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E9=9B=AA=E8=8E=B9?= <1799939623@qq.com> Date: Wed, 3 Sep 2025 16:42:14 +0800 Subject: [PATCH 1/5] AI checked faq --- LocationKit/entry/src/main/ets/pages/FaultLog.ets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LocationKit/entry/src/main/ets/pages/FaultLog.ets b/LocationKit/entry/src/main/ets/pages/FaultLog.ets index bd155b23..7be8152d 100644 --- a/LocationKit/entry/src/main/ets/pages/FaultLog.ets +++ b/LocationKit/entry/src/main/ets/pages/FaultLog.ets @@ -24,7 +24,7 @@ import { AbilityConstant, common } from '@kit.AbilityKit'; import { preferences } from '@kit.ArkData'; import { BusinessError } from '@kit.BasicServicesKit'; -const TAG: string = 'testTag'; +const TAG: string = 'FaultLoggerUtils'; export class LogUtils { static async queryAndUploadFaultLog(context: common.UIAbilityContext, launchParam: AbilityConstant.LaunchParam) { -- Gitee From cf01e9f93689ccd81e871a9cc655e913225b6c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E9=9B=AA=E8=8E=B9?= <1799939623@qq.com> Date: Thu, 4 Sep 2025 10:03:22 +0800 Subject: [PATCH 2/5] AI checked faq --- LocationKit/entry/src/main/ets/pages/ReadByte.ets | 3 ++- LocationKit/entry/src/main/ets/pages/SaveToUser.ets | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/LocationKit/entry/src/main/ets/pages/ReadByte.ets b/LocationKit/entry/src/main/ets/pages/ReadByte.ets index c3418a82..f42e6010 100644 --- a/LocationKit/entry/src/main/ets/pages/ReadByte.ets +++ b/LocationKit/entry/src/main/ets/pages/ReadByte.ets @@ -21,9 +21,10 @@ @Component export struct ArrayBufferConversionArray { @State fileLength: number = 10; - tempData: number[] = []; + private tempData: number[] = []; aboutToAppear(): void { + // Convert ArrayBuffer to a number array let arrayBuffer: ArrayBuffer = new ArrayBuffer(this.fileLength); let dataView: DataView = new DataView(arrayBuffer); for (let index = 0; index < this.fileLength; index++) { diff --git a/LocationKit/entry/src/main/ets/pages/SaveToUser.ets b/LocationKit/entry/src/main/ets/pages/SaveToUser.ets index cbd3c6ed..e35e6af8 100644 --- a/LocationKit/entry/src/main/ets/pages/SaveToUser.ets +++ b/LocationKit/entry/src/main/ets/pages/SaveToUser.ets @@ -23,17 +23,17 @@ import { picker, fileIo } from '@kit.CoreFileKit'; let uri: string = ''; -// 将content至公共目录 +// Save content to the public directory export async function saveToUser(content: string) { try { let DocumentSaveOptions = new picker.DocumentSaveOptions(); - // 新建文件名 + // New file name DocumentSaveOptions.newFileNames = ['test.txt']; let documentPicker = new picker.DocumentViewPicker(); documentPicker.save(DocumentSaveOptions).then((DocumentSaveResult: Array) => { console.info('DocumentViewPicker.save successfully, uri: ' + JSON.stringify(DocumentSaveResult)); uri = DocumentSaveResult[0]; - // 将content写入新建的文件内 + // Write the content into the newly created file let file = fileIo.openSync(uri, fileIo.OpenMode.READ_WRITE); fileIo.writeSync(file.fd, content); }).catch((err: BusinessError) => { -- Gitee From 0bc413f4f11a41f049e0517f12d271e16f2bfe03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E9=9B=AA=E8=8E=B9?= <1799939623@qq.com> Date: Sat, 6 Sep 2025 16:08:27 +0800 Subject: [PATCH 3/5] fixed AI check faq --- CoreFileKit/entry/src/main/ets/pages/GetRawfile.ets | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CoreFileKit/entry/src/main/ets/pages/GetRawfile.ets b/CoreFileKit/entry/src/main/ets/pages/GetRawfile.ets index d9219e14..24d8b22a 100644 --- a/CoreFileKit/entry/src/main/ets/pages/GetRawfile.ets +++ b/CoreFileKit/entry/src/main/ets/pages/GetRawfile.ets @@ -26,12 +26,17 @@ export struct GetRawfile { aboutToAppear(): void { this.getUIContext().getHostContext()?.resourceManager.getRawFileContent('test.txt', (_err, value) => { - let myBuffer: ArrayBufferLike = value.buffer; - let context = this.getUIContext().getHostContext(); //Sandbox Path + if (_err) { + console.error('Failed to get raw file:', _err); + return; + } + let fileBuffer: ArrayBufferLike = value.buffer; + let context = this.getUIContext() + .getHostContext(); // Obtain the application sandbox path for storing temporary files, and perform null checking let filePath = context!.filesDir + '/test.txt'; console.info('testTag-filePath:' + filePath); let file = fileIo.openSync(filePath, fileIo.OpenMode.READ_WRITE | fileIo.OpenMode.CREATE); - let writeLen = fileIo.writeSync(file.fd, myBuffer); + let writeLen = fileIo.writeSync(file.fd, fileBuffer); console.info('testTag-write data to file succeed and size is:' + writeLen); fileIo.closeSync(file); }); @@ -52,4 +57,5 @@ export struct GetRawfile { .width('100%') } } + // [End GetRawfile] \ No newline at end of file -- Gitee From 6d537fd955511087f47cf648984d1e3792a1a465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E9=9B=AA=E8=8E=B9?= <1799939623@qq.com> Date: Sat, 6 Sep 2025 16:14:07 +0800 Subject: [PATCH 4/5] AI checked faq --- LocationKit/entry/src/main/ets/pages/ParametersCheck.ets | 1 + 1 file changed, 1 insertion(+) diff --git a/LocationKit/entry/src/main/ets/pages/ParametersCheck.ets b/LocationKit/entry/src/main/ets/pages/ParametersCheck.ets index 5305eded..177e0c27 100644 --- a/LocationKit/entry/src/main/ets/pages/ParametersCheck.ets +++ b/LocationKit/entry/src/main/ets/pages/ParametersCheck.ets @@ -24,6 +24,7 @@ export class ParametersCheck { // [Start ParametersCheck] public static timelineReceivedResult(path: string): void { if (!path) { + console.error('Invoke empty file path') return; } let filename = path.substring(path.lastIndexOf("/") + 1); -- Gitee From 3b599935379b5185081198414f1329037ff5d737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E9=9B=AA=E8=8E=B9?= <1799939623@qq.com> Date: Mon, 8 Sep 2025 09:44:48 +0800 Subject: [PATCH 5/5] =?UTF-8?q?DTS=20=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entry/src/main/ets/pages/RcpConfig.ets | 20 ++++++++++--------- .../main/resources/base/element/string.json | 4 ++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/RemoteCommunication/entry/src/main/ets/pages/RcpConfig.ets b/RemoteCommunication/entry/src/main/ets/pages/RcpConfig.ets index 531bafae..f882d4a5 100644 --- a/RemoteCommunication/entry/src/main/ets/pages/RcpConfig.ets +++ b/RemoteCommunication/entry/src/main/ets/pages/RcpConfig.ets @@ -21,14 +21,14 @@ import { rcp } from '@kit.RemoteCommunicationKit'; const sessionConfig: rcp.SessionConfiguration = { - //用于指定与会话关联的HTTP请求的配置 + // Used to specify the configuration of HTTP requests associated with the session requestConfiguration: { transfer: { - //超时时间参数设置 + // Timeout parameter setting timeout: { - //连接超时,默认值是60000 + // The connection has timed out. The default value is 60,000 connectMs: 5000, - //传输超时,默认值是60000 + // Transmission timeout, with the default value being 60,000 transferMs: 10000, }, } @@ -42,14 +42,16 @@ export struct SetTimeout { build() { Row() { Column() { - Button('超时时间参数设置') + Button($r('app.string.timeout_parameter_setting')) .onClick(() => { if (session) { - console.log('创建session成功') - console.log('连接超时参数设置:', sessionConfig.requestConfiguration?.transfer?.timeout?.connectMs); - console.log('传输超时参数设置:', sessionConfig.requestConfiguration?.transfer?.timeout?.transferMs); + console.log('Created session successful!') + console.log('Connection timeout parameter settings:', + sessionConfig.requestConfiguration?.transfer?.timeout?.connectMs); + console.log('Transmission timeout parameters settings:', + sessionConfig.requestConfiguration?.transfer?.timeout?.transferMs); } else { - console.log('创建session失败'); + console.log('Created session failure!'); } }) } diff --git a/RemoteCommunication/entry/src/main/resources/base/element/string.json b/RemoteCommunication/entry/src/main/resources/base/element/string.json index f9459551..99959a54 100644 --- a/RemoteCommunication/entry/src/main/resources/base/element/string.json +++ b/RemoteCommunication/entry/src/main/resources/base/element/string.json @@ -11,6 +11,10 @@ { "name": "EntryAbility_label", "value": "label" + }, + { + "name": "timeout_parameter_setting", + "value": "Timeout parameter setting" } ] } \ No newline at end of file -- Gitee