提交 c1f82d5c 编写于 作者: zyjhandsome's avatar zyjhandsome

Merge branch 'master' of https://gitee.com/openharmony/docs

# Conflicts:
#	zh-cn/application-dev/security/accesstoken-guidelines.md
......@@ -3,30 +3,18 @@
## When to Use
- Data provided by the compass sensor denotes the current orientation of the user device, which helps your application accurately navigate for the user.
With the sensor module, a device can obtain sensor data. For example, the device can subscribe to data of the orientation sensor to detect its own orientation, and data of the pedometer sensor to learn the number of steps the user walks every day.
- Data provided by the proximity sensor denotes the distance between the device and a visible object, which enables the device to automatically turn on or off its screen accordingly to prevent accidental touch on the screen.
- Data provided by the barometer sensor helps your application accurately determine the altitude of the device.
- Data provided by the ambient light sensor helps your device automatically adjust its backlight.
- Data provided by the Hall effect sensor implements the smart cover mode of your device.
- Data provided by the heart rate sensor helps your application track the heart health of a user.
- Data provided by the pedometer sensor helps your application obtain the number of steps a user has walked.
- Data provided by the wear detection sensor helps your application detect whether a user is wearing a wearable device.
For details about the APIs, see [Sensor](../reference/apis/js-apis-sensor.md).
## Available APIs
| Module| API| Description|
| -------- | -------- | -------- |
| ohos.sensor | sensor.on(sensorType, callback:AsyncCallback<Response>): void | Subscribes to data changes of a type of sensor.|
| ohos.sensor | sensor.once(sensorType, callback:AsyncCallback<Response>): void | Subscribes to only one data change of a type of sensor.|
| ohos.sensor | sensor.off(sensorType, callback?:AsyncCallback<void>): void | Unsubscribes from sensor data changes.|
| ohos.sensor | sensor.on(sensorId, callback:AsyncCallback<Response>): void | Subscribes to data changes of a type of sensor.|
| ohos.sensor | sensor.once(sensorId, callback:AsyncCallback<Response>): void | Subscribes to only one data change of a type of sensor.|
| ohos.sensor | sensor.off(sensorId, callback?:AsyncCallback<void>): void | Unsubscribes from sensor data changes.|
## How to Develop
......@@ -43,52 +31,46 @@
For details about how to configure a permission, see [Declaring Permissions](../security/accesstoken-guidelines.md).
2. Subscribe to data changes of a type of sensor.
2. Subscribe to data changes of a type of sensor. The following uses the acceleration sensor as an example.
```
```js
import sensor from "@ohos.sensor";
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, function(data){
sensor.on(sensor.SensorId.ACCELEROMETER, function(data){
console.info("Data obtained successfully. x: " + data.x + "y: " + data.y + "z: " + data.z); // Data is obtained.
});
```
The following figure shows the successful call result when **SensorType** is **SENSOR_TYPE_ID_ACCELEROMETER**.
![en-us_image_0000001241693881](figures/en-us_image_0000001241693881.png)
![171e6f30-a8d9-414c-bafa-b430340305fb](figures/171e6f30-a8d9-414c-bafa-b430340305fb.png)
3. Unsubscribe from sensor data changes.
```
```js
import sensor from "@ohos.sensor";
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER);
sensor.off(sensor.SensorId.ACCELEROMETER);
```
The following figure shows the successful call result when **SensorType** is **SENSOR_TYPE_ID_ACCELEROMETER**.
![en-us_image_0000001196654004](figures/en-us_image_0000001196654004.png)
![65d69983-29f6-4381-80a3-f9ef2ec19e53](figures/65d69983-29f6-4381-80a3-f9ef2ec19e53.png)
4. Subscribe to only one data change of a type of sensor.
```
```js
import sensor from "@ohos.sensor";
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, function(data) {
sensor.once(sensor.SensorId.ACCELEROMETER, function(data) {
console.info("Data obtained successfully. x: " + data.x + "y: " + data.y + "z: " + data.z); // Data is obtained.
});
```
The following figure shows the successful call result when **SensorType** is **SENSOR_TYPE_ID_ACCELEROMETER**.
![en-us_image_0000001241733907](figures/en-us_image_0000001241733907.png)
![db5d017d-6c1c-4a71-a2dd-f74b7f23239e](figures/db5d017d-6c1c-4a71-a2dd-f74b7f23239e.png)
If the API fails to be called, you are advised to use the **try/catch** statement to capture error information that may occur in the code. Example:
```
```js
import sensor from "@ohos.sensor";
try {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, function(data) {
sensor.once(sensor.SensorId.ACCELEROMETER, function(data) {
console.info("Data obtained successfully. x: " + data.x + "y: " + data.y + "z: " + data.z); // Data is obtained.
});
} catch (error) {
console.error("Failed to get sensor data");
console.error("Get sensor data error. data:" + error.data, " msg:", error.message);
}
```
\ No newline at end of file
```
......@@ -3,32 +3,29 @@
Sensors in OpenHarmony are an abstraction of underlying sensor hardware. Your application can access the underlying sensor hardware via the sensors. Using the [Sensor](../reference/apis/js-apis-sensor.md) APIs, you can query sensors on your device, subscribe to sensor data, customize algorithms based on sensor data, and develop various sensor-based applications, such as compass, motion-controlled games, and fitness and health applications.
A sensor is a device to detect events or changes in an environment and send messages about the events or changes to another device (for example, a CPU). Generally, a sensor is composed of sensitive components and conversion components. Sensors are the cornerstone of the IoT. A unified sensor management framework is required to achieve data sensing at a low latency and low power consumption, thereby keeping up with requirements of "1+8+N" products or business in the Seamless AI Life Strategy. The sensor list is as follows:
| Type | Name | Description | Usage |
| --------------------------------------- | --------- | ---------------------------------------- | -------------------- |
| SENSOR_TYPE_ACCELEROMETER | Acceleration sensor | Measures the acceleration (including the gravity acceleration) applied to a device on three physical axes (X, Y, and Z), in the unit of m/s<sup>2</sup>.| Detecting the motion status |
| SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED | Uncalibrated acceleration sensor| Measures the uncalibrated acceleration (including the gravity acceleration) applied to a device on three physical axes (X, Y, and Z), in the unit of m/s<sup>2</sup>.| Measuring the acceleration bias estimation |
| SENSOR_TYPE_LINEAR_ACCELERATION | Linear acceleration sensor | Measures the linear acceleration (excluding the gravity acceleration) applied to a device on three physical axes (X, Y, and Z), in the unit of m/s<sup>2</sup>.| Detecting the linear acceleration in each axis |
| SENSOR_TYPE_GRAVITY | Gravity sensor | Measures the gravity acceleration applied to a device on three physical axes (X, Y, and Z), in the unit of m/s<sup>2</sup>.| Measuring the gravity |
| SENSOR_TYPE_GYROSCOPE | Gyroscope sensor | Measures the rotation angular velocity of a device on three physical axes (X, Y, and Z), in the unit of rad/s.| Measuring the rotation angular velocity |
| SENSOR_TYPE_GYROSCOPE_UNCALIBRATED | Uncalibrated gyroscope sensor| Measures the uncalibrated rotation angular velocity of a device on three physical axes (X, Y, and Z), in the unit of rad/s.| Measuring the bias estimation of the rotation angular velocity |
| SENSOR_TYPE_SIGNIFICANT_MOTION | Significant motion sensor | Checks whether a device has a significant motion on three physical axes (X, Y, and Z). The value **0** means that the device does not have a significant motion, and **1** means the opposite.| Detecting significant motions of a device |
| SENSOR_TYPE_PEDOMETER_DETECTION | Pedometer detection sensor | Detects whether a user takes a step. The value can be **0** (the user does not take a step) or **1** (the user takes a step).| Detecting whether a user takes a step |
| SENSOR_TYPE_PEDOMETER | Pedometer sensor | Records the number of steps a user has walked. | Providing the number of steps a user has walked |
| SENSOR_TYPE_AMBIENT_TEMPERATURE | Ambient temperature sensor | Measures the ambient temperature, in the unit of degree Celsius (°C). | Measuring the ambient temperature |
| SENSOR_TYPE_MAGNETIC_FIELD | Magnetic field sensor | Measures the magnetic field on three physical axes (X, Y, and Z), in the unit of μT.| Creating a compass |
| SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED | Uncalibrated magnetic field sensor | Measures the uncalibrated magnetic field on three physical axes (X, Y, and Z), in the unit of μT.| Measuring the magnetic field bias estimation |
| SENSOR_TYPE_HUMIDITY | Humidity sensor | Measures the ambient relative humidity, in a percentage (%). | Monitoring the dew point, absolute humidity, and relative humidity |
| SENSOR_TYPE_BAROMETER | Barometer sensor | Measures the barometric pressure, in the unit of hPa or mbar.| Measuring the barometric pressure |
| SENSOR_TYPE_ORIENTATION | Orientation sensor | Measures the rotation angles of a device on three physical axes (X, Y, and Z), in the unit of rad. | Providing the three orientation angles of the screen |
| SENSOR_TYPE_ROTATION_VECTOR | Rotation vector sensor | Measures the rotation vector of a device. It is a composite sensor that generates data from the acceleration sensor, magnetic field sensor, and gyroscope sensor. | Detecting the orientation of a device in the East, North, Up (ENU) Cartesian coordinate system |
| SENSOR_TYPE_PROXIMITY | Proximity sensor | Measures the distance between a visible object and the device screen. | Measuring the distance between a person and the device during a call |
| SENSOR_TYPE_AMBIENT_LIGHT | Ambient light sensor | Measures the ambient light intensity of a device, in the unit of lux. | Automatically adjusting the screen brightness and checking whether the screen is covered on the top|
| SENSOR_TYPE_HEART_RATE | Heart rate sensor | Measures the heart rate of a user. | Providing users' heart rate data |
| SENSOR_TYPE_WEAR_DETECTION | Wear detection sensor | Checks whether a user is wearing a wearable device. | Detecting wearables |
| SENSOR_TYPE_HALL | Hall effect sensor | Detects a magnetic field around a device. | Smart cover mode of the device |
| Type | Name | Description | Usage |
| --------------------------- | ------------------ | ------------------------------------------------------------ | ---------------------------------------- |
| ACCELEROMETER | Acceleration sensor | Measures the acceleration (including the gravity acceleration) applied to a device on three physical axes (X, Y, and Z), in the unit of m/s<sup>2</sup>.| Detecting the motion status |
| ACCELEROMETER_UNCALIBRATED | Uncalibrated acceleration sensor| Measures the uncalibrated acceleration (including the gravity acceleration) applied to a device on three physical axes (X, Y, and Z), in the unit of m/s<sup>2</sup>.| Measuring the acceleration bias estimation |
| LINEAR_ACCELERATION | Linear acceleration sensor | Measures the linear acceleration (excluding the gravity acceleration) applied to a device on three physical axes (X, Y, and Z), in the unit of m/s<sup>2</sup>.| Detecting the linear acceleration in each axis |
| GRAVITY | Gravity sensor | Measures the gravity acceleration applied to a device on three physical axes (X, Y, and Z), in the unit of m/s<sup>2</sup>.| Measuring the gravity |
| GYROSCOPE | Gyroscope sensor | Measures the rotation angular velocity of a device on three physical axes (X, Y, and Z), in the unit of rad/s.| Measuring the rotation angular velocity |
| GYROSCOPE_UNCALIBRATED | Uncalibrated gyroscope sensor| Measures the uncalibrated rotation angular velocity of a device on three physical axes (X, Y, and Z), in the unit of rad/s.| Measuring the bias estimation of the rotation angular velocity |
| SIGNIFICANT_MOTION | Significant motion sensor | Checks whether a device has a significant motion on three physical axes (X, Y, and Z). The value **0** means that the device does not have a significant motion, and **1** means the opposite.| Detecting significant motions of a device |
| PEDOMETER_DETECTION | Pedometer detection sensor | Detects whether a user takes a step. The value can be **0** (the user does not take a step) or **1** (the user takes a step).| Detecting whether a user takes a step |
| PEDOMETER | Pedometer sensor | Records the number of steps a user has walked. | Providing the number of steps a user has walked |
| AMBIENT_TEMPERATURE | Ambient temperature sensor | Measures the ambient temperature, in the unit of degree Celsius (°C). | Measuring the ambient temperature |
| MAGNETIC_FIELD | Magnetic field sensor | Measures the magnetic field on three physical axes (X, Y, and Z), in the unit of μT.| Creating a compass |
| MAGNETIC_FIELD_UNCALIBRATED | Uncalibrated magnetic field sensor | Measures the uncalibrated magnetic field on three physical axes (X, Y, and Z), in the unit of μT.| Measuring the magnetic field bias estimation |
| HUMIDITY | Humidity sensor | Measures the ambient relative humidity, in a percentage (%). | Monitoring the dew point, absolute humidity, and relative humidity |
| BAROMETER | Barometer sensor | Measures the barometric pressure, in the unit of hPa or mbar. | Measuring the barometric pressure |
| ORIENTATION | Orientation sensor | Measures the rotation angles of a device on three physical axes (X, Y, and Z), in the unit of rad.| Providing the three orientation angles of the screen |
| ROTATION_VECTOR | Rotation vector sensor | Measures the rotation vector of a device. It is a composite sensor that generates data from the acceleration sensor, magnetic field sensor, and gyroscope sensor.| Detecting the orientation of a device in the East, North, Up (ENU) Cartesian coordinate system |
| PROXIMITY | Proximity sensor | Measures the distance between a visible object and the device screen. | Measuring the distance between a person and the device during a call |
| AMBIENT_LIGHT | Ambient light sensor | Measures the ambient light intensity of a device, in the unit of lux. | Automatically adjusting the screen brightness and checking whether the screen is covered on the top|
| HEART_RATE | Heart rate sensor | Measures the heart rate of a user. | Providing users' heart rate data |
| WEAR_DETECTION | Wear detection sensor | Checks whether a user is wearing a wearable device. | Detecting wearables |
| HALL | Hall effect sensor | Detects a magnetic field around a device. | Smart cover mode of the device |
## Working Principles
......@@ -60,4 +57,3 @@ The following modules work cooperatively to implement OpenHarmony sensors: Senso
| Heart rate sensor | ohos.permission.READ_HEALTH_DATA | user_grant | Allows an application to read health data. |
2. The APIs for subscribing to and unsubscribing from sensor data work in pairs. If you do not need sensor data, call the unsubscription API to stop sensor data reporting.
......@@ -10,42 +10,55 @@ For details about the APIs, see [Vibrator](../reference/apis/js-apis-vibrator.md
## Available APIs
| Module | API | Description |
| ------------- | ---------------------------------------- | ------------------------------- |
| ohos.vibrator | vibrate(duration: number): Promise&lt;void&gt; | Triggers vibration with the specified duration. This API uses a promise to return the result. |
| ohos.vibrator | vibrate(duration: number, callback?: AsyncCallback&lt;void&gt;): void | Triggers vibration with the specified duration. This API uses a callback to return the result. |
| ohos.vibrator | vibrate(effectId: EffectId): Promise&lt;void&gt; | Triggers vibration with the specified effect. This API uses a promise to return the result. |
| ohos.vibrator | vibrate(effectId: EffectId, callback?: AsyncCallback&lt;void&gt;): void | Triggers vibration with the specified effect. This API uses a callback to return the result.|
| ohos.vibrator | stop(stopMode: VibratorStopMode): Promise&lt;void&gt;| Stops vibration. This API uses a promise to return the result. |
| ohos.vibrator | stop(stopMode: VibratorStopMode, callback?: AsyncCallback&lt;void&gt;): void | Stops vibration. This API uses a callback to return the result. |
| Module | API | Description |
| ------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| ohos.vibrator | startVibration(effect: VibrateEffect, attribute: VibrateAttribute): Promise&lt;void&gt; | Starts vibration with the specified effect and attribute. This API uses a promise to return the result.|
| ohos.vibrator | startVibration(effect: VibrateEffect, attribute: VibrateAttribute, callback: AsyncCallback&lt;void&gt;): void | Starts vibration with the specified effect and attribute. This API uses an asynchronous callback to return the result.|
| ohos.vibrator | stopVibration(stopMode: VibratorStopMode): Promise&lt;void&gt; | Stops vibration in the specified mode. This API uses a promise to return the result. |
| ohos.vibrator | stopVibration(stopMode: VibratorStopMode, callback: AsyncCallback&lt;void&gt;): void | Stops vibration in the specified mode. This API uses an asynchronous callback to return the result. |
## How to Develop
1. Before using the vibrator on a device, you must declare the **ohos.permission.VIBRATE** permission. For details about how to configure a permission, see [Declaring Permissions](../security/accesstoken-guidelines.md).
2. Trigger the device to vibrate.
2. Start vibration with the specified effect and attribute.
```
import vibrator from "@ohos.vibrator"
vibrator.vibrate(1000).then((error) => {
if (error) { // The call fails, and error.code and error.message are printed.
console.log("Promise return failed.error.code " + error.code + "error.message " + error.message);
} else { // The call is successful, and the device starts to vibrate.
console.log("Promise returned to indicate a successful vibration.")
}
})
```js
import vibrator from '@ohos.vibrator';
try {
vibrator.startVibration({
type: 'time',
duration: 1000,
}, {
id: 0,
usage: 'alarm'
}, (error) => {
if (error) {
console.error('vibrate fail, error.code: ' + error.code + 'error.message: ', + error.message);
return;
}
console.log('Callback returned to indicate a successful vibration.');
});
} catch (err) {
console.error('errCode: ' + err.code + ' ,msg: ' + err.message);
}
```
3. Stop the vibration.
3. Stop vibration in the specified mode.
```
import vibrator from "@ohos.vibrator"
vibrator.stop(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_PRESET).then((error) => {
if (error) { // The call fails, and error.code and error.message are printed.
console.log("Promise return failed.error.code " + error.code + "error.message " + error.message);
} else { // The call is successful, and the device stops vibrating.
console.log("Promise returned to indicate successful.");
}
})
```js
import vibrator from '@ohos.vibrator';
try {
// Stop vibration in VIBRATOR_STOP_MODE_TIME mode.
vibrator.stopVibration(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_TIME, function (error) {
if (error) {
console.log('error.code' + error.code + 'error.message' + error.message);
return;
}
console.log('Callback returned to indicate successful.');
})
} catch (err) {
console.info('errCode: ' + err.code + ' ,msg: ' + err.message);
}
```
......@@ -45,7 +45,7 @@ Use [Locale](../reference/apis/js-apis-intl.md#locale) APIs to maximize or minim
```js
var locale = "zh-CN";
var options = {caseFirst: false, calendar: "chinese", collation: "pinyin"};
var options = {caseFirst: "false", calendar: "chinese", collation: "pinyin"};
var localeObj = new intl.Locale(locale, options);
```
......@@ -347,4 +347,4 @@ The following sample is provided to help you better understand how to develop in
-[`International`: Internationalization (JS) (API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/International)
-[`International`: Internationalization (eTS) (API8) (Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/International)
-[`International`: Internationalization (ArkTS) (API8) (Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/International)
......@@ -5,3 +5,4 @@
- [Raw File Development](rawfile-guidelines.md)
- [Native Window Development](native-window-guidelines.md)
- [Using MindSpore Lite for Model Inference](mindspore-lite-guidelines.md)
- [Connecting the Neural Network Runtime to an AI Inference Framework](neural-network-runtime-guidelines.md)
# Development References
- [SystemCapability](syscap.md)
- [SysCap List](syscap-list.md)
- [Component Reference (ArkTS-based Declarative Development Paradigm)](arkui-ts/Readme-EN.md)
- [Component Reference (JavaScript-compatible Web-like Development Paradigm)](arkui-js/Readme-EN.md)
- [API Reference (JS and TS APIs)](apis/Readme-EN.md)
- [JS Service Widget UI Component Reference](js-service-widget-ui/Readme-EN.md)
- [API Reference (ArkTS and JS APIs)](apis/Readme-EN.md)
- [Error Codes](errorcodes/Readme-EN.md)
- API Reference (Native APIs)
- [Standard Libraries Supported by Native APIs](native-lib/Readme-EN.md)
......@@ -112,6 +112,8 @@ For details about the error codes, see [Screen Hopping Error Codes](../errorcode
**Example**
```js
let sinkDeviceDescriptor = "descriptor";
let srcInputDeviceId = 0;
try {
inputDeviceCooperate.start(sinkDeviceDescriptor, srcInputDeviceId, (error) => {
if (error) {
......@@ -160,6 +162,8 @@ For details about the error codes, see [Screen Hopping Error Codes](../errorcode
**Example**
```js
let sinkDeviceDescriptor = "descriptor";
let srcInputDeviceId = 0;
try {
inputDeviceCooperate.start(sinkDeviceDescriptor, srcInputDeviceId).then(() => {
console.log(`Start Keyboard mouse crossing success.`);
......@@ -249,6 +253,7 @@ Checks whether screen hopping is enabled. This API uses an asynchronous callback
**Example**
```js
let deviceDescriptor = "descriptor";
try {
inputDeviceCooperate.getState(deviceDescriptor, (error, data) => {
if (error) {
......@@ -324,7 +329,7 @@ try {
inputDeviceCooperate.on('cooperation', (data) => {
console.log(`Keyboard mouse crossing event: ${JSON.stringify(data)}`);
});
} catch (err) {
} catch (error) {
console.log(`Register failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
}
```
......@@ -342,7 +347,7 @@ Disables listening for screen hopping events.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------- | ---- | ---------------------------- |
| type | string | Yes | Event type. The value is **cooperation**. |
| callback | AsyncCallback<void> | No | Callback to be unregistered. If this parameter is not specified, all callbacks registered by the current application will be unregistered.|
| callback | AsyncCallback\<void> | No | Callback to be unregistered. If this parameter is not specified, all callbacks registered by the current application will be unregistered.|
......@@ -350,25 +355,25 @@ Disables listening for screen hopping events.
```js
// Unregister a single callback.
callback: function(event) {
function callback(event) {
console.log(`Keyboard mouse crossing event: ${JSON.stringify(event)}`);
return false;
}
try {
inputDeviceCooperate.on('cooperation', this.callback);
inputDeviceCooperate.off("cooperation", this.callback);
inputDeviceCooperate.on('cooperation', callback);
inputDeviceCooperate.off("cooperation", callback);
} catch (error) {
console.log(`Execute failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
}
```
```js
// Unregister all callbacks.
callback: function(event) {
function callback(event) {
console.log(`Keyboard mouse crossing event: ${JSON.stringify(event)}`);
return false;
}
try {
inputDeviceCooperate.on('cooperation', this.callback);
inputDeviceCooperate.on('cooperation', callback);
inputDeviceCooperate.off("cooperation");
} catch (error) {
console.log(`Execute failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
......
......@@ -197,12 +197,12 @@ Disables listening for hot swap events of an input device.
**Example**
```js
function callback(data) {
callback: function(data) {
console.log("type: " + data.type + ", deviceId: " + data.deviceId);
}
try {
inputDevice.on("change", callback);
inputDevice.on("change", this.callback);
} catch (error) {
console.info("oninputdevcie " + error.code + " " + error.message)
}
......@@ -212,7 +212,7 @@ inputDevice.on("change", listener);
// Disable this listener.
try {
inputDevice.off("change", callback);
inputDevice.off("change", this.callback);
} catch (error) {
console.info("offinputdevcie " + error.code + " " + error.message)
}
......@@ -333,7 +333,7 @@ inputDevice.getDevice(1).then((inputDevice)=>{
## inputDevice.supportKeys<sup>9+</sup>
supportKeys(deviceId: number, keys: Array&lt;KeyCode&gt;, callback: Callback&lt;Array&lt;boolean&gt;&gt;): void
supportKeys(deviceId: number, keys: Array&lt;KeyCode&gt;, callback: AsyncCallback &lt;Array&lt;boolean&gt;&gt;): void
Obtains the key codes supported by the input device. This API uses an asynchronous callback to return the result.
......@@ -345,7 +345,7 @@ Obtains the key codes supported by the input device. This API uses an asynchrono
| -------- | ------------------------------------ | ---- | --------------------------------- |
| deviceId | number | Yes | Unique ID of the input device. If the same physical device is repeatedly inserted and removed, its ID changes.|
| keys | Array&lt;KeyCode&gt; | Yes | Key codes to be queried. A maximum of five key codes can be specified. |
| callback | Callback&lt;Array&lt;boolean&gt;&gt; | Yes | Callback used to return the result. |
| callback | AsyncCallback&lt;Array&lt;boolean&gt;&gt; | Yes | Callback used to return the result. |
**Example**
......
# MediaLibrary
# @ohos.multimedia.medialibrary (Media Library Management)
> **NOTE**
>
> The APIs of this module are supported since API version 6. Updates will be marked with a superscript to indicate their earliest API version.
## Modules to Import
......@@ -193,7 +192,7 @@ media.getFileAssets(imagesFetchOp).then(function(fetchFileResult) {
### on<sup>8+</sup>
on(type: 'deviceChange'|'albumChange'|'imageChange'|'audioChange'|'videoChange'|'fileChange'|'remoteFileChange', callback: Callback&lt;void&gt;): void
on(type: 'deviceChange'&#124;'albumChange'&#124;'imageChange'&#124;'audioChange'&#124;'videoChange'&#124;'fileChange'&#124;'remoteFileChange', callback: Callback&lt;void&gt;): void
Subscribes to the media library changes. This API uses an asynchronous callback to return the result.
......@@ -215,7 +214,7 @@ media.on('imageChange', () => {
```
### off<sup>8+</sup>
off(type: 'deviceChange'|'albumChange'|'imageChange'|'audioChange'|'videoChange'|'fileChange'|'remoteFileChange', callback?: Callback&lt;void&gt;): void
off(type: 'deviceChange'&#124;'albumChange'&#124;'imageChange'&#124;'audioChange'&#124;'videoChange'&#124;'fileChange'&#124;'remoteFileChange', callback?: Callback&lt;void&gt;): void
Unsubscribes from the media library changes. This API uses an asynchronous callback to return the result.
......@@ -885,7 +884,7 @@ Obtains information about online peer devices. This API uses a promise to return
| Type | Description |
| ------------------- | -------------------- |
| Promise\<Array\<PeerInfo>> | Promise used to return the online peer devices, in an array of **PeerInfo** objects.|
| Promise\<Array\<[PeerInfo](#peerinfo8)>> | Promise used to return the online peer devices, in an array of **PeerInfo** objects.|
**Example**
......@@ -921,7 +920,7 @@ Obtains information about online peer devices. This API uses an asynchronous cal
| Type | Description |
| ------------------- | -------------------- |
| callback: AsyncCallback\<Array\<PeerInfo>> | Promise used to return the online peer devices, in an array of **PeerInfo** objects.|
| callback: AsyncCallback\<Array\<[PeerInfo](#peerinfo8)>> | Promise used to return the online peer devices, in an array of **PeerInfo** objects.|
**Example**
......@@ -956,7 +955,7 @@ Obtains information about all peer devices. This API uses a promise to return th
| Type | Description |
| ------------------- | -------------------- |
| Promise\<Array\<PeerInfo>> | Promise used to return all peer devices, in an array of **PeerInfo** objects.|
| Promise\<Array\<[PeerInfo](#peerinfo8)>> | Promise used to return all peer devices, in an array of **PeerInfo** objects.|
**Example**
......@@ -992,7 +991,7 @@ Obtains information about online peer devices. This API uses an asynchronous cal
| Type | Description |
| ------------------- | -------------------- |
| callback: AsyncCallback\<Array\<PeerInfo>> | Promise used to return all peer devices, in an array of **PeerInfo** objects.|
| callback: AsyncCallback\<Array\<[PeerInfo](#peerinfo8)>> | Promise used to return all peer devices, in an array of **PeerInfo** objects.|
**Example**
......@@ -1014,6 +1013,11 @@ async function example() {
Provides APIs for encapsulating file asset attributes.
> **NOTE**
>
> 1. The system attempts to parse the file content if the file is an audio or video file. The actual field values will be restored from the passed values during scanning on some devices.
> 2. Some devices may not support the modification of **orientation**. You are advised to use [ModifyImageProperty](js-apis-image.md#modifyimageproperty9) of the **image** module.
### Attributes
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -1025,7 +1029,7 @@ Provides APIs for encapsulating file asset attributes.
| mimeType | string | Yes | No | Extended file attributes. |
| mediaType<sup>8+</sup> | [MediaType](#mediatype8) | Yes | No | Media type. |
| displayName | string | Yes | Yes | Display file name, including the file name extension. |
| title | string | Yes | Yes | Title in the file. |
| title | string | Yes | Yes | Title in the file. By default, it carries the file name without extension. |
| relativePath<sup>8+</sup> | string | Yes | Yes | Relative public directory of the file. |
| parent<sup>8+</sup> | number | Yes | No | Parent directory ID. |
| size | number | Yes | No | File size, in bytes. |
......@@ -2486,29 +2490,33 @@ Enumerates media types.
Enumerates key file information.
> **NOTE**
>
> The **bucket_id** field may change after file rename or movement. Therefore, you must obtain the field again before using it.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
| Name | Value | Description |
| ------------- | ------------------- | ---------------------------------------------------------- |
| ID | file_id | File ID. |
| RELATIVE_PATH | relative_path | Relative public directory of the file. |
| DISPLAY_NAME | display_name | Display file name. |
| PARENT | parent | Parent directory ID. |
| MIME_TYPE | mime_type | Extended file attributes. |
| MEDIA_TYPE | media_type | Media type. |
| SIZE | size | File size, in bytes. |
| DATE_ADDED | date_added | Date when the file was added. (The value is the number of seconds elapsed since the Epoch time.) |
| DATE_MODIFIED | date_modified | Date when the file was modified. (The value is the number of seconds elapsed since the Epoch time.) |
| DATE_TAKEN | date_taken | Date when the file (photo) was taken. (The value is the number of seconds elapsed since the Epoch time.) |
| TITLE | title | Title in the file. |
| ARTIST | artist | Artist of the file. |
| AUDIOALBUM | audio_album | Audio album. |
| DURATION | duration | Duration, in ms. |
| WIDTH | width | Image width, in pixels. |
| HEIGHT | height | Image height, in pixels. |
| ORIENTATION | orientation | Image display direction (clockwise rotation angle, for example, 0, 90, and 180, in degrees).|
| ALBUM_ID | bucket_id | ID of the album to which the file belongs. |
| ALBUM_NAME | bucket_display_name | Name of the album to which the file belongs. |
| ID | "file_id" | File ID. |
| RELATIVE_PATH | "relative_path" | Relative public directory of the file. |
| DISPLAY_NAME | "display_name" | Display file name. |
| PARENT | "parent" | Parent directory ID. |
| MIME_TYPE | "mime_type" | Extended file attributes. |
| MEDIA_TYPE | "media_type" | Media type. |
| SIZE | "size" | File size, in bytes. |
| DATE_ADDED | "date_added" | Date when the file was added. (The value is the number of seconds elapsed since the Epoch time.) |
| DATE_MODIFIED | "date_modified" | Date when the file was modified. (The value is the number of seconds elapsed since the Epoch time.) |
| DATE_TAKEN | "date_taken" | Date when the file (photo) was taken. (The value is the number of seconds elapsed since the Epoch time.) |
| TITLE | "title" | Title in the file. |
| ARTIST | "artist" | Artist of the file. |
| AUDIOALBUM | "audio_album" | Audio album. |
| DURATION | "duration" | Duration, in ms. |
| WIDTH | "width" | Image width, in pixels. |
| HEIGHT | "height" | Image height, in pixels. |
| ORIENTATION | "orientation" | Image display direction (clockwise rotation angle, for example, 0, 90, and 180, in degrees).|
| ALBUM_ID | "bucket_id" | ID of the album to which the file belongs. |
| ALBUM_NAME | "bucket_display_name" | Name of the album to which the file belongs. |
## DirectoryType<sup>8+</sup>
......@@ -2573,8 +2581,6 @@ Describes the image size.
Implements the media asset option.
> **NOTE**
>
> This API is deprecated since API version 9.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -2598,5 +2604,5 @@ Describes media selection option.
| Name | Type | Readable| Writable| Description |
| ----- | ------ | ---- | ---- | -------------------- |
| type | string | Yes | Yes | Media type, which can be **image**, **media**, or **video**. Currently, only **media** is supported.|
| type | 'image' &#124; 'video' &#124; 'media' | Yes | Yes | Media type, which can be **image**, **media**, or **video**. Currently, only **media** is supported.|
| count | number | Yes | Yes | Number of media assets selected. The value starts from 1, which indicates that one media asset can be selected. |
......@@ -2,10 +2,9 @@
The **storageStatistics** module provides APIs for obtaining storage space information, including the space of built-in and plug-in memory cards, space occupied by different types of data, and space of application data.
> **NOTE**<br/>
> **NOTE**
>
> - The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - API version 9 is a canary version for trial use. The APIs of this version may be unstable.
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
......
......@@ -23,7 +23,7 @@ Obtains a **UserFileManager** instance. This instance can be used to access and
| Name | Type | Mandatory| Description |
| ------- | ------- | ---- | -------------------------- |
| context | [Context](#../apis/js-apis-Context.md) | Yes | Context of the ability instance.|
| context | [Context](../apis/js-apis-inner-app-context.md) | Yes | Context of the ability instance.|
**Return value**
......@@ -1210,7 +1210,7 @@ Obtains the thumbnail of this file asset. This API uses an asynchronous callback
| Name | Type | Mandatory | Description |
| -------- | ----------------------------------- | ---- | ---------------- |
| callback | AsyncCallback&lt;[image.PixelMap](#../apis/js-apis-image.md#pixelmap7)&gt; | Yes | Callback invoked to return the pixel map of the thumbnail.|
| callback | AsyncCallback&lt;[image.PixelMap](../apis/js-apis-image.md#pixelmap7)&gt; | Yes | Callback invoked to return the pixel map of the thumbnail.|
**Example**
......@@ -1248,7 +1248,7 @@ Obtains the file thumbnail of the given size. This API uses an asynchronous call
| Name | Type | Mandatory | Description |
| -------- | ----------------------------------- | ---- | ---------------- |
| size | [Size](#size) | Yes | Size of the thumbnail to obtain. |
| callback | AsyncCallback&lt;[image.PixelMap](#../apis/js-apis-image.md#pixelmap7)&gt; | Yes | Callback invoked to return the pixel map of the thumbnail.|
| callback | AsyncCallback&lt;[image.PixelMap](../apis/js-apis-image.md#pixelmap7)&gt; | Yes | Callback invoked to return the pixel map of the thumbnail.|
**Example**
......@@ -1292,7 +1292,7 @@ Obtains the file thumbnail of the given size. This API uses a promise to return
| Type | Description |
| ----------------------------- | --------------------- |
| Promise&lt;[image.PixelMap](#../apis/js-apis-image.md#pixelmap7)&gt; | Promise used to return the pixel map of the thumbnail.|
| Promise&lt;[image.PixelMap](../apis/js-apis-image.md#pixelmap7)&gt; | Promise used to return the pixel map of the thumbnail.|
**Example**
......
......@@ -52,7 +52,7 @@ Not supported
```
![zh-cn_image_0000001173324703](figures/zh-cn_image_0000001173324703.gif)
![zh-cn_image_0000001173324703](figures/en-us_image_0000001173324703.gif)
```html
......@@ -68,7 +68,7 @@ Not supported
```
![zh-cn_image_0000001167662852](figures/zh-cn_image_0000001167662852.gif)
![zh-cn_image_0000001167662852](figures/en-us_image_0000001167662852.gif)
```html
......@@ -83,7 +83,7 @@ Not supported
```
![zh-cn_image_0000001127284938](figures/zh-cn_image_0000001127284938.gif)
![zh-cn_image_0000001127284938](figures/en-us_image_0000001127284938.gif)
```html
......
# Update Error Codes
## 11500104 IPC Error
**Error Message**
BusinessError 11500104: IPC error.
**Description**
This error code is reported if an exception is thrown during an IPC call.
**Possible Causes**
An IPC API call failed.
**Solution**
1. Check whether the update system ability has started. If not, start it.
2. Check whether IPC data conversion is normal. If not, check the conversion process.
# SysCap
# SystemCapability
## Overview
### System Capabilities and APIs
SysCap is short for System Capability. It refers to a standalone feature in the operating system, for example, Bluetooth, Wi-Fi, NFC, or camera. Each SysCap corresponds to a set of bound APIs, whose availability depends on the support of the target device. Such a set of APIs can be provided in DevEco Studio for association.
SysCap is short for SystemCapability. It refers to a standalone feature in the operating system, for example, Bluetooth, Wi-Fi, NFC, or camera. Each SysCap corresponds to a set of APIs, whose availability depends on the support of the target device. Such a set of APIs can be provided in DevEco Studio for association.
![image-20220326064841782](figures/image-20220326064841782.png)
For details about the SysCap sets in OpenHarmony, see [SysCap List](../reference/syscap-list.md).
### Supported SysCap Set, Associated SysCap Set, and Required SysCap Set
The supported SysCap set, associated SysCap set, and required SysCap set are collections of SysCaps.
......@@ -20,8 +18,6 @@ The associated SysCap set covers the system capabilities of associated APIs that
![image-20220326064913834](figures/image-20220326064913834.png)
### Devices and Supported SysCap Sets
Each device provides a SysCap set that matches its hardware capability.
......@@ -29,24 +25,18 @@ The SDK classifies devices into general devices and custom devices. The general
![image-20220326064955505](figures/image-20220326064955505.png)
### Mapping Between Devices and SDK Capabilities
The SDK provides a full set of APIs for DevEco Studio. DevEco Studio identifies the supported SysCap set based on the devices supported by the project, filters the APIs contained in the SysCap set, and provides the supported APIs for association (to autocomplete input).
The SDK provides a full set of APIs for DevEco Studio. DevEco Studio identifies the supported SysCap set based on the devices selected for the project, filters the APIs contained in the SysCap set, and provides the supported APIs for association (to autocomplete input).
![image-20220326065043006](figures/image-20220326065043006.png)
## How to Develop
### Obtaining the PCID
The Product Compatibility ID (PCID) contains the SysCap information supported by the current device. For the moment, you can obtain the PCID of a device from the device vendor. In the future, you'll be able to obtain the PCIDs of all devices from the authentication center, which is in development.
### Importing the PCID
DevEco Studio allows Product Compatibility ID (PCID) imports for projects. After the imported PCID file is decoded, the SysCap is output and written into the **syscap.json** file.
......@@ -55,8 +45,6 @@ Right-click the project directory and choose **Import Product Compatibility ID**
![20220329-103626](figures/20220329-103626.gif)
### Configuring the Associated SysCap Set and Required SysCap Set
DevEco Studio automatically configures the associated SysCap set and required SysCap set based on the settings supported by the created project. You can modify these SysCap sets when necessary.
......@@ -91,51 +79,44 @@ Exercise caution when modifying the required SysCap set. Incorrect modifications
}
```
### Single-Device Application Development
By default, the associated SysCap set and required SysCap set of the application are the same as the supported SysCap set of the device. Exercise caution when modifying the required SysCap set.
![image-20220326065124911](figures/image-20220326065124911.png)
### Cross-Device Application Development
By default, the associated SysCap set of an application is the union of multiple devices' supported SysCap sets, while the required SysCap set is the intersection of the devices' supported SysCap sets.
![image-20220326065201867](figures/image-20220326065201867.png)
### Checking Whether an API Is Available
Use **canIUse** if you want to check whether a project supports a specific SysCap.
- Method 1: Use the **canIUse** API predefined in OpenHarmony.
```
if (canIUse("SystemCapability.ArkUI.ArkUI.Full")) {
console.log("This application supports SystemCapability.ArkUI.ArkUI.Full.");
} else {
console.log("This application does not support SystemCapability.ArkUI.ArkUI.Full".);
}
```
You can import a module using the **import** API. If the current device does not support the module, the import result is **undefined**. Before using an API, you must make sure the API is available.
```
if (canIUse("SystemCapability.ArkUI.ArkUI.Full")) {
console.log("This application supports SystemCapability.ArkUI.ArkUI.Full.");
} else {
console.log("This application does not support SystemCapability.ArkUI.ArkUI.Full".);
}
```
```
import geolocation from '@ohos.geolocation';
if (geolocation) {
geolocation.getCurrentLocation((location) => {
console.log(location.latitude, location.longitude);
});
} else {
console.log('This device does not support location information.');
}
```
- Method 2: Import a module using the **import** API. If the current device does not support the module, the import result is **undefined**. Before using an API, you must make sure the API is available.
```
import geolocation from '@ohos.geolocation';
if (geolocation) {
geolocation.getCurrentLocation((location) => {
console.log(location.latitude, location.longitude);
});
} else {
console.log('This device does not support location information.');
}
```
You can also find out the SysCap to which an API belongs by referring to the API reference document.
### Checking the Differences Between Devices with a Specific SysCap
......@@ -159,7 +140,6 @@ authenticator.execute('FACE_ONLY', 'S1', (err, result) => {
})
```
### How Do SysCap Differences Arise Between Devices
The device SysCaps in product solutions vary according to the component combination defined by the product solution vendor. The following figure shows the overall process.
......
......@@ -19,7 +19,6 @@ Typical operations involve the following:
**Available APIs**
For details about the APIs, see [Certificate](../reference/apis/js-apis-cert.md).
The table below describes the APIs used in this guide.
......@@ -172,7 +171,6 @@ Typical operations involve the following:
**Available APIs**
For details about the APIs, see [Certificate](../reference/apis/js-apis-cert.md).
The table below describes the APIs used in this guide.
......@@ -320,7 +318,6 @@ You need to use the certificate chain validator in certificate chain verificatio
**Available APIs**
For details about the APIs, see [Certificate](../reference/apis/js-apis-cert.md).
The table below describes the APIs used in this guide.
......@@ -432,7 +429,6 @@ Typical operations involve the following:
**Available APIs**
For details about the APIs, see [Certificate](../reference/apis/js-apis-cert.md).
The table below describes the APIs used in this guide.
......
......@@ -7,7 +7,7 @@ This document describes how code contributors, committers, and PMC members in th
3. Copyright and license header
## Scope
This document applies only to the OpenHarmony community. It is not applicable to the scenario where the OpenHarmony project is used by individuals or enterprises to develop their products or the scenario where third-party open-source software is introduced. For details, see [Introducing Third-Party Open-Source Software](introducing-third-party-open-source-software.md).
This document applies only to the OpenHarmony community. It is not applicable to the scenario where the OpenHarmony project is used by individuals or enterprises to develop their products or the scenario where third-party open-source software is introduced.
## Improvements and Revisions
1. This document is drafted and maintained by the OpenHarmony PMC. What you are reading now is the latest version of this document.
......
......@@ -5,22 +5,22 @@
### WLAN
The Wireless Local Area Network (WLAN) Driver module in OpenHarmony is developed based on the Hardware Driver Foundation (HDF). It provides cross-OS porting, self-adaptation to component differences, and module assembly and building.
The Wireless Local Area Network (WLAN) driver module is developed based on OpenHarmony Hardware Driver Foundation (HDF). It supports modular assembly and building, automatic adaptation to device differences, and cross-OS porting.
### Working Principles
You can adapt your driver code based on the unified interfaces provided by the WLAN module. The WLAN module provides:
You can modify your driver code based on the unified APIs provided by the WLAN module. The WLAN module provides:
- A unified underlying interface to implement capabilities, such as setting up or closing a WLAN hotspot, scanning hotspots, and connecting to or disconnecting from a hotspot.
- A unified interface to the Hardware Device Interface (HDI) layer to implement capabilities, such as setting or obtaining the device Media Access Control (MAC) address and setting the transmit power.
- APIs for the underlying layer to implement capabilities, such as opening or closing a WLAN hotspot, scanning hotspots, and connecting to or disconnecting from a hotspot.
- APIs for the Hardware Device Interface (HDI) layer to implement capabilities, such as setting or obtaining the device Media Access Control (MAC) address and setting the transmit power.
The figure below shows the WLAN architecture. The WLAN Driver module implements startup loading, parses configuration files, and provides bus abstraction APIs. The WLAN Chip Driver module provides the MAC Sublayer Management Entity (MLME).
The following figure shows the WLAN architecture. The WLAN driver module implements startup loading, parses configuration files, and provides bus abstraction APIs. The WLAN chip driver module provides the MAC Sublayer Management Entity (MLME).
**Figure 1** WLAN architecture
![image](figures/WLAN_architecture.png "WLAN architecture")
The figure below shows the WLAN driver architecture.
The following figure shows the WLAN driver architecture.
**Figure 2** WLAN driver architecture
......@@ -32,11 +32,11 @@ The WLAN driver consists of the following modules:
2. WLAN Configuration Core: parses WLAN configuration files.
3. Access point (AP): provides a WLAN access interface for devices.
3. Access point (AP): allows devices to connect to the WLAN.
4. Station (STA): a terminal that accesses the WLAN system.
4. Station (STA): a device that has access to the WLAN system and allows transmission and reception of data.
5. mac80211: defines MAC-layer interfaces for underlying drivers.
5. mac80211: defines MAC-layer APIs for underlying drivers.
6. Bus: provides a unified bus abstract interface for the upper layer. It shields the differences between different kernels by calling the Secure Digital Input Output (SDIO) interfaces provided by the platform layer and encapsulating the adapted USB and PCIe interfaces. It also encapsulates different types of bus operations in a unified manner to shield differences between different chipsets. The complete bus driving capabilities provided by the bus module help simplify and streamline the development of different chip vendors.
......@@ -58,13 +58,13 @@ The relationships between the main modules are as follows:
4. The protocol stack works with the NetDevice, NetBuf, and FlowCtl modules to exchange data flows.
## Development Guidelines
## How to Develop
### Available APIs
The WLAN module provides the following types of APIs:
1. Hardware Device Interface (HDI) and Hardware Abstraction Layer (HAL) APIs for upper-layer services
1. HDI and Hardware Abstraction Layer (HAL) APIs for upper-layer services
2. APIs for vendors
......@@ -75,7 +75,7 @@ The WLAN module provides the following types of APIs:
![image](figures/WLAN_driver_APIs.png "WLAN Driver APIs")
- The WLAN module provides HAL APIs for upper-layer services (applicable to small and mini systems). **Table 2** and **Table 3** describe some APIs.
- The WLAN module provides HAL APIs for upper-layer services (applicable to small and mini systems). **Table 1** and **Table 2** describe some APIs.
**Table 1** wifi_hal.h
......@@ -95,7 +95,7 @@ The WLAN module provides the following types of APIs:
| int32_t (\*getDeviceMacAddress)(const struct IWiFiBaseFeature \*, unsigned char \*, uint8_t)| Obtains the device MAC address.|
| int32_t (\*setTxPower)(const struct IWiFiBaseFeature \*, int32_t)| Sets the transmit power.|
- The WLAN Driver module also provides APIs that you need to fill in the implementation. **Table 4** describes some APIs.
- The WLAN Driver module also provides APIs that you need to fill in the implementation. **Table 3** describes some APIs.
**Table 3** net_device.h
......@@ -110,7 +110,7 @@ The WLAN module provides the following types of APIs:
- The WLAN Driver module provides APIs that you can directly use to create or release a **WifiModule**, connect to or disconnect from a WLAN hotspot, request or release a **NetBuf**, and convert between the **pbuf** structure of Lightweight IP (lwIP) and a **NetBuf**.
Tables 5 to 7 describe the APIs.
The following tables describe the APIs.
**Table 4** wifi_module.h
......@@ -119,7 +119,7 @@ The WLAN module provides the following types of APIs:
| struct WifiModule \*WifiModuleCreate(const struct HdfConfigWifiModuleConfig \*config)| Creates a **WifiModule**.|
| void WifiModuleDelete(struct WifiModule \*module)| Deletes a **WifiModule** and releases its data.|
| int32_t DelFeature(struct WifiModule \*module, uint16_t featureType)| Deletes a feature from a **WifiModule**.|
| int32_t AddFeature(struct WifiModule \*module, uint16_t featureType, struct WifiFeature \*featureData)| Adds a feature to a **WifiModule**.|
| int32_t AddFeature(struct WifiModule \*module, uint16_t featureType,<br> struct WifiFeature \*featureData)| Adds a feature to a **WifiModule**.|
**Table 5** wifi_mac80211_ops.h
......@@ -136,11 +136,11 @@ The WLAN module provides the following types of APIs:
| -------- | -------- |
| static inline void NetBufQueueInit(struct NetBufQueue \*q)| Initializes a **NetBuf** queue.|
| struct NetBuf \*NetBufAlloc(uint32_t size)| Allocates a **NetBuf**.|
| void NetBufFree(struct NetBuf \*nb) | Releases a **NetBuf**.|
| void NetBufFree(struct NetBuf \*nb)| Releases a **NetBuf**.|
| struct NetBuf \*Pbuf2NetBuf(const struct NetDevice \*netdev, struct pbuf \*lwipBuf)| Converts the **pbuf** structure of lwIP to a **NetBuf**.|
| struct pbuf \*NetBuf2Pbuf(const struct NetBuf \*nb)| Converts a **NetBuf** to the **pbuf** structure of lwIP.|
### How to Develop
### Development Procedure
#### WLAN Framework Adaptation
The WLAN driver framework developed based on the HDF and Platform framework provides a unified driver model regardless of the OS and system on a chip (SoC). When developing your WLAN driver, you need to configure data based on the WLAN driver framework.
......@@ -186,19 +186,19 @@ The following uses the Hi3881 WLAN chip as an example to describe how to initial
}
}
reset {
resetType = 0; /* Reset type. The value 0 indicates that reset is dynamically determined, and 1 indicates reset through GPIO. */
gpioId = 2; /* GPIO pin number. */
activeLevel=1; /* Active level. The value 0 indicates low level, and 1 indicates high level. */
resetHoldTime = 30; /* Hold time (ms) after a reset. */
resetType = 0; /* Reset type. The value 0 indicates that reset is dynamically determined, and 1 indicates reset through GPIO. */
gpioId = 2; /* GPIO pin number. */
activeLevel=1; /* Active level. The value 0 indicates low level, and 1 indicates high level. */
resetHoldTime = 30; /* Hold time (ms) after a reset. */
}
bootUpTimeout = 30; /* Boot timeout duration (ms). */
bootUpTimeout = 30; /* Boot timeout duration (ms). */
bus {
busEnable = 1; /* Whether to initialize the bus. The value 1 means to initialize the bus; the value 0 means the opposite. */
busType = 0; /* Bus type. The value 0 indicates SDIO. */
busId = 2; /* Bus number. */
funcNum = [1]; /* SDIO function number. */
timeout = 1000; /* Timeout duration for data read/write. */
blockSize = 512; /* Size of the data block to read or write. */
busEnable = 1; /* Whether to initialize the bus. The value 1 means to initialize the bus; the value 0 means the opposite. */
busType = 0; /* Bus type. The value 0 indicates SDIO. */
busId = 2; /* Bus number. */
funcNum = [1]; /* SDIO function number. */
timeout = 1000; /* Timeout duration for data read/write. */
blockSize = 512; /* Size of the data block to read or write. */
}
}
}
......@@ -546,11 +546,7 @@ The following uses the Hi3881 WLAN chip as an example to describe how to initial
}
```
4. Invoke the event reporting APIs.
The WLAN framework provides the event reporting APIs. For details, see **hdf_wifi_event.c**.
For example, call **HdfWiFiEventNewSta AP** to report information about the newly associated STA.
4. Invoke the event reporting APIs. <br>The WLAN framework provides the event reporting APIs. For details, see hdf_wifi_event.c. <br>For example, call **HdfWiFiEventNewSta AP** to report information about the newly associated STA.
```c
hi_u32 oal_cfg80211_new_sta(oal_net_device_stru *net_device, const hi_u8 *mac_addr, hi_u8 addr_len,
......@@ -567,12 +563,10 @@ The following uses the Hi3881 WLAN chip as an example to describe how to initial
hi_unref_param(en_gfp);
hi_unref_param(addr_len);
#endif
return HI_SUCCESS;
}
```
**Verification**
Develop test cases in the WLAN module unit test to verify the basic features of the WLAN module. The following uses Hi3516D V300 standard system as an example.
......@@ -650,7 +644,7 @@ Develop test cases in the WLAN module unit test to verify the basic features of
exit 0
```
- Create a **udhcpd.conf** file (used to start the **udhcpd**) and copy the following content to the file. In the following, **opt dns** *x.x.x.x* *x.x.x.x* indicates two DNS servers configured. You can configure DNS servers as required.
- Create a **udhcpd.conf** file (used to start the **udhcpd**) and copy the following content to the file. <br>In the following, **opt dns** *x.x.x.x* *x.x.x.x* indicates two DNS servers configured. You can configure DNS servers as required.
```text
start 192.168.12.2
......@@ -704,54 +698,44 @@ Develop test cases in the WLAN module unit test to verify the basic features of
busybox udhcpd /vendor/etc/udhcpd.conf
```
4. On the mobile phone, select the network named **test** in the available Wi-Fi list and enter the password.
The network name and password are configured in the **hostapd.conf** file. You can see that network name in the connected Wi-Fi list if the connection is successful.
4. On the mobile phone, select the network named **test** in the available Wi-Fi list and enter the password. <br>The network name and password are configured in the **hostapd.conf** file. You can see that network name in the connected Wi-Fi list if the connection is successful.
5. Ping the test terminal from the development board.
```shell
busybox ping xxx.xxx.xxx.xxx
```
In the command, xxx.xxx.xxx.xxx indicates the IP address of the test terminal. If the test terminal can be pinged, the WLAN driver provides basic features normally.
In the command, *xxx.xxx.xxx.xxx* indicates the IP address of the test terminal. If the test terminal can be pinged, the WLAN driver provides basic features normally.
- Verify basic STA features.
1. Start the STA on the development board, and enable the hotspot on the test terminal.
The hotspot name and password are configured in the **hostapd.conf** file. The hotspot name is **test**, and the password is **12345678**.
1. Start the STA on the development board, and enable the hotspot on the test terminal. <br>The hotspot name and password are configured in the **hostapd.conf** file. The hotspot name is **test**, and the password is **12345678**.
2. Run the following command in the **cmd** window:
```shell
hdc shell
wpa_supplicant -i wlan0 -d -c wpa_supplicant.conf
```
3. Run the following commands in another **cmd** window:
```shell
hdc shell
mount -o rw,remount /
mount -o rw,remount /vendor
busybox udhcpc -i wlan0 -s system/lib/dhcpc.sh
```
The IP addresses of the board and test terminal are displayed if the command is successful.
4. Ping the test terminal from the development board.
```shell
busybox ping xxx.xxx.xxx.xxx
```
In the command, *xxx.xxx.xxx.xxx* indicates the IP address of the test terminal. If the test terminal can be pinged, the WLAN driver provides basic features normally.
In the command, xxx.xxx.xxx.xxx indicates the IP address of the test terminal. If the test terminal can be pinged, the WLAN driver provides basic features normally.
#### **API Invocation**
The WLAN driver module provides two types of capability interfaces for the upper layer: HDI interface and HAL interface.
......@@ -963,19 +947,17 @@ The WLAN driver module provides two types of capability interfaces for the upper
- Code paths:
- Adaptation of WLAN FlowCtl component on LiteOS: **//drivers/hdf_core/adapter/khdf/liteos/model/network/wifi**
- Adaptation of HDF network model on LiteOS: **//drivers/hdf_core/adapter/khdf/liteos/model/network**
- Adaptation of WLAN FlowCtl component on Linux, build of the HDF WLAN model, and build of the vendor's WLAN driver: **//drivers/hdf_core/adapter/khdf/linux/model/network/wifi**
- Core code for implementing the WLAN module: **//drivers/hdf_core/framework/model/network/wifi**
- External APIs of the WLAN module: **//drivers/hdf_core/framework/include/wifi**
- HDF network model APIs: **//drivers/hdf_core/framework/include/net**
- WLAN HDI server implementation: **//drivers/peripheral/wlan**
Adaptation of WLAN FlowCtl component on LiteOS: **//drivers/hdf_core/adapter/khdf/liteos/model/network/wifi**
Adaptation of HDF network model on LiteOS: **//drivers/hdf_core/adapter/khdf/liteos/model/network**
Adaptation of WLAN FlowCtl component on Linux, build of the HDF WLAN model, and build of the vendor's WLAN driver: **//drivers/hdf_core/adapter/khdf/linux/model/network/wifi**
Core code for implementing the WLAN module: **//drivers/hdf_core/framework/model/network/wifi**
External APIs of the WLAN module: **//drivers/hdf_core/framework/include/wifi**
HDF network model APIs: **//drivers/hdf_core/framework/include/net**
WLAN HDI server implementation: **//drivers/peripheral/wlan**
......@@ -108,7 +108,7 @@ To keep pace with the rapid development of the IoT industry, the OpenHarmony lig
**Figure 4** LiteOS-A kernel architecture
![](figures/architecture-of-the-openharmony-liteos-a-kernel.png "architecture-of-the-openharmony-liteos-a-kernel")
![](figures/Liteos-a-architecture.png "Liteos-a-architecture.png")
### How to Use
......
此差异已折叠。
# BundleStatusCallback
> **说明:**
> 从API version 9开始不再支持。建议使用[bundleMonitor](js-apis-bundleMonitor.md)替代
> 本模块首批接口从API version 8 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本
应用状态回调的信息,通过接口[innerBundleManager.on](js-apis-Bundle-InnerBundleManager.md)获取。
应用状态发生变化时回调的信息,通过接口[innerBundleManager.on](js-apis-Bundle-InnerBundleManager.md)获取。
## BundleStatusCallback<sup>(deprecated)<sup>
......
......@@ -587,7 +587,7 @@ requestPermissionsFromUser(context: Context, permissions: Array&lt;Permissions&g
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager();
try {
atManager.requestPermissionsFromUser(this.context, ["ohos.permission.MANAGE_DISPOSED_APP_STATUS"], (err, data)=>{
atManager.requestPermissionsFromUser(this.context, ["ohos.permission.CAMERA"], (err, data)=>{
console.info("data:" + JSON.stringify(data));
console.info("data permissions:" + data.permissions);
console.info("data authResults:" + data.authResults);
......@@ -633,7 +633,7 @@ requestPermissionsFromUser(context: Context, permissions: Array&lt;Permissions&g
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager();
try {
atManager.requestPermissionsFromUser(this.context, ["ohos.permission.MANAGE_DISPOSED_APP_STATUS"]).then((data) => {
atManager.requestPermissionsFromUser(this.context, ["ohos.permission.CAMERA"]).then((data) => {
console.info("data:" + JSON.stringify(data));
console.info("data permissions:" + data.permissions);
console.info("data authResults:" + data.authResults);
......
......@@ -16,14 +16,14 @@
| 名称 | 类型 | 可读 | 可写 | 说明 |
|----------------------------|------------------------------------------------------------------------|-----|-----|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| name | string | 是 | 否 | 应用程序的名称。 |
| description | string | 是 | 否 | 应用程序的描述。 |
| descriptionId | number | 是 | 否 | 应用程序的描述id。 |
| description | string | 是 | 否 | 应用程序的描述信息。 |
| descriptionId | number | 是 | 否 | 应用程序的描述信息的资源id。 |
| systemApp | boolean | 是 | 否 | 判断是否为系统应用程序,默认为false。 |
| enabled | boolean | 是 | 否 | 判断应用程序是否可以使用,默认为true。 |
| label | string | 是 | 否 | 应用程序显示的标签。 |
| labelId | string | 是 | 否 | 应用程序的标签id。 |
| labelId | string | 是 | 否 | 应用程序的标签的资源id值。 |
| icon | string | 是 | 否 | 应用程序的图标。 |
| iconId | string | 是 | 否 | 应用程序的图标id。 |
| iconId | string | 是 | 否 | 应用程序图标的资源id值。 |
| process | string | 是 | 否 | 应用程序的进程,如果不设置,默认为包的名称。 |
| supportedModes | number | 是 | 否 | 标识应用支持的运行模式,当前只定义了驾驶模式(drive)。该标签只适用于车机。 |
| moduleSourceDirs | Array\<string> | 是 | 否 | 应用程序的资源存放的相对路径。 |
......
......@@ -7,7 +7,7 @@
## BundleInstaller.install<sup>(deprecated)<sup>
> 从API version 9开始不再维护,建议使用[install](js-apis-installer.md)替代。
> 从API version 9开始不再维护,建议使用[@ohos.bundle.installer.install](js-apis-installer.md)替代。
install(bundleFilePaths: Array&lt;string&gt;, param: InstallParam, callback: AsyncCallback&lt;InstallStatus&gt;): void;
......@@ -42,7 +42,7 @@ let installParam = {
installFlag: 1,
};
bundle.getBundleInstaller().then(installer=>{
bundle.getBundleInstaller().then(installer => {
installer.install(hapFilePaths, installParam, err => {
if (err) {
console.error('install failed:' + JSON.stringify(err));
......@@ -92,7 +92,7 @@ let installParam = {
installFlag: 1,
};
bundle.getBundleInstaller().then(installer=>{
bundle.getBundleInstaller().then(installer => {
installer.uninstall(bundleName, installParam, err => {
if (err) {
console.error('uninstall failed:' + JSON.stringify(err));
......@@ -142,7 +142,7 @@ let installParam = {
installFlag: 1,
};
bundle.getBundleInstaller().then(installer=>{
bundle.getBundleInstaller().then(installer => {
installer.recover(bundleName, installParam, err => {
if (err) {
console.error('recover failed:' + JSON.stringify(err));
......@@ -165,9 +165,9 @@ bundle.getBundleInstaller().then(installer=>{
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ----------- | ------- | ---- | ---- | ------------------ |
| userId | number | 是 | 否 | 指示用户id |
| installFlag | number | 是 | 否 | 指示安装标志 |
| isKeepData | boolean | 是 | 否 | 指示参数是否有数据 |
| userId | number | 是 | 否 | 指示用户id, 默认值:调用方的userId |
| installFlag | number | 是 | 否 | 指示安装标志, 默认值:1, 取值范围:</br>1: 覆盖安装, </br>16: 免安装|
| isKeepData | boolean | 是 | 否 | 指示参数是否有数据,默认值:false |
## InstallStatus<sup>(deprecated)<sup>
......@@ -179,8 +179,8 @@ bundle.getBundleInstaller().then(installer=>{
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------ |
| status | bundle.[InstallErrorCode](js-apis-Bundle.md#installerrorcode) | 是 | 否 | 表示安装或卸载错误状态码。 |
| statusMessage | string | 是 | 否 | 表示安装或卸载的字符串结果信息。 |
| status | bundle.[InstallErrorCode](js-apis-Bundle.md#installerrorcode) | 是 | 否 | 表示安装或卸载错误状态码。取值范围:枚举值[InstallErrorCode](js-apis-Bundle.md#installerrorcode) |
| statusMessage | string | 是 | 否 | 表示安装或卸载的字符串结果信息。取值范围包括:<br/> "SUCCESS" : 安装成功,</br> "STATUS_INSTALL_FAILURE": 安装失败(不存在安装文件), </br> "STATUS_INSTALL_FAILURE_ABORTED": 安装中止, </br> "STATUS_INSTALL_FAILURE_INVALID": 安装参数无效, </br> "STATUS_INSTALL_FAILURE_CONFLICT": 安装冲突(常见于升级和已有应用基本信息不一致), </br> "STATUS_INSTALL_FAILURE_STORAGE": 存储包信息失败, </br> "STATUS_INSTALL_FAILURE_INCOMPATIBLE": 安装不兼容(常见于版本降级安装或者签名信息错误), </br> "STATUS_UNINSTALL_FAILURE": 卸载失败(不存在卸载的应用), </br> "STATUS_UNINSTALL_FAILURE_ABORTED": 卸载中止(没有使用), </br> "STATUS_UNINSTALL_FAILURE_ABORTED": 卸载冲突(卸载系统应用失败, 结束应用进程失败), </br> "STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT": 安装失败(下载超时), </br> "STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED": 安装失败(下载失败), </br> "STATUS_RECOVER_FAILURE_INVALID": 恢复预置应用失败, </br> "STATUS_ABILITY_NOT_FOUND": Ability未找到, </br> "STATUS_BMS_SERVICE_ERROR": BMS服务错误, </br> "STATUS_FAILED_NO_SPACE_LEFT": 设备空间不足, </br> "STATUS_GRANT_REQUEST_PERMISSIONS_FAILED": 应用授权失败, </br> "STATUS_INSTALL_PERMISSION_DENIED": 缺少安装权限, </br> "STATUS_UNINSTALL_PERMISSION_DENIED": 缺少卸载权限|
## 获取应用的沙箱路径
对于FA模型,应用的沙箱路径可以通过[Context](js-apis-inner-app-context.md)中的方法获取;对于Stage模型,应用的沙箱路径可以通过[Context](js-apis-ability-context.md#abilitycontext)中的属性获取。下面以获取沙箱文件路径为例。
......
......@@ -171,7 +171,7 @@ popFirst(): T
| 类型 | 说明 |
| -------- | -------- |
| T | 返回被删除的元素。 |
| T | 返回被删除的元素。 |
**错误码:**
......@@ -205,7 +205,7 @@ popLast(): T
| 类型 | 说明 |
| -------- | -------- |
| T | 返回被删除的元素。 |
| T | 返回被删除的元素。 |
**错误码:**
......
......@@ -4361,7 +4361,7 @@ registerInputer(authType: AuthType, inputer: IInputer): void;
let authType = account_osAccount.AuthType.DOMAIN;
let password = new Uint8Array([0, 0, 0, 0, 0]);
try {
InputerMgr.registerInputer(authType, {
inputerMgr.registerInputer(authType, {
onGetData: (authSubType, callback) => {
callback.onSetData(authSubType, password);
}
......
......@@ -25,7 +25,7 @@
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager();
try {
atManager.requestPermissionsFromUser(this.context, ["ohos.permission.MANAGE_DISPOSED_APP_STATUS"]).then((data) => {
atManager.requestPermissionsFromUser(this.context, ["ohos.permission.CAMERA"]).then((data) => {
console.info("data:" + JSON.stringify(data));
console.info("data permissions:" + data.permissions);
console.info("data authResults:" + data.authResults);
......
# @ohos.wallpaper (壁纸)
壁纸管理服务是OpenHarmony中系统服务,是主题框架的部分组成,主要为系统提供壁纸管理服务能力,支持系统显示、设置、切换壁纸等功能。
壁纸管理服务是OpenHarmony中的系统服务,主要为系统提供壁纸管理服务能力,支持系统显示、设置、切换壁纸等功能。
> **说明:**
>
......@@ -197,7 +197,7 @@ restore(wallpaperType: WallpaperType, callback: AsyncCallback&lt;void&gt;): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| wallpaperType | [WallpaperType](#wallpapertype) | 是 | 壁纸类型。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数,移除壁纸成功,error为undefined 否则返回error信息。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数,移除壁纸成功,error为undefined否则返回error信息。 |
**示例:**
......@@ -231,7 +231,7 @@ restore(wallpaperType: WallpaperType): Promise&lt;void&gt;
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;void&gt; | Promise对象。无返回结果的Promise对象。 |
| Promise&lt;void&gt; | 无返回结果的Promise对象。 |
**示例:**
......@@ -259,7 +259,7 @@ setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback
| -------- | -------- | -------- | -------- |
| source | string \| [image.PixelMap](js-apis-image.md#pixelmap7) | 是 | JPEG或PNG文件的Uri路径,或者PNG格式文件的位图。 |
| wallpaperType | [WallpaperType](#wallpapertype) | 是 | 壁纸类型。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数,设置壁纸成功,error为undefined 否则返回error信息。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数,设置壁纸成功,error为undefined否则返回error信息。 |
**示例:**
......@@ -317,7 +317,7 @@ setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;void&gt; | Promise对象。无返回结果的Promise对象。 |
| Promise&lt;void&gt; | 无返回结果的Promise对象。 |
**示例:**
......@@ -900,7 +900,7 @@ reset(wallpaperType: WallpaperType, callback: AsyncCallback&lt;void&gt;): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| wallpaperType | [WallpaperType](#wallpapertype) | 是 | 壁纸类型。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数,移除壁纸成功,error为undefined 否则返回error信息。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数,移除壁纸成功,error为undefined否则返回error信息。 |
**示例:**
......@@ -938,7 +938,7 @@ reset(wallpaperType: WallpaperType): Promise&lt;void&gt;
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;void&gt; | Promise对象。无返回结果的Promise对象。 |
| Promise&lt;void&gt; | 无返回结果的Promise对象。 |
**示例:**
......@@ -970,7 +970,7 @@ setWallpaper(source: string | image.PixelMap, wallpaperType: WallpaperType, call
| -------- | -------- | -------- | -------- |
| source | string \| [image.PixelMap](js-apis-image.md#pixelmap7) | 是 | JPEG或PNG文件的Uri路径,或者PNG格式文件的位图。 |
| wallpaperType | [WallpaperType](#wallpapertype) | 是 | 壁纸类型。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数,设置壁纸成功,error为undefined 否则返回error信息。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数,设置壁纸成功,error为undefined否则返回error信息。 |
**示例:**
......@@ -1032,7 +1032,7 @@ setWallpaper(source: string | image.PixelMap, wallpaperType: WallpaperType): Pro
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;void&gt; | Promise对象。无返回结果的Promise对象。 |
| Promise&lt;void&gt; | 无返回结果的Promise对象。 |
**示例:**
......
......@@ -43,11 +43,11 @@ The specified ability name is not found.
**可能原因**<br/>
1. 输入的abilityName有误。
2. 系统中对应的应用没有安装
2. 系统中对应的应用不存在该abilityName对应的ability
**处理步骤**<br/>
1. 检查abilityName拼写是否正确。
2. 确认对应的应用是否安装该组件
2. 确认对应的应用是否存在该abilityName对应的ability
## 17700004 指定的用户不存在
......@@ -58,16 +58,17 @@ The specified user ID is not found.
调用与用户相关接口时,传入的用户不存在。
**可能原因**<br/>
输入的用户名有误,系统中没有该用户。
1. 输入的用户名有误。
2. 系统中没有该用户。
**处理步骤**<br/>
1. 检查用户名拼写是否正确。
2. 确认系统中存在该用户。
## 17700005 指定的appId不存在
## 17700005 指定的appId为空字符串
**错误信息**<br/>
The specified app ID is not found.
The specified app ID is empty string.
**错误描述**<br/>
调用appControl模块中的相关接口时,传入的appId为空字符串。
......@@ -144,9 +145,10 @@ Failed to install the HAP because the HAP signature fails to be verified.
4. 多个hap的签名信息不一致。
**处理步骤**<br/>
1. 确认hap是否签名成功。
2. 确认多个hap签名时使用的证书相同。
3. 确认升级的hap签名证书与已安装的hap相同。
1. 确认hap包是否签名成功。
2. 确认hap包的签名证书是从应用市场申请。
3. 确认多个hap包签名时使用的证书相同。
4. 确认升级的ha包p签名证书与已安装的hap包相同。
## 17700012 安装包路径无效或者文件过大导致应用安装失败
......@@ -175,7 +177,7 @@ Failed to install the HAPs because they have different configuration information
调用installer模块中的install接口时,多个HAP配置信息不同导致应用安装失败。
**可能原因**<br/>
多个HAP中配置文件app下面的字段不一致。
多个hap包中配置文件中app标签下面的字段信息不一致。
**处理步骤**<br/>
确认多个HAP中配置文件app下面的字段是否一致。
......@@ -206,7 +208,7 @@ Failed to install the HAP since the version of the HAP to install is too early.
新安装的应用版本号低于已安装的版本号。
**处理步骤**<br/>
确认新安装的应用版本号是否比已安装的同应用版本号高
确认新安装的应用版本号是否不低于已安装的同应用版本号
## 17700020 预置应用无法卸载
......@@ -299,7 +301,8 @@ The specified type is invalid.
2. 输入的type不存在。
**处理步骤**<br/>
确认输入的type是否拼写正确。
1. 确认输入的type是否拼写正确。
2. 确认输入的type是否存在。
## 17700026 指定应用被禁用
......
......@@ -183,4 +183,4 @@ ar-AE.json
## 获取语言
获取语言功能请参考[应用配置](../reference/apis/js-apis-application-configuration.md)
获取语言功能请参考[应用配置](../reference/apis/js-apis-app-ability-configuration.md)
......@@ -191,7 +191,7 @@ XTS子系统当前包括acts与tools软件包:
5. 测试套件编译命令。
随版本编译,debug版本编译时会同步编译acts测试套件。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> ![icon-note.gif](../public_sys-resources/icon-note.gif) **说明:**
> acts测试套件编译中间件为静态库,最终链接到版本镜像中 。
### C语言用例执行指导(适用于轻量系统产品用例开发)
......@@ -324,7 +324,7 @@ XTS子系统当前包括acts与tools软件包:
5. 测试套件编译命令。
随版本编译,debug版本编译时会同步编译acts测试套件
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> ![icon-note.gif](../public_sys-resources/icon-note.gif) **说明:**
> 小型系统acts独立编译成可执行文件(bin格式), 在编译产物的suites\acts目录下归档。
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册