diff --git a/en/application-dev/connectivity/figures/IPC_RPC_communication.PNG b/en/application-dev/connectivity/figures/IPC_RPC_communication.PNG new file mode 100644 index 0000000000000000000000000000000000000000..63f193ade7b3932279295641a5612bc5720befef Binary files /dev/null and b/en/application-dev/connectivity/figures/IPC_RPC_communication.PNG differ diff --git a/en/application-dev/device/usb-guidelines.md b/en/application-dev/device/usb-guidelines.md index 14a7901232865ef8cf9acee55441f92bea0e4f73..64eee37cf1f0e34a58f5805d13be4cec77cb1498 100644 --- a/en/application-dev/device/usb-guidelines.md +++ b/en/application-dev/device/usb-guidelines.md @@ -20,13 +20,13 @@ The following table lists the USB APIs currently available. For details, see the | getDevices(): Array> | Obtains the list of USB devices connected to the USB host. If no USB device is connected, an empty list is returned. | | setConfiguration(pipe: USBDevicePipe, config: USBConfig): number | Sets the USB device configuration. | | setInterface(pipe: USBDevicePipe, iface: USBInterface): number | Sets a USB interface. | -| claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number | Claims a USB interface. | -| bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, timeout?: number): Promise\ | Performs bulk transfer. | +| claimInterface(pipe: USBDevicePipe, iface: USBInterface, force ?: boolean): number | Claims a USB interface. | +| bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, timeout ?: number): Promise\ | Performs bulk transfer. | | closePipe(pipe: USBDevicePipe): number | Closes a USB device pipe. | | releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number | Releases a USB interface. | | getFileDescriptor(pipe: USBDevicePipe): number | Obtains the file descriptor. | | getRawDescriptor(pipe: USBDevicePipe): Uint8Array | Obtains the raw USB descriptor. | -| controlTransfer(pipe: USBDevicePipe, contrlparam: USBControlParams, timeout?: number): Promise\ | Performs control transfer. | +| controlTransfer(pipe: USBDevicePipe, contrlparam: USBControlParams, timeout ?: number): Promise\ | Performs control transfer. | ## How to Develop @@ -51,7 +51,7 @@ You can set a USB device as the USB host to connect to other USB devices for dat vendorId: 7531, productId: 2, clazz: 9, - subclass: 0, + subClass: 0, protocol: 1, devAddress: 1, busNum: 1, @@ -68,7 +68,7 @@ You can set a USB device as the USB host to connect to other USB devices for dat id: 0, protocol: 0, clazz: 9, - subclass: 0, + subClass: 0, alternateSetting: 0, name: "1-1", endpoints: [ @@ -108,7 +108,7 @@ You can set a USB device as the USB host to connect to other USB devices for dat ```js // Open the device, and obtain the USB device pipe for data transfer. - let pipe = usb.connectDevice(deviceList[0]); + let interface1 = deviceList[0].configs[0].interfaces[0]; /* Claim the corresponding interface from deviceList. interface1 must be one present in the device configuration. @@ -123,28 +123,30 @@ You can set a USB device as the USB host to connect to other USB devices for dat Read data. Select the corresponding RX endpoint from deviceList for data transfer. (endpoint.direction == 0x80); dataUint8Array indicates the data to read. The data type is Uint8Array. */ - - usb.bulkTransfer(pipe, inEndpoint, dataUint8Array, 15000).then(dataLength => { - if (dataLength >= 0) { - console.info("usb readData result Length : " + dataLength); - let resultStr = this.ab2str(dataUint8Array); // Convert uint8 data into a string. - console.info("usb readData buffer : " + resultStr); - } else { - console.info("usb readData failed : " + dataLength); - } - }).catch(error => { - console.info("usb readData error : " + JSON.stringify(error)); - }); - // Send data. Select the corresponding TX endpoint from deviceList for data transfer. (endpoint.direction == 0) - usb.bulkTransfer(pipe, endpoint, dataUint8Array, 15000).then(dataLength => { - if (dataLength >= 0) { - console.info("usb writeData result write length : " + dataLength); - } else { - console.info("writeData failed"); - } - }).catch(error => { - console.info("usb writeData error : " + JSON.stringify(error)); - }); + let inEndpoint = interface1.endpoints[2]; + let outEndpoint = interface1.endpoints[1]; + let dataUint8Array = new Uint8Array(1024); + usb.bulkTransfer(pipe, inEndpoint, dataUint8Array, 15000).then(dataLength => { + if (dataLength >= 0) { + console.info("usb readData result Length : " + dataLength); + let resultStr = this.ab2str(dataUint8Array); // Convert uint8 data into a string. + console.info("usb readData buffer : " + resultStr); + } else { + console.info("usb readData failed : " + dataLength); + } + }).catch(error => { + console.info("usb readData error : " + JSON.stringify(error)); + }); + // Send data. Select the corresponding TX endpoint from deviceList for data transfer. (endpoint.direction == 0) + usb.bulkTransfer(pipe, outEndpoint, dataUint8Array, 15000).then(dataLength => { + if (dataLength >= 0) { + console.info("usb writeData result write length : " + dataLength); + } else { + console.info("writeData failed"); + } + }).catch(error => { + console.info("usb writeData error : " + JSON.stringify(error)); + }); ``` 5. Release the USB interface, and close the USB device. diff --git a/en/application-dev/reference/apis/js-apis-inputevent.md b/en/application-dev/reference/apis/js-apis-inputevent.md index d2d55fa57ee6bd71288d03aa3f42e24bebb80bea..d018dd4d9f09add2fe50458f982a99436327acf2 100644 --- a/en/application-dev/reference/apis/js-apis-inputevent.md +++ b/en/application-dev/reference/apis/js-apis-inputevent.md @@ -13,6 +13,8 @@ import InputEvent from '@ohos.multimodalInput.inputEvent'; ## InputEvent +Defines an input event. + **System capability**: SystemCapability.MultimodalInput.Input.Core **Parameters** diff --git a/en/application-dev/reference/apis/js-apis-inputmonitor.md b/en/application-dev/reference/apis/js-apis-inputmonitor.md index 304fa76946de0e4279be5095bd1dae46f79c7ca6..d6514f42799102b15c8e20a978fe71494c281dfd 100644 --- a/en/application-dev/reference/apis/js-apis-inputmonitor.md +++ b/en/application-dev/reference/apis/js-apis-inputmonitor.md @@ -203,9 +203,8 @@ try { inputMonitor.on("touch", touchEvent => { if (touchEvent.touches.length == 3) {// Three fingers are pressed. return true; - } else { - return false; } + return false; }); } catch (error) { console.log(`Monitor on failed, error: ${JSON.stringify(error, [`code`, `message`])}`); diff --git a/en/application-dev/reference/apis/js-apis-keycode.md b/en/application-dev/reference/apis/js-apis-keycode.md index e69775942629948eab964f4f91795ddfe7dfeda7..77aa1fe74381a79a6edf3a787da788f1491dc644 100644 --- a/en/application-dev/reference/apis/js-apis-keycode.md +++ b/en/application-dev/reference/apis/js-apis-keycode.md @@ -14,6 +14,8 @@ import {KeyCode} from '@ohos.multimodalInput.keyCode'; ## KeyCode +Enumerates keycodes. + **System capability**: SystemCapability.MultimodalInput.Input.Core | Name | Value | Description | diff --git a/en/application-dev/reference/apis/js-apis-keyevent.md b/en/application-dev/reference/apis/js-apis-keyevent.md index 32c18a558572b8f971b8faf6277c3300e86f9649..75b857b9fb89599280c11008347145061509bbff 100644 --- a/en/application-dev/reference/apis/js-apis-keyevent.md +++ b/en/application-dev/reference/apis/js-apis-keyevent.md @@ -13,6 +13,8 @@ import {Action, Key, KeyEvent} from '@ohos.multimodalInput.keyEvent'; ## Action +Defines a key action. + **System capability**: SystemCapability.MultimodalInput.Input.Core | Name | Value | Description | @@ -23,6 +25,8 @@ import {Action, Key, KeyEvent} from '@ohos.multimodalInput.keyEvent'; ## Key +Defines a key. + **System capability**: SystemCapability.MultimodalInput.Input.Core | Name | Type| Readable| Writable| Description | @@ -33,6 +37,8 @@ import {Action, Key, KeyEvent} from '@ohos.multimodalInput.keyEvent'; ## KeyEvent +Defines a key event. + **System capability**: SystemCapability.MultimodalInput.Input.Core | Name | Type| Readable| Writable| Description | diff --git a/en/application-dev/reference/apis/js-apis-mouseevent.md b/en/application-dev/reference/apis/js-apis-mouseevent.md index 92935d6f31e788eb0b71ec6529fbc94264e3d8d1..6ed09f828cec12108e3833b258fe70eb1ab416ad 100644 --- a/en/application-dev/reference/apis/js-apis-mouseevent.md +++ b/en/application-dev/reference/apis/js-apis-mouseevent.md @@ -13,6 +13,8 @@ import { Action, Button, Axis, AxisValue, MouseEvent } from '@ohos.multimodalInp ## Action +Defines a mouse action. + **System capability**: SystemCapability.MultimodalInput.Input.Core | Name | Value| Description | @@ -28,6 +30,8 @@ import { Action, Button, Axis, AxisValue, MouseEvent } from '@ohos.multimodalInp ## Button +Enumerates mouse actions. + **System capability**: SystemCapability.MultimodalInput.Input.Core | Name | Value | Description | @@ -43,6 +47,8 @@ import { Action, Button, Axis, AxisValue, MouseEvent } from '@ohos.multimodalInp ## Axis +Enumerates mouse axis types. + **System capability**: SystemCapability.MultimodalInput.Input.Core | Name | Value | Description | @@ -54,6 +60,8 @@ import { Action, Button, Axis, AxisValue, MouseEvent } from '@ohos.multimodalInp ## AxisValue +Defines a mouse axis type and value. + **System capability**: SystemCapability.MultimodalInput.Input.Core | Name | Type | Readable | Writable | Description | @@ -64,6 +72,8 @@ import { Action, Button, Axis, AxisValue, MouseEvent } from '@ohos.multimodalInp ## MouseEvent +Defines a mouse event. + **System capability**: SystemCapability.MultimodalInput.Input.Core | Name | Type | Readable | Writable | Description | diff --git a/en/application-dev/reference/apis/js-apis-power.md b/en/application-dev/reference/apis/js-apis-power.md index 4dc07d44197a78f01cb3e9018293cc1da88bea38..625f189f877a620b2238d3cb048ce314f6a2af03 100644 --- a/en/application-dev/reference/apis/js-apis-power.md +++ b/en/application-dev/reference/apis/js-apis-power.md @@ -87,7 +87,7 @@ try { isActive(): boolean -Checks whether the current device is active. In the active state, the screen is on if the device has a screen and the device is not in sleep state if the device does not have a screen. +Checks whether the current device is active. **System capability:** SystemCapability.PowerManager.PowerManager.Core @@ -292,6 +292,7 @@ power.setPowerMode(power.DevicePowerMode.MODE_PERFORMANCE) rebootDevice(reason: string): void +> NOTE
> This API is deprecated since API version 9. You are advised to use [power.reboot](#powerreboot9) instead. Reboots the system. @@ -316,6 +317,7 @@ power.rebootDevice('reboot_test'); isScreenOn(callback: AsyncCallback<boolean>): void +> NOTE
> This API is deprecated since API version 9. You are advised to use [power.isActive](#powerisactive9) instead. Checks the screen status of the current device. This API uses an asynchronous callback to return the result. @@ -344,6 +346,7 @@ power.isScreenOn((err, data) => { isScreenOn(): Promise<boolean> +> NOTE
> This API is deprecated since API version 9. You are advised to use [power.isActive](#powerisactive9) instead. Checks the screen status of the current device. This API uses a promise to return the result. diff --git a/en/application-dev/reference/apis/js-apis-runninglock.md b/en/application-dev/reference/apis/js-apis-runninglock.md index ee70e09ca874602bf8e41f3d4001b61caa5a0344..bddad259f782ca6ece549da06ab6ae4e69bbc441 100644 --- a/en/application-dev/reference/apis/js-apis-runninglock.md +++ b/en/application-dev/reference/apis/js-apis-runninglock.md @@ -135,6 +135,7 @@ runningLock.create('running_lock_test', runningLock.RunningLockType.BACKGROUND) isRunningLockTypeSupported(type: RunningLockType, callback: AsyncCallback<boolean>): void +> NOTE
> This API is deprecated since API version 9. You are advised to use [runningLock.isSupported](#runninglockissupported9) instead. Checks whether a specified type of **RunningLock** is supported. This API uses an asynchronous callback to return the result. @@ -164,6 +165,7 @@ runningLock.isRunningLockTypeSupported(runningLock.RunningLockType.BACKGROUND, ( isRunningLockTypeSupported(type: RunningLockType): Promise<boolean> +> NOTE
> This API is deprecated since API version 9. You are advised to use [runningLock.isSupported](#runninglockissupported9) instead. Checks whether a specified type of **RunningLock** is supported. This API uses a promise to return the result. @@ -198,6 +200,7 @@ runningLock.isRunningLockTypeSupported(runningLock.RunningLockType.BACKGROUND) createRunningLock(name: string, type: RunningLockType, callback: AsyncCallback<RunningLock>): void +> NOTE
> This API is deprecated since API version 9. You are advised to use [runningLock.create](#runninglockcreate9) instead. Creates a **RunningLock** object. @@ -230,6 +233,7 @@ runningLock.createRunningLock('running_lock_test', runningLock.RunningLockType.B createRunningLock(name: string, type: RunningLockType): Promise<RunningLock> +> NOTE
> This API is deprecated since API version 9. You are advised to use [runningLock.create](#runninglockcreate9) instead. Creates a **RunningLock** object. @@ -389,6 +393,7 @@ runningLock.create('running_lock_test', runningLock.RunningLockType.BACKGROUND) lock(timeout: number): void +> NOTE
> This API is deprecated since API version 9. You are advised to use [RunningLock.hold](#hold9) instead. Locks and holds a **RunningLock** object. @@ -420,6 +425,7 @@ runningLock.createRunningLock('running_lock_test', runningLock.RunningLockType.B unlock(): void +> NOTE
> This API is deprecated since API version 9. You are advised to use [RunningLock.unhold](#unhold9) instead. Releases a **RunningLock** object. @@ -445,6 +451,7 @@ runningLock.createRunningLock('running_lock_test', runningLock.RunningLockType.B isUsed(): boolean +> NOTE
> This API is deprecated since API version 9. You are advised to use [RunningLock.isHolding](#isholding9) instead. Checks the hold status of the **Runninglock** object. diff --git a/en/application-dev/reference/apis/js-apis-sim.md b/en/application-dev/reference/apis/js-apis-sim.md index eb88ca8c05459fca0ba2ecd4dfcab60d49677aae..0c0243c3dbe85939b1da5623baac1b3137926e15 100644 --- a/en/application-dev/reference/apis/js-apis-sim.md +++ b/en/application-dev/reference/apis/js-apis-sim.md @@ -687,7 +687,7 @@ promise.then(data => { }); ``` -## sim.**setShowName**8+ +## sim.setShowName8+ setShowName\(slotId: number, name: string, callback: AsyncCallback\): void @@ -716,7 +716,7 @@ sim.setShowName(0, name, (err, data) => { }); ``` -## sim.**setShowName**8+ +## sim.setShowName8+ setShowName\(slotId: number, name: string\): Promise\ @@ -753,7 +753,7 @@ promise.then(data => { }); ``` -## sim.**getShowName**8+ +## sim.getShowName8+ getShowName(slotId: number, callback: AsyncCallback): void @@ -781,7 +781,7 @@ sim.getShowName(0, (err, data) => { ``` -## sim.**getShowName**8+ +## sim.getShowName8+ getShowName(slotId: number): Promise @@ -816,7 +816,7 @@ promise.then(data => { }); ``` -## sim.**setShowNumber**8+ +## sim.setShowNumber8+ setShowNumber\(slotId: number, number: string, callback: AsyncCallback\): void @@ -846,7 +846,7 @@ sim.setShowNumber(0, number, (err, data) => { ``` -## sim.**setShowNumber**8+ +## sim.setShowNumber8+ setShowNumber\(slotId: number, number: string\): Promise\ @@ -883,7 +883,7 @@ promise.then(data => { }); ``` -## sim.**getShowNumber**8+ +## sim.getShowNumber8+ getShowNumber(slotId: number, callback: AsyncCallback): void @@ -911,7 +911,7 @@ sim.getShowNumber(0, (err, data) => { ``` -## sim.**getShowNumber**8+ +## sim.getShowNumber8+ getShowNumber(slotId: number): Promise @@ -946,7 +946,7 @@ promise.then(data => { }); ``` -## sim.**activateSim**8+ +## sim.activateSim8+ activateSim(slotId: number, callback: AsyncCallback): void @@ -974,7 +974,7 @@ sim.activateSim(0, (err, data) => { ``` -## sim.**activateSim**8+ +## sim.activateSim8+ activateSim(slotId: number): Promise\ @@ -1009,7 +1009,7 @@ promise.then(data => { }); ``` -## sim.**deactivateSim**8+ +## sim.deactivateSim8+ deactivateSim(slotId: number, callback: AsyncCallback): void @@ -1037,7 +1037,7 @@ sim.deactivateSim(0, (err, data) => { ``` -## sim.**deactivateSim**8+ +## sim.deactivateSim8+ deactivateSim(slotId: number): Promise\ @@ -1346,7 +1346,7 @@ promise.then(data => { }); ``` -## sim.**unlockPin**7+ +## sim.unlockPin7+ unlockPin(slotId: number, pin: string, callback: AsyncCallback): void @@ -1376,7 +1376,7 @@ sim.unlockPin(0, pin, (err, data) => { ``` -## sim.**unlockPin**7+ +## sim.unlockPin7+ unlockPin(slotId: number, pin: string): Promise<LockStatusResponse\> @@ -1413,7 +1413,7 @@ promise.then(data => { }); ``` -## sim.**unlockPuk**7+ +## sim.unlockPuk7+ unlockPuk(slotId: number, newPin: string, puk: string ,callback: AsyncCallback): void @@ -1445,7 +1445,7 @@ sim.unlockPuk(0, newPin, puk, (err, data) => { ``` -## sim.**unlockPuk**7+ +## sim.unlockPuk7+ unlockPuk(slotId: number, newPin: string, puk: string): Promise<LockStatusResponse\> @@ -1484,7 +1484,7 @@ promise.then(data => { }); ``` -## sim.**unlockPin**28+ +## sim.unlockPin28+ unlockPin2(slotId: number, pin2: string, callback: AsyncCallback): void @@ -1514,7 +1514,7 @@ sim.unlockPin2(0, pin2, (err, data) => { ``` -## sim.**unlockPin**28+ +## sim.unlockPin28+ unlockPin2(slotId: number, pin2: string): Promise<LockStatusResponse\> @@ -1551,7 +1551,7 @@ promise.then(data => { }); ``` -## sim.**unlockPuk**28+ +## sim.unlockPuk28+ unlockPuk2(slotId: number, newPin2: string, puk2: string, callback: AsyncCallback): void @@ -1583,7 +1583,7 @@ sim.unlockPuk2(0, newPin2, puk2, (err, data) => { ``` -## sim.**unlockPuk2**8+ +## sim.unlockPuk28+ unlockPuk2(slotId: number, newPin2: string, puk2: string): Promise<LockStatusResponse\> diff --git a/en/application-dev/reference/apis/js-apis-thermal.md b/en/application-dev/reference/apis/js-apis-thermal.md index 514e7062cd649d8bf5b92261bceeb7cbed870166..5291826d6fab799eb0684753379399562772f4cf 100644 --- a/en/application-dev/reference/apis/js-apis-thermal.md +++ b/en/application-dev/reference/apis/js-apis-thermal.md @@ -118,6 +118,7 @@ try { subscribeThermalLevel(callback: AsyncCallback<ThermalLevel>): void +> NOTE
> This API is deprecated since API version 9. You are advised to use [thermal.registerThermalLevelCallback](#thermalregisterthermallevelcallback9) instead. Subscribes to thermal level changes. @@ -142,6 +143,7 @@ thermal.subscribeThermalLevel((level) => { unsubscribeThermalLevel(callback?: AsyncCallback\): void +> NOTE
> This API is deprecated since API version 9. You are advised to use [thermal.unregisterThermalLevelCallback](#thermalunregisterthermallevelcallback9) instead. Unsubscribes from thermal level changes. @@ -166,6 +168,7 @@ thermal.unsubscribeThermalLevel(() => { getThermalLevel(): ThermalLevel +> NOTE
> This API is deprecated since API version 9. You are advised to use [thermal.getLevel](#thermalgetlevel9) instead. Obtains the current thermal level. diff --git a/en/application-dev/reference/apis/js-apis-touchevent.md b/en/application-dev/reference/apis/js-apis-touchevent.md index ae49b428e00c4c22ed126ecc539290a692b69696..e66c1569fb5fae99e9124183e02b4ed32fb46d9c 100644 --- a/en/application-dev/reference/apis/js-apis-touchevent.md +++ b/en/application-dev/reference/apis/js-apis-touchevent.md @@ -13,6 +13,8 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput ## Action +Enumerates touch actions. + **System capability**: SystemCapability.MultimodalInput.Input.Core | Name | Value | Description | @@ -24,6 +26,8 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput ## ToolType +Enumerates tool types. + **System capability**: SystemCapability.MultimodalInput.Input.Core | Name | Value | Description | @@ -39,6 +43,8 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput ## SourceType +Enumerates source types. + **System capability**: SystemCapability.MultimodalInput.Input.Core | Name | Value | Description | @@ -49,6 +55,8 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput ## Touch +Defines a touch action. + **System capability**: SystemCapability.MultimodalInput.Input.Core | Name| Type| Readable| Writable| Description| @@ -74,6 +82,8 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput ## TouchEvent +Defines a touch event. + **System capability**: SystemCapability.MultimodalInput.Input.Core | Name| Type| Readable| Writable| Description| diff --git a/en/application-dev/reference/apis/js-apis-usb-deprecated.md b/en/application-dev/reference/apis/js-apis-usb-deprecated.md index 68a127a08bdfd1df0ca558866dc3cde577e2b25a..95eb105b0a25fc824b4f7762a73e035283097ddc 100644 --- a/en/application-dev/reference/apis/js-apis-usb-deprecated.md +++ b/en/application-dev/reference/apis/js-apis-usb-deprecated.md @@ -43,7 +43,7 @@ console.log(`devicesList = ${JSON.stringify(devicesList)}`); vendorId: 7531, productId: 2, clazz: 9, - subclass: 0, + subClass: 0, protocol: 1, devAddress: 1, busNum: 1, @@ -60,7 +60,7 @@ console.log(`devicesList = ${JSON.stringify(devicesList)}`); id: 0, protocol: 0, clazz: 9, - subclass: 0, + subClass: 0, alternateSetting: 0, name: "1-1", endpoints: [ @@ -171,7 +171,7 @@ usb.requestRight(devicesName).then((ret) => { ## usb.claimInterface -claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number +claimInterface(pipe: USBDevicePipe, iface: USBInterface, force ?: boolean): number Claims a USB interface. @@ -348,7 +348,7 @@ let ret = usb.getFileDescriptor(devicepipe); ## usb.controlTransfer -controlTransfer(pipe: USBDevicePipe, controlparam: USBControlParams, timeout?: number): Promise<number> +controlTransfer(pipe: USBDevicePipe, controlparam: USBControlParams, timeout ?: number): Promise<number> Performs control transfer. @@ -380,7 +380,7 @@ usb.controlTransfer(devicepipe, USBControlParams).then((ret) => { ## usb.bulkTransfer -bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, timeout?: number): Promise<number> +bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, timeout ?: number): Promise<number> Performs bulk transfer. diff --git a/en/application-dev/reference/apis/js-apis-usb.md b/en/application-dev/reference/apis/js-apis-usb.md index 9035d2d040209f44a019fb69b3da6edc49b481b3..358b80bf5b14d89773bb64ade4c5e833de6afa59 100644 --- a/en/application-dev/reference/apis/js-apis-usb.md +++ b/en/application-dev/reference/apis/js-apis-usb.md @@ -42,7 +42,7 @@ console.log(`devicesList = ${JSON.stringify(devicesList)}`); vendorId: 7531, productId: 2, clazz: 9, - subclass: 0, + subClass: 0, protocol: 1, devAddress: 1, busNum: 1, @@ -59,7 +59,7 @@ console.log(`devicesList = ${JSON.stringify(devicesList)}`); id: 0, protocol: 0, clazz: 9, - subclass: 0, + subClass: 0, alternateSetting: 0, name: "1-1", endpoints: [ @@ -252,7 +252,7 @@ if (usb.addRight(bundleName, devicesName) { ## usb.claimInterface -claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number +claimInterface(pipe: USBDevicePipe, iface: USBInterface, force ?: boolean): number Claims a USB interface. @@ -429,7 +429,7 @@ let ret = usb.getFileDescriptor(devicepipe); ## usb.controlTransfer -controlTransfer(pipe: USBDevicePipe, controlparam: USBControlParams, timeout?: number): Promise<number> +controlTransfer(pipe: USBDevicePipe, controlparam: USBControlParams, timeout ?: number): Promise<number> Performs control transfer. @@ -461,7 +461,7 @@ usb.controlTransfer(devicepipe, USBControlParams).then((ret) => { ## usb.bulkTransfer -bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, timeout?: number): Promise<number> +bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, timeout ?: number): Promise<number> Performs bulk transfer. diff --git a/en/device-dev/subsystems/subsys-dfx-hisysevent-tool.md b/en/device-dev/subsystems/subsys-dfx-hisysevent-tool.md index cb0f8cead65cd1faed98c723d30f557b4302bbab..7d478081dd4bf3f5a88505ed6181919836446688 100644 --- a/en/device-dev/subsystems/subsys-dfx-hisysevent-tool.md +++ b/en/device-dev/subsystems/subsys-dfx-hisysevent-tool.md @@ -9,7 +9,7 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** - Command for subscribing to real-time system events: - ``` + ```shell hisysevent -r ``` @@ -21,7 +21,7 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** - Command for enabling the debugging mode: - ``` + ```shell hisysevent -r -d ``` @@ -29,11 +29,11 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** | Option| Description| | -------- | -------- | - | -d | Subscription to real-time system events in debugging mode.| + | -d | Subscribes to real-time system events in debugging mode.| - Command for subscribing to real-time system events by event tag: - ``` + ```shell hisysevent -r -t [-c [WHOLE_WORD|PREFIX|REGULAR]] ``` @@ -42,12 +42,12 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** | Option| Description| | -------- | -------- | | -t | Event tag used to filter subscribed real-time system events.| - | -c | Matching rule for event tags. The option can be **WHOLE_WORD**, **PREFIX**, or **REGULAR**.| + | -c | Matching rule for event tags. The options can be **WHOLE_WORD**, **PREFIX**, or **REGULAR**.| Example: - ``` - # hisysevent -r -t "STA" -c PREFIX + ```shell + # hisysevent -r -t "STA" -c PREFIX {"domain_":"RELIABILITY","name_":"APP_FREEZE","type_":1,"time_":1501963670809,"pid_":1505,"uid_":10002,"FAULT_TYPE":"4","MODULE":"com.ohos.screenlock","REASON":"NO_DRAW","SUMMARY":"SUMMARY:\n","LOG_PATH":"/data/log/faultlog/faultlogger/appfreeze-com.ohos.screenlock-10002-20170805200750","HAPPEN_TIME":1501963670809,"VERSION":"1.0.0","level_":"CRITICAL","tag_":"STABILITY","id_":"4973863135535405472","info_":""} # hisysevent -r -t "STAw{0,6}" -c REGULAR {"domain_":"RELIABILITY","name_":"APP_FREEZE","type_":1,"time_":1501963793206,"pid_":1505,"uid_":10002,"FAULT_TYPE":"4","MODULE":"com.ohos.screenlock","REASON":"NO_DRAW","SUMMARY":"SUMMARY:\n","LOG_PATH":"/data/log/faultlog/faultlogger/appfreeze-com.ohos.screenlock-10002-20170805200953","HAPPEN_TIME":1501963793206,"VERSION":"1.0.0","level_":"CRITICAL","tag_":"STABILITY","id_":"16367997008075110557","info_":""} @@ -57,7 +57,7 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** - Command for subscribing to real-time system events by event domain and event name: - ``` + ```shell hisysevent -r -o -n [-c [WHOLE_WORD|PREFIX|REGULAR]] ``` @@ -67,11 +67,11 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** | -------- | -------- | | -o | Event domain used to filter subscribed real-time system events.| | -n | Event name used to filter subscribed real-time system events.| - | -c | Matching rule for event domains and event names. The option can be **WHOLE_WORD**, PREFIX, or **REGULAR**.| + | -c | Matching rule for event domains and event names. The options can be **WHOLE_WORD**, PREFIX, or **REGULAR**.| Example: - ``` + ```shell # hisysevent -r -o "RELIABILITY" -n "APP_FREEZE" {"domain_":"RELIABILITY","name_":"APP_FREEZE","type_":1,"time_":1501963989773,"pid_":1505,"uid_":10002,"FAULT_TYPE":"4","MODULE":"com.ohos.screenlock","REASON":"NO_DRAW","SUMMARY":"SUMMARY:\n","LOG_PATH":"/data/log/faultlog/faultlogger/appfreeze-com.ohos.screenlock-10002-20170805201309","HAPPEN_TIME":1501963989773,"VERSION":"1.0.0","level_":"CRITICAL","tag_":"STABILITY","id_":"16367997008075110557","info_":""} # hisysevent -r -o "RELIABI\w{0,8}" -n "APP_FREEZE" -c REGULAR @@ -85,7 +85,7 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** - Command for subscribing to real-time system events by event type: - ``` + ```shell hisysevent -r -g [FAULT|STATISTIC|SECURITY|BEHAVIOR] ``` @@ -97,7 +97,7 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** Example: - ``` + ```shell # hisysevent -r -o "RELIABILITY" -n "APP_FREEZE" -g FAULT {"domain_":"RELIABILITY","name_":"APP_FREEZE","type_":1,"time_":1501963989773,"pid_":1505,"uid_":10002,"FAULT_TYPE":"4","MODULE":"com.ohos.screenlock","REASON":"NO_DRAW","SUMMARY":"SUMMARY:\n","LOG_PATH":"/data/log/faultlog/faultlogger/appfreeze-com.ohos.screenlock-10002-20170805201309","HAPPEN_TIME":1501963989773,"VERSION":"1.0.0","level_":"CRITICAL","tag_":"STABILITY","id_":"16367997008075110557","info_":""} # hisysevent -r -o "POWER\w{0,8}" -n "POWER_RUNNINGLOCK" -c REGULAR -g STATISTIC @@ -108,11 +108,12 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** {"domain_":"MULTIMODALINPUT","name_":"Z_ORDER_WINDOW_CHANGE","type_":4,"time_":1667549852735,"tz_":"+0000","pid_":2577,"tid_":2588,"uid_":6696,"OLD_ZORDER_FIRST_WINDOWID":-1,"NEW_ZORDER_FIRST_WINDOWID":2,"OLD_ZORDER_FIRST_WINDOWPID":-1,"NEW_ZORDER_FIRST_WINDOWPID":1458,"MSG":"The ZorderFirstWindow changing succeeded","level_":"MINOR","tag_":"PowerStats","id_":"16847308118559691400","info_":""} ``` + ## Querying Historical System Events - Command for querying historical system events: - ``` + ```shell hisysevent -l ``` @@ -124,7 +125,7 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** - Command for querying historical system events within the specified period of time: - ``` + ```shell hisysevent -l -s -e ``` @@ -132,21 +133,46 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** | Option| Description| | -------- | -------- | - | -s | Start time for querying historical system events. Only system events generated after the start time are returned.| - | -e | End time for querying historical system events. Only system events generated before the end time are returned.| + | -s | Original start timestamp for querying historical system events. Only system events generated after the start time are returned.| + | -e | Original end timestamp for querying historical system events. Only system events generated before the end time are returned.| Example: - ``` + ```shell # hisysevent -l -s 1501964222980 -e 1501964222996 {"domain_":"RELIABILITY","name_":"APP_FREEZE","type_":1,"time_":1501964222980,"pid_":1505,"uid_":10002,"FAULT_TYPE":"4","MODULE":"com.ohos.screenlock","REASON":"NO_DRAW","SUMMARY":"SUMMARY:\n","LOG_PATH":"/data/log/faultlog/faultlogger/appfreeze-com.ohos.screenlock-10002-20170805201702","HAPPEN_TIME":1501964222980,"VERSION":"1.0.0","level_":"CRITICAL","tag_":"STABILITY","id_":"10435592800188571430","info_":""} {"domain_":"GRAPHIC","name_":"NO_DRAW","type_":1,"time_":1501964222980,"tz_":"+0000","pid_":1505,"tid_":1585,"uid_":10002,"PID":1505,"UID":10002,"ABILITY_NAME":"","MSG":"It took 1957104259905ns to draw, UI took 0ns to draw, RSRenderThread took 8962625ns to draw, RSRenderThread dropped 0 UI Frames","level_":"MINOR","id_":"1708287249901948387","info_":"isResolved,eventId:0"} {"domain_":"RELIABILITY","name_":"APP_FREEZE","type_":1,"time_":1501964222994,"tz_":"+0000","pid_":623,"tid_":1445,"uid_":1201,"SUB_EVENT_TYPE":"NO_DRAW","EVENT_TIME":"20170805201702","MODULE":"NO_DRAW","PNAME":"NO_DRAW","REASON":"NO_DRAW","DIAG_INFO":"","STACK":"SUMMARY:\n","HIVIEW_LOG_FILE_PATHS":["/data/log/faultlog/faultlogger/appfreeze-NO_DRAW-10002-20170805201702"],"DOMAIN":"GRAPHIC","STRING_ID":"NO_DRAW","PID":1505,"UID":10002,"PACKAGE_NAME":"NO_DRAW","PROCESS_NAME":"","MSG":"It took 1956945826265ns to draw, UI took 0ns to draw, RSRenderThread took 9863293ns to draw, RSRenderThread dropped 0 UI Frames\n","level_":"CRITICAL","tag_":"STABILITY","id_":"10448522101019619655","info_":""} ``` -- Command for setting the maximum number of historical events that can be queried: +- Command for querying historical system events within the specified period of time: + ```shell + hisysevent -l -S -E ``` + + Description of command options: + + | Option| Description| + | -------- | -------- | + | -S | Original start timestamp for querying historical system events. Only system events generated after the start time are returned.| + | -E | Original end timestamp for querying historical system events. Only system events generated after the start time are returned.| + + Example: + + ```shell + # hisysevent -l -S "2023-01-05 14:12:50" -E "2023-01-05 14:12:51" + {"domain_":"GRAPHIC","name_":"JANK_FRAME_SKIP","type_":1,"time_":1672899170022,"tz_":"+0800","pid_":1499,"tid_":1573,"uid_":20010037,"PID":1499,"UID":20010037,"ABILITY_NAME":"com.ohos.launcher","MSG":"It took 587948726ns to draw, UI took 483016382ns to draw, RSRenderThread took 96616051ns to draw, RSRenderThread dropped 0 UI Frames","level_":"MINOR","id_":"11351278822867091090","info_":"","seq_":307} + {"domain_":"AAFWK","name_":"START_ABILITY_ERROR","type_":1,"time_":1672899170108,"tz_":"+0800","pid_":550,"tid_":1127,"uid_":5523,"USER_ID":-1,"BUNDLE_NAME":"com.ohos.wallpaper","MODULE_NAME":"","ABILITY_NAME":"WallpaperExtAbility","ERROR_CODE":2097152,"level_":"MINOR","tag_":"ability","id_":"53589395004188308060","info_":"","seq_":313} + {"domain_":"GRAPHIC","name_":"JANK_FRAME_SKIP","type_":1,"time_":1672899170305,"tz_":"+0800","pid_":1293,"tid_":1632,"uid_":10006,"PID":1293,"UID":10006,"ABILITY_NAME":"com.ohos.systemui","MSG":"It took 309597490ns to draw, UI took 92364718ns to draw, RSRenderThread took 205874105ns to draw, RSRenderThread dropped 1 UI Frames","level_":"MINOR","id_":"14843220972178010722","info_":"","seq_":314} + {"domain_":"GRAPHIC","name_":"JANK_FRAME_SKIP","type_":1,"time_":1672899170350,"tz_":"+0800","pid_":1293,"tid_":1632,"uid_":10006,"PID":1293,"UID":10006,"ABILITY_NAME":"com.ohos.systemui","MSG":"It took 259782859ns to draw, UI took 33909753ns to draw, RSRenderThread took 44849879ns to draw, RSRenderThread dropped 5 UI Frames","level_":"MINOR","id_":"66610006717219916560","info_":"","seq_":315} + {"domain_":"AAFWK","name_":"CONNECT_SERVICE_ERROR","type_":1,"time_":1672899170733,"tz_":"+0800","pid_":550,"tid_":1127,"uid_":5523,"USER_ID":100,"BUNDLE_NAME":"com.ohos.wallpaper","MODULE_NAME":"","ABILITY_NAME":"WallpaperExtAbility","ERROR_CODE":2097152,"level_":"MINOR","tag_":"ability","id_":"10040008376311927188","info_":"","seq_":317} + {"domain_":"COMMONEVENT","name_":"PUBLISH","type_":2,"time_":1672899170063,"tz_":"+0800","pid_":550,"tid_":937,"uid_":5523,"USER_ID":-1,"PUBLISHER_BUNDLE_NAME":"","PID":0,"UID":1101,"EVENT_NAME":"usual.event.SCREEN_ON","level_":"MINOR","id_":"80996758983032931610","info_":"","seq_":308} + ``` + +- Command for setting the maximum number of historical events that can be queried: + + ```shell hisysevent -l -m ``` @@ -158,14 +184,14 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** Example: - ``` + ```shell # hisysevent -l -s 1501964222980 -e 1501964222996 -m 1 {"domain_":"RELIABILITY","name_":"APP_FREEZE","type_":1,"time_":1501964222980,"pid_":1505,"uid_":10002,"FAULT_TYPE":"4","MODULE":"com.ohos.screenlock","REASON":"NO_DRAW","SUMMARY":"SUMMARY:\n","LOG_PATH":"/data/log/faultlog/faultlogger/appfreeze-com.ohos.screenlock-10002-20170805201702","HAPPEN_TIME":1501964222980,"VERSION":"1.0.0","level_":"CRITICAL","tag_":"STABILITY","id_":"10435592800188571430","info_":""} ``` - Command for querying historical system events by event domain and event name: - ``` + ```shell hisysevent -l -o -n [-c WHOLE_WORD] ``` @@ -173,24 +199,24 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** | Option| Description| | -------- | -------- | - | -o | Domain based on which historical system events are queried.| - | -n | Name based on which historical system events are queried.| + | -o | Event domain based on which historical system events are queried.| + | -n | Event name based on which historical system events are queried.| | -c | Rule for matching the domain and name of historical system events. The option can only be **WHOLE_WORD**.| Example: - ``` + ```shell # hisysevent -l -n "APP_FREEZE" {"domain_":"RELIABILITY","name_":"APP_FREEZE","type_":1,"time_":1501963989773,"pid_":1505,"uid_":10002,"FAULT_TYPE":"4","MODULE":"com.ohos.screenlock","REASON":"NO_DRAW","SUMMARY":"SUMMARY:\n","LOG_PATH":"/data/log/faultlog/faultlogger/appfreeze-com.ohos.screenlock-10002-20170805201309","HAPPEN_TIME":1501963989773,"VERSION":"1.0.0","level_":"CRITICAL","tag_":"STABILITY","id_":"16367997008075110557","info_":""} - # hisysevent -r -o "RELIABILITY" + # hisysevent -l -o "RELIABILITY" {"domain_":"RELIABILITY","name_":"APP_FREEZE","type_":1,"time_":1501963989773,"pid_":1505,"uid_":10002,"FAULT_TYPE":"4","MODULE":"com.ohos.screenlock","REASON":"NO_DRAW","SUMMARY":"SUMMARY:\n","LOG_PATH":"/data/log/faultlog/faultlogger/appfreeze-com.ohos.screenlock-10002-20170805201544","HAPPEN_TIME":1501963989773,"VERSION":"1.0.0","level_":"CRITICAL","tag_":"STABILITY","id_":"13456525196455104060","info_":""} - # hisysevent -r -o "RELIABILITY" -n "APP_FREEZE" -c WHOLE_WORD + # hisysevent -l -o "RELIABILITY" -n "APP_FREEZE" -c WHOLE_WORD {"domain_":"RELIABILITY","name_":"APP_FREEZE","type_":1,"time_":1501963989773,"pid_":1505,"uid_":10002,"FAULT_TYPE":"4","MODULE":"com.ohos.screenlock","REASON":"NO_DRAW","SUMMARY":"SUMMARY:\n","LOG_PATH":"/data/log/faultlog/faultlogger/appfreeze-com.ohos.screenlock-10002-20170805201633","HAPPEN_TIME":1501963989773,"VERSION":"1.0.0","level_":"CRITICAL","tag_":"STABILITY","id_":"12675246910904037271","info_":""} ``` - Command for querying historical system events by event type: - ``` + ```shell hisysevent -l -g [FAULT|STATISTIC|SECURITY|BEHAVIOR] ``` @@ -202,7 +228,7 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** Example: - ``` + ```shell # hisysevent -l -o "RELIABILITY" -g FAULT {"domain_":"RELIABILITY","name_":"APP_FREEZE","type_":1,"time_":1501963989773,"pid_":1505,"uid_":10002,"FAULT_TYPE":"4","MODULE":"com.ohos.screenlock","REASON":"NO_DRAW","SUMMARY":"SUMMARY:\n","LOG_PATH":"/data/log/faultlog/faultlogger/appfreeze-com.ohos.screenlock-10002-20170805201309","HAPPEN_TIME":1501963989773,"VERSION":"1.0.0","level_":"CRITICAL","tag_":"STABILITY","id_":"16367997008075110557","info_":""} # hisysevent -l -n "POWER_RUNNINGLOCK" -c WHOLE_WORD -g STATISTIC @@ -215,9 +241,9 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** ## System Event Validity Check -- Enabling system event validity check +- Command for enabling system event validity check - ``` + ```shell hisysevent -v ``` @@ -229,7 +255,7 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** Example: - ``` + ```shell # hisysevent -v -l -s 1501964222980 -e 1501964222996 # The **HAPPEN_TIME** and **VERSION** fields are not configured in the YAML file for the **APP_FREEZE** event that belongs to the **RELIABILITY** domain. Therefore, the two fields are highlighted in red. {"domain_":"RELIABILITY","name_":"APP_FREEZE","type_":1,"time_":1501964222980,"pid_":1505,"uid_":10002,"FAULT_TYPE":"4","MODULE":"com.ohos.screenlock","REASON":"NO_DRAW","SUMMARY":"SUMMARY:\n","LOG_PATH":"/data/log/faultlog/faultlogger/appfreeze-com.ohos.screenlock-10002-20170805201702","HAPPEN_TIME":1501964222980,"VERSION":"1.0.0","level_":"CRITICAL","tag_":"STABILITY","id_":"10435592800188571430","info_":""}