提交 4a5f9e42 编写于 作者: S shawn_he

update doc

Signed-off-by: Nshawn_he <shawn.he@huawei.com>
上级 dbacd94f
...@@ -32,14 +32,8 @@ Location awareness helps determine where a mobile device locates. The system ide ...@@ -32,14 +32,8 @@ Location awareness helps determine where a mobile device locates. The system ide
Location awareness is offered by the system as a basic service for applications. Depending on the service scenario, an application needs to initiate a location request to the system and stop the location request when the service scenario ends. In this process, the system reports the location information to the application on a real-time basis. Location awareness is offered by the system as a basic service for applications. Depending on the service scenario, an application needs to initiate a location request to the system and stop the location request when the service scenario ends. In this process, the system reports the location information to the application on a real-time basis.
## Limitations and Constraints ## Constraints
Your application can use the location function only after the user has granted the permission and turned on the function. If the location function is off, the system will not provide the location service for any application. Your application can use the location function only after the user has granted the permission and turned on the function. If the location function is off, the system will not provide the location service for any application.
Since the location information is considered sensitive, your application still needs to obtain the location access permission from the user even if the user has turned on the location function. The system will provide the location service for your application only after it has been granted the permission to access the device location information. Since the location information is considered sensitive, your application still needs to obtain the location access permission from the user even if the user has turned on the location function. The system will provide the location service for your application only after it has been granted the permission to access the device location information.
\ No newline at end of file
## Samples
The following sample is provided to help you better understand how to develop location services:
-[`Location`: Location (eTS) (API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/device/Location)
...@@ -30,7 +30,7 @@ The following table lists the USB APIs currently available. For details, see the ...@@ -30,7 +30,7 @@ The following table lists the USB APIs currently available. For details, see the
## How to Develop ## How to Develop
You can set a USB device as a host to connect to a device for data transfer. The development procedure is as follows: You can set a USB device as the USB host to connect to other USB devices for data transfer. The development procedure is as follows:
1. Obtain the USB device list. 1. Obtain the USB device list.
......
# System Event Logging # System Event Logging
Provides system event logging APIs for system HAP applications. This module provides system event logging APIs for system HAP applications.
> **NOTE**<br> > **NOTE**<br>
> - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...@@ -87,9 +87,9 @@ Writes event information to the event file. This API uses a promise to return th ...@@ -87,9 +87,9 @@ Writes event information to the event file. This API uses a promise to return th
**Parameters** **Parameters**
| Name | Type | Mandatory| Description| | Name | Type | Mandatory | Description |
| --------- | ----------------------- | ---- | --------------- | | ------ | ------------------- | --------- | ----------- |
| eventType | [EventType](#eventtype) | Yes | Application event type.| | info | [SysEventInfo](#syseventinfo) | Yes | System event. |
**Return value** **Return value**
......
...@@ -94,14 +94,16 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -94,14 +94,16 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
**Parameters** **Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | Name| Type| Mandatory| Description|
| device | [USBDevice](#usbdevice) | Yes| USB device information.| | -------- | -------- | -------- | -------- |
| device | [USBDevice](#usbdevice) | Yes| USB device information.|
**Return value** **Return value**
| Type| Description|
| -------- | -------- | | Type| Description|
| Readonly&lt;[USBDevicePipe](#usbdevicepipe)&gt; | USB device pipe for data transfer.| | -------- | -------- |
| Readonly&lt;[USBDevicePipe](#usbdevicepipe)&gt; | USB device pipe for data transfer.|
**Example** **Example**
...@@ -119,14 +121,16 @@ Checks whether the application has the permission to access the device. ...@@ -119,14 +121,16 @@ Checks whether the application has the permission to access the device.
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
**Parameters** **Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | Name| Type| Mandatory| Description|
| deviceName | string | Yes| Device name to set.| | -------- | -------- | -------- | -------- |
| deviceName | string | Yes| Device name.|
**Return value** **Return value**
| Type| Description|
| -------- | -------- | | Type| Description|
| boolean | Returns **true** if the application has the permission to access the device; returns **false** otherwise.| | -------- | -------- |
| boolean | Returns **true** if the application has the permission to access the device; returns **false** otherwise.|
**Example** **Example**
...@@ -140,19 +144,21 @@ console.log(bool); ...@@ -140,19 +144,21 @@ console.log(bool);
requestRight(deviceName: string): Promise&lt;boolean&gt; requestRight(deviceName: string): Promise&lt;boolean&gt;
Requests the temporary permission for the application to access the USB device. Requests the temporary permission for the application to access the USB device. This API uses a promise to return the result.
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
**Parameters** **Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | Name| Type| Mandatory| Description|
| deviceName | string | Yes| Device name to set.| | -------- | -------- | -------- | -------- |
| deviceName | string | Yes| Device name.|
**Return value** **Return value**
| Type| Description|
| -------- | -------- | | Type| Description|
| Promise&lt;boolean&gt; | Returns **true** if the temporary device access permissions are granted; returns **false** otherwise.| | -------- | -------- |
| Promise&lt;boolean&gt; | Promise used to return the result. The value **true** indicates that the temporary device access permissions are granted; and the value **false** indicates the opposite.|
**Example** **Example**
...@@ -174,16 +180,18 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -174,16 +180,18 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
**Parameters** **Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | Name| Type| Mandatory| Description|
| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.| | -------- | -------- | -------- | -------- |
| iface | [USBInterface](#usbinterface) | Yes| USB interface, which is used to determine the index of the interface to claim.| | pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.|
| force | boolean | No| Whether to forcibly claim the USB interface. The default value is **false**, indicating not to forcibly claim the USB interface.| | iface | [USBInterface](#usbinterface) | Yes| USB interface, which is used to determine the index of the interface to claim.|
| force | boolean | No| Whether to forcibly claim the USB interface. The default value is **false**, indicating not to forcibly claim the USB interface.|
**Return value** **Return value**
| Type| Description|
| -------- | -------- | | Type| Description|
| number | Returns **0** if the USB interface is successfully claimed; returns an error code otherwise.| | -------- | -------- |
| number | Returns **0** if the USB interface is successfully claimed; returns an error code otherwise.|
**Example** **Example**
...@@ -203,15 +211,17 @@ Before you do this, ensure that you have claimed the interface by calling [usb.c ...@@ -203,15 +211,17 @@ Before you do this, ensure that you have claimed the interface by calling [usb.c
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
**Parameters** **Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | Name| Type| Mandatory| Description|
| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.| | -------- | -------- | -------- | -------- |
| iface | [USBInterface](#usbinterface) | Yes| USB interface, which is used to determine the index of the interface to release.| | pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.|
| iface | [USBInterface](#usbinterface) | Yes| USB interface, which is used to determine the index of the interface to release.|
**Return value** **Return value**
| Type| Description|
| -------- | -------- | | Type| Description|
| number | Returns **0** if the USB interface is successfully released; returns an error code otherwise.| | -------- | -------- |
| number | Returns **0** if the USB interface is successfully released; returns an error code otherwise.|
**Example** **Example**
...@@ -231,15 +241,17 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -231,15 +241,17 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
**Parameters** **Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | Name| Type| Mandatory| Description|
| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.| | -------- | -------- | -------- | -------- |
| config | [USBConfig](#usbconfig) | Yes| USB configuration to set.| | pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.|
| config | [USBConfig](#usbconfig) | Yes| USB configuration to set.|
**Return value** **Return value**
| Type| Description|
| -------- | -------- | | Type| Description|
| number | Returns **0** if the USB configuration is successfully set; returns an error code otherwise.| | -------- | -------- |
| number | Returns **0** if the USB configuration is successfully set; returns an error code otherwise.|
**Example** **Example**
...@@ -266,9 +278,10 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -266,9 +278,10 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
| iface | [USBInterface](#usbinterface) | Yes | USB interface to set. | | iface | [USBInterface](#usbinterface) | Yes | USB interface to set. |
**Return value** **Return value**
| Type| Description|
| -------- | -------- | | Type| Description|
| number | Returns **0** if the USB interface is successfully set; returns an error code otherwise.| | -------- | -------- |
| number | Returns **0** if the USB interface is successfully set; returns an error code otherwise.|
**Example** **Example**
...@@ -289,11 +302,12 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -289,11 +302,12 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.| | pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Uint8Array | Returns the raw USB descriptor if the operation is successful; returns **undefined** otherwise.| | Uint8Array | Returns the raw USB descriptor if the operation is successful; returns **undefined** otherwise.|
...@@ -315,9 +329,10 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -315,9 +329,10 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
**Parameters** **Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | Name| Type| Mandatory| Description|
| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.| | -------- | -------- | -------- | -------- |
| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.|
**Return value** **Return value**
...@@ -342,16 +357,18 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -342,16 +357,18 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
**Parameters** **Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | Name| Type| Mandatory| Description|
| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| USB device pipe, which is used to determine the USB device.| | -------- | -------- | -------- | -------- |
| contrlparam | [USBControlParams](#usbcontrolparams) | Yes| Control transfer parameters.| | pipe | [USBDevicePipe](#usbdevicepipe) | Yes| USB device pipe, which is used to determine the USB device.|
| timeout | number | No| Timeout duration. The default value is **0**, indicating no timeout.| | contrlparam | [USBControlParams](#usbcontrolparams) | Yes| Control transfer parameters.|
| timeout | number | No| Timeout duration in ms. This parameter is optional. The default value is **0**, indicating no timeout.|
**Return value** **Return value**
| Type| Description|
| -------- | -------- | | Type| Description|
| Promise&lt;number&gt; | Returns the size of the transmitted or received data block if the control transfer is successful; returns **-1** if an exception occurs.| | -------- | -------- |
| Promise&lt;number&gt; | Promise used to return the result, which is the size of the transmitted or received data block if the transfer is successful, or **-1** if an exception has occurred.|
**Example** **Example**
...@@ -372,17 +389,19 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -372,17 +389,19 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
**Parameters** **Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | Name| Type| Mandatory| Description|
| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| USB device pipe, which is used to determine the USB device.| | -------- | -------- | -------- | -------- |
| endpoint | [USBEndpoint](#usbendpoint) | Yes| USB endpoint, which is used to determine the USB port for data transfer.| | pipe | [USBDevicePipe](#usbdevicepipe) | Yes| USB device pipe, which is used to determine the USB device.|
| buffer | Uint8Array | Yes| Buffer for writing or reading data.| | endpoint | [USBEndpoint](#usbendpoint) | Yes| USB endpoint, which is used to determine the USB port for data transfer.|
| timeout | number | No| Timeout duration. The default value is **0**, indicating no timeout.| | buffer | Uint8Array | Yes| Buffer for writing or reading data.|
| timeout | number | No| Timeout duration in ms. This parameter is optional. The default value is **0**, indicating no timeout.|
**Return value** **Return value**
| Type| Description|
| -------- | -------- | | Type| Description|
| Promise&lt;number&gt; | Returns the size of the transmitted or received data block if the control transfer is successful; returns **-1** if an exception occurs.| | -------- | -------- |
| Promise&lt;number&gt; | Promise used to return the result, which is the size of the transmitted or received data block if the transfer is successful, or **-1** if an exception has occurred.|
**Example** **Example**
...@@ -406,14 +425,16 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -406,14 +425,16 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
**Parameters** **Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | Name| Type| Mandatory| Description|
| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| USB device pipe.| | -------- | -------- | -------- | -------- |
| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| USB device pipe.|
**Return value** **Return value**
| Type| Description|
| -------- | -------- | | Type| Description|
| number | Returns **0** if the USB device pipe is closed successfully; returns an error code otherwise.| | -------- | -------- |
| number | Returns **0** if the USB device pipe is closed successfully; returns an error code otherwise.|
**Example** **Example**
...@@ -498,8 +519,8 @@ Sets the current USB function list in Device mode. ...@@ -498,8 +519,8 @@ Sets the current USB function list in Device mode.
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------ | ------------------------------------------------------ | | ------------------ | ------------------------------------------------------------ |
| Promise\<boolean\> | Promise used to return the result. The value **true** indicates that the operation is successful, and the value **false** indicates the opposite.| | Promise\<boolean\> | Promise used to return the result. The value **true** indicates that the operation is successful, and the value **false** indicates the opposite.|
**Example** **Example**
...@@ -601,8 +622,8 @@ Sets the role types supported by a specified port, which can be **powerRole** (f ...@@ -601,8 +622,8 @@ Sets the role types supported by a specified port, which can be **powerRole** (f
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------ | -------------- | | ------------------ | ------------------------------------------------------------ |
| Promise\<boolean\> | Promise used to return the result. The value **true** indicates that the operation is successful, and the value **false** indicates the opposite.| | Promise\<boolean\> | Promise used to return the result. The value **true** indicates that the operation is successful, and the value **false** indicates the opposite.|
**Example** **Example**
......
...@@ -395,7 +395,7 @@ bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, tim ...@@ -395,7 +395,7 @@ bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, tim
| pipe | [USBDevicePipe](#usbdevicepipe) | 是 | 用于确定设备。 | | pipe | [USBDevicePipe](#usbdevicepipe) | 是 | 用于确定设备。 |
| endpoint | [USBEndpoint](#usbendpoint) | 是 | 用于确定传输的端口。 | | endpoint | [USBEndpoint](#usbendpoint) | 是 | 用于确定传输的端口。 |
| buffer | Uint8Array | 是 | 用于写入或读取的缓冲区。 | | buffer | Uint8Array | 是 | 用于写入或读取的缓冲区。 |
| timeout | number | 否 | 超时时间(单位:ms),可选参数,默认为0不超时。,可选参数,默认为0不超时。 | | timeout | number | 否 | 超时时间(单位:ms),可选参数,默认为0不超时。 |
**返回值:** **返回值:**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册