diff --git a/en/application-dev/IDL/figures/IDL-interface-description.png b/en/application-dev/IDL/figures/IDL-interface-description.png new file mode 100644 index 0000000000000000000000000000000000000000..c7acc5c490e1aef26ceeafaffd0f63675cc2d488 Binary files /dev/null and b/en/application-dev/IDL/figures/IDL-interface-description.png differ diff --git a/en/application-dev/IDL/figures/IPC-RPC-communication-model.png b/en/application-dev/IDL/figures/IPC-RPC-communication-model.png new file mode 100644 index 0000000000000000000000000000000000000000..0af6b9fef057703ab2b00ef9153e73df87d4176b Binary files /dev/null and b/en/application-dev/IDL/figures/IPC-RPC-communication-model.png differ diff --git a/en/application-dev/IDL/idl-guidelines.md b/en/application-dev/IDL/idl-guidelines.md new file mode 100644 index 0000000000000000000000000000000000000000..66b45bd4c04860e882c9104aaf3c58164f5ec29b --- /dev/null +++ b/en/application-dev/IDL/idl-guidelines.md @@ -0,0 +1,661 @@ +# OpenHarmony IDL Specifications and User Guide + +## IDL Overview +To ensure successful communications between the client and server, interfaces recognized by both parties must be defined. The OpenHarmony Interface Definition Language (IDL) is a tool for defining such interfaces. OpenHarmony IDL decomposes objects to be transferred into primitives that can be understood by the operating system and encapsulates cross-boundary objects based on developers' requirements. + +**Figure 1** IDL interface description + +![IDL-interface-description](./figures/IDL-interface-description.png) + +IDL provides the following functions: + +- Declares interfaces provided by system services for external systems, and based on the interface declaration, generates C, C++, JS, or TS code for inter-process communication (IPC) or remote procedure call (RPC) proxies and stubs during compilation. + +- Declares interfaces provided by abilities for external systems, and based on the interface declaration, generates C, C++, JS, or TS code for IPC or RPC proxies and stubs during compilation. + +**Figure 2** IPC/RPC communication model + +![IPC-RPC-communication-model](./figures/IPC-RPC-communication-model.png) + +IDL has the following advantages: + +- Services are defined in the form of interfaces in IDL. Therefore, you do not need to focus on implementation details. + +- Interfaces defined by IDL can be used in IPC or RPC scenarios. The information or code generated based on the definitions in IDL simplifies IPC or RPC implementation. + +## IDL File Structure + +### Data Types + +#### Primitive Type +| IDL Primitive Type| C++ Primitive Type| TS Primitive Type| +| -------- | -------- | -------- | +|void | void | void | +|boolean | bool | boolean | +|byte | int8_t | number | +|short | int16_t | number | +|int | int32_t | number | +|long | int64_t | number | +|float | float | number | +|double | double | number | +|String | std::string | string | + +The preceding table lists the primitive types supported by IDL and the mappings to the C++ and TS primitive types. + +#### sequenceable Type +The sequenceable type is declared using the keyword **sequenceable**. This type can be passed during IPC or RPC through **Parcel** objects. The declaration mode of the sequenceable type in C++ is different from that in TS. + +In C++, the declaration is placed in the file header in the format of **sequenceable includedir..namespace.typename**. It can be in any of the following forms: + +``` +sequenceable includedir..namespace.typename +sequenceable includedir...typename +sequenceable namespace.typename +``` +In the preceding information, **includedir** indicates the directory where the header file of the type is located, and the dot (.) is used as the separator. **namespace** indicates the namespace where the type is located, and the dot (.) is used as the separator. **typename** indicates the data type, which can contain only English characters. **includedir** and **namespace** are separated by two dots (..). If the declaration statement does not contain two dots, all characters except the last typename will be parsed as a namespace. Example: +``` +sequenceable a.b..C.D +``` +The preceding statement is parsed into the following code in the C++ header file: +``` +#include "a/b/d.h" +using C::D; +``` +In TS, the declaration is placed in the file header in the format of **sequenceable namespace.typename;**. It can be in the following form: + +``` +sequenceable idl.MySequenceable +``` + +In the preceding information, **namespace** indicates the namespace to which the data type belongs, **typename** indicates the data type name, and **MySequenceable** indicates that data can be passed during IPC using **Parcel** objects. The sequenceable type is not defined in the IDL file, but in the .ts file. Therefore, IDL adds the following statement to the generated .ts file based on the declaration: + +``` +import MySequenceable from "./my_sequenceable" +``` + +Note that IDL does not implement code for this type. It only imports the header file in the specified format or imports the specified module and uses the type. Therefore, you must ensure that the imported directory, namespace, and type are correct. + +#### Interface Type +The interface type refers to interfaces defined in IDL files. The interfaces defined in an IDL file can be directly used as the parameter type or return value type of a method declared in the file. If an IDL file attempts to use interfaces defined in other IDL files, forward declaration must be contained in the header of that IDL file. + +The declaration form in C++ is similar to that of the sequenceable type. The declaration form is as follows: + +``` +interface includedir..namespace.typename +``` + +In TS, the declaration form is as follows: + +``` +interface namespace.interfacename +``` + +In the preceding information, **namespace** indicates the namespace to which the interface belongs, and **interfacename** indicates the name of the interface. For example, **interface OHOS.IIdlTestObserver;** declares the **IIdlTestObserver** interface defined in another IDL file. This interface can be used as the parameter type or return value type of a method in the current file. IDL adds the following statement to the generated .ts file based on the statement: + +``` +import IIdlTestObserver from "./i_idl_test_observer" +``` + +#### Array Type +The array type is represented by T[], where **T** can be the primitive, sequenceable, interface, or array type. In C++, this type is generated as **std::vector<T>**. +The table below lists the mappings between the IDL array type and TS and C++ data types. + +|IDL Data Type | C++ Data Type | TS Data Type | +| -------- | -------- | -------- | +|T[] | std::vector<T> | T[] | + +#### Container Type +IDL supports two container types: List and Map. The List container is represented in the format of **List<T>**. The Map container is represented in the format of **Map**, where **T**, **KT**, and **VT** can be of the primitive, sequenceable, interface, array, or container type. + +In C++, the List container type is generated as **std::list**, and the Map container type is generated as **std::map**. + +In TS, the List container type is not supported, and the Map container type is generated as **Map**. + +The table below lists the mappings between the IDL container type and TS and C++ data types. + +|IDL Data Type | C++ Data Type | TS Data Type | +| -------- | -------- | -------- | +|List<T> | std::list | Not supported| +|Map | std::map | Map | + + +### Specifications for Compiling IDL Files +Only one interface type can be defined in an IDL file, and the interface name must be the same as the file name. The interface definition of the IDL file is described in Backus-Naur form (BNF). The basic definition format is as follows: +``` +[<*interface_attr_declaration*>]interface<*interface_name_with_namespace*>{<*method_declaration*>} +``` +In the preceding information, <*interface_attr_declaration*> declares interface attributes. Currently, only the **oneway** attribute is supported, indicating that all methods in the interface are unidirectional. Such a method returns value without waiting for the execution to complete. This attribute is optional. If this attribute is not set, synchronous call is used. The interface name must contain the complete interface header file directory, namespace, and method declaration. Empty interfaces are not allowed. +The method declaration format in the interface is as follows: +``` +[<*method_attr_declaration*>]<*result_type*><*method_declaration*> +``` +In the preceding information, <*method_attr_declaration*> describes the interface attributes. Currently, only the **oneway** attribute is supported, indicating that the method is unidirectional. Such a method returns value without waiting for the execution to complete. This attribute is optional. If this attribute is not set, synchronous call is used. <*result_type*> indicates the type of the return value, and <*method_declaration*> indicates the method name and parameter declaration. +The parameter declaration format is as follows: +``` +[<*formal_param_attr*>]<*type*><*identifier*> +``` +The value of <*formal_param_attr*> can be **in**, **out**, or **inout**, indicating that the parameter is an input parameter, an output parameter, or both an input and an output parameter, respectively. A **oneway** method does not allow **output** or **inout** parameters or return values. + +## How to Develop + +### Development Using C++ + +#### Creating an IDL File + + You can use C++ to create IDL files. An example IDL file is as follows: + +``` + interface OHOS.IIdlTestService { + int TestIntTransaction([in] int data); + void TestStringTransaction([in] String data); + } +``` + +You can run the **./idl -gen-cpp -d dir -c dir/iTest.idl** command (**-d** indicates the output directory) to generate the interface file, stub file, and proxy file in the **dir** directory in the execution environment. The names of the generated interface class files are the same as that of the IDL file, except that the file name extensions are **.h** and **.cpp**. For example, for **IIdlTestService.idl**, the generated files are **i_idl_test_service.h**, **idl_test_service_proxy.h**, **idl_test_service_stub.h**, **idl_test_service_proxy.cpp**, and **idl_test_service_stub.cpp**. + +#### Exposing Interfaces on the Server + +The stub class generated by IDL is an abstract implementation of the interface class and declares all methods in the IDL file. + +``` +#ifndef OHOS_IDLTESTSERVICESTUB_H +#define OHOS_IDLTESTSERVICESTUB_H +#include +#include "iidl_test_service.h" + +namespace OHOS { +class IdlTestServiceStub : public IRemoteStub { +public: + int OnRemoteRequest( + /* [in] */ uint32_t code, + /* [in] */ MessageParcel& data, + /* [out] */ MessageParcel& reply, + /* [in] */ MessageOption& option) override; + +private: + static constexpr int COMMAND_TEST_INT_TRANSACTION = MIN_TRANSACTION_ID + 0; + static constexpr int COMMAND_TEST_STRING_TRANSACTION = MIN_TRANSACTION_ID + 1; +}; +} // namespace OHOS +#endif // OHOS_IDLTESTSERVICESTUB_H +``` + +You need to inherit the interface class defined in the IDL file and implement the methods in the class. In addition, you need to register the defined services with SAMGR during service initialization. In the following code snippet, **TestService** inherits the **IdlTestServiceStub** interface class and implements the **TestIntTransaction** and **TestStringTransaction** methods. + +``` +#ifndef OHOS_IPC_TEST_SERVICE_H +#define OHOS_IPC_TEST_SERVICE_H + +#include "hilog/log.h" +#include "log_tags.h" +#include "idl_test_service_stub.h" + +namespace OHOS { +class TestService : public IdlTestServiceStub { +public: + TestService(); + ~TestService(); + static int Instantiate(); + ErrCode TestIntTransaction(int data, int &rep) override; + ErrCode TestStringTransaction(const std::string& data) override; +private: + static constexpr HiviewDFX::HiLogLabel LABEL = { LOG_CORE, LOG_ID_IPC, "TestService" }; +}; +} // namespace OHOS +#endif // OHOS_IPC_TEST_SERVICE_H +``` + +The sample code for registering a service is as follows: + +``` +#include "test_service.h" + +#include + +#include "if_system_ability_manager.h" +#include "ipc_debug.h" +#include "ipc_skeleton.h" +#include "iservice_registry.h" +#include "system_ability_definition.h" + +namespace OHOS { +using namespace OHOS::HiviewDFX; + +int TestService::Instantiate() +{ + ZLOGI(LABEL, "%{public}s call in", __func__); + auto saMgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (saMgr == nullptr) { + ZLOGE(LABEL, "%{public}s:fail to get Registry", __func__); + return -ENODEV; + } + + sptr newInstance = new TestService(); + int result = saMgr->AddSystemAbility(IPC_TEST_SERVICE, newInstance); + ZLOGI(LABEL, "%{public}s: IPC_TEST_SERVICE result = %{public}d", __func__, result); + return result; +} + +TestService::TestService() +{ +} + +TestService::~TestService() +{ +} + +ErrCode TestService::TestIntTransaction(int data, int &rep) +{ + ZLOGE(LABEL, " TestService:read from client data = %{public}d", data); + rep = data + data; + return ERR_NONE; +} + +ErrCode TestService::TestStringTransaction(const std::string &data) +{ + ZLOGE(LABEL, "TestService:read string from client data = %{public}s", data.c_str()); + return data.size(); +} +} // namespace OHOS +``` + + +#### Calling Methods from the Client for IPC + +The C++ client obtains the service proxy defined in the system through SAMGR and then invokes the interface provided by the proxy. The sample code is as follows: + +``` +#include "test_client.h" + +#include "if_system_ability_manager.h" +#include "ipc_debug.h" +#include "ipc_skeleton.h" +#include "iservice_registry.h" +#include "system_ability_definition.h" + +namespace OHOS { +int TestClient::ConnectService() +{ + auto saMgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (saMgr == nullptr) { + ZLOGE(LABEL, "get registry fail"); + return -1; + } + + sptr object = saMgr->GetSystemAbility(IPC_TEST_SERVICE); + if (object != nullptr) { + ZLOGE(LABEL, "Got test Service object"); + testService_ = (new (std::nothrow) IdlTestServiceProxy(object)); + } + + if (testService_ == nullptr) { + ZLOGE(LABEL, "Could not find Test Service!"); + return -1; + } + + return 0; +} + +void TestClient::StartIntTransaction() +{ + if (testService_ != nullptr) { + ZLOGE(LABEL, "StartIntTransaction"); + [[maybe_unused]] int result = 0; + testService_->TestIntTransaction(1234, result); // 1234 : test number + ZLOGE(LABEL, "Rec result from server %{public}d.", result); + } +} + +void TestClient::StartStringTransaction() +{ + if (testService_ != nullptr) { + ZLOGI(LABEL, "StartIntTransaction"); + testService_->TestStringTransaction("IDL Test"); + } +} +} // namespace OHOS +``` + + + + +### Development Using TS + +#### Creating an IDL File + + You can use TS to create IDL files. An example IDL file is as follows: + +``` + interface OHOS.IIdlTestService { + int TestIntTransaction([in] int data); + void TestStringTransaction([in] String data); + } +``` + +Run the **./idl -c IIdlTestService.idl -gen-ts -d /data/ts/** command (**-d** indicates the output directory) to generate the interface file, stub file, and proxy file in the **/data/ts** directory in the execution environment. The names of the generated interface class files are the same as that of the IDL file, except that the file name extension is **.ts**. For example, the files generated for the **IIdlTestService.idl** file are **i_idl_test_service.ts**, **idl_test_service_proxy.ts**, and **idl_test_service_stub.ts**. + +#### Exposing Interfaces on the Server + +The stub class generated by IDL is an abstract implementation of the interface class and declares all methods in the IDL file. + +``` +import {testIntTransactionCallback} from "./i_idl_test_service"; +import {testStringTransactionCallback} from "./i_idl_test_service"; +import IIdlTestService from "./i_idl_test_service"; +import rpc from "@ohos.rpc"; + +export default class IdlTestServiceStub extends rpc.RemoteObject implements IIdlTestService { + constructor(des: string) { + super(des); + } + + onRemoteRequest(code: number, data, reply, option): boolean { + console.log("onRemoteRequest called, code = " + code); + switch(code) { + case IdlTestServiceStub.COMMAND_TEST_INT_TRANSACTION: { + let _data = data.readInt(); + this.testIntTransaction(_data, (errCode, returnValue) => { + reply.writeInt(errCode); + if (errCode == 0) { + reply.writeInt(returnValue); + } + }); + return true; + } + case IdlTestServiceStub.COMMAND_TEST_STRING_TRANSACTION: { + let _data = data.readString(); + this.testStringTransaction(_data, (errCode) => { + reply.writeInt(errCode); + }); + return true; + } + default: { + console.log("invalid request code" + code); + break; + } + } + return false; + } + + testIntTransaction(data: number, callback: testIntTransactionCallback): void{} + testStringTransaction(data: string, callback: testStringTransactionCallback): void{} + + static readonly COMMAND_TEST_INT_TRANSACTION = 1; + static readonly COMMAND_TEST_STRING_TRANSACTION = 2; +} +``` + +You need to inherit the interface class defined in the IDL file and implement the methods in the class. The following code snippet shows how to inherit the **IdlTestServiceStub** interface class and implement the **testIntTransaction** and **testStringTransaction** methods. + +``` +import {testIntTransactionCallback} from "./i_idl_test_service" +import {testStringTransactionCallback} from "./i_idl_test_service" +import IdlTestServiceStub from "./idl_test_service_stub" + + +class IdlTestImp extends IdlTestServiceStub { + + testIntTransaction(data: number, callback: testIntTransactionCallback): void + { + callback(0, data + 1); + } + testStringTransaction(data: string, callback: testStringTransactionCallback): void + { + callback(0); + } +} +``` + +After the service implements the interface, the interface needs to be exposed to the client for connection. If your service needs to expose this interface, extend **Ability** and implement **onConnect()** to return **IRemoteObject** so that the client can interact with the service process. The following code snippet shows how to expose the **IRemoteAbility** interface to the client: + +``` +export default { + onStart() { + console.info('ServiceAbility onStart'); + }, + onStop() { + console.info('ServiceAbility onStop'); + }, + onCommand(want, startId) { + console.info('ServiceAbility onCommand'); + }, + onConnect(want) { + console.info('ServiceAbility onConnect'); + try { + console.log('ServiceAbility want:' + typeof(want)); + console.log('ServiceAbility want:' + JSON.stringify(want)); + console.log('ServiceAbility want name:' + want.bundleName) + } catch(err) { + console.log("ServiceAbility error:" + err) + } + console.info('ServiceAbility onConnect end'); + return new IdlTestImp('connect'); + }, + onDisconnect(want) { + console.info('ServiceAbility onDisconnect'); + console.info('ServiceAbility want:' + JSON.stringify(want)); + } +}; +``` + +#### Calling Methods from the Client for IPC + +When the client calls **connectAbility()** to connect to a Service ability, the **onConnect** callback in **onAbilityConnectDone** of the client receives the **IRemoteObject** instance returned by the **onConnect()** method of the Service ability. The client and Service ability are in different applications. Therefore, the directory of the client application must contain a copy of the .idl file (the SDK automatically generates the proxy class). The **onConnect** callback then uses the **IRemoteObject** instance to create the **testProxy** instance of the **IdlTestServiceProxy** class and calls the related IPC method. The sample code is as follows: + +``` +import IdlTestServiceProxy from './idl_test_service_proxy' +import featureAbility from '@ohos.ability.featureAbility'; + +function callbackTestIntTransaction(result: number, ret: number): void { + if (result == 0 && ret == 124) { + console.log("case 1 success "); + } +} + +function callbackTestStringTransaction(result: number): void { + if (result == 0) { + console.log("case 2 success "); + } +} + +var onAbilityConnectDone = { + onConnect:function (elementName, proxy) { + let testProxy = new IdlTestServiceProxy(proxy); + testProxy.testIntTransaction(123, callbackTestIntTransaction); + testProxy.testStringTransaction('hello', callbackTestStringTransaction); + }, + onDisconnect:function (elementName) { + console.log("onDisconnectService onDisconnect"); + }, + onFailed:function (code) { + console.log("onDisconnectService onFailed"); + } +}; + +function connectAbility: void { + let want = { + "bundleName":"com.example.myapplicationidl", + "abilityName": "com.example.myapplicationidl.ServiceAbility" + }; + let connectionId = -1; + connectionId = featureAbility.connectAbility(want, onAbilityConnectDone); +} + + +``` + +#### Transferring a sequenceable Object During IPC + +You can send a class from one process to another through IPC interfaces. However, you must ensure that the peer can use the code of this class and this class supports the **marshalling** and **unmarshalling** methods. OpenHarmony uses **marshalling** and **unmarshalling** to serialize and deserialize objects into objects that can be identified by each process. + +To create a class that supports the sequenceable type, perform the following operations: + +1. Implement the **marshalling** method, which obtains the current state of the object and serializes the object into a **Parcel** object. +2. Implement the **unmarshalling** method, which deserializes the object from a **Parcel** object. + +The following is an example of the **MySequenceable** class code: + +``` +import rpc from '@ohos.rpc'; +export default class MySequenceable { + constructor(num: number, str: string) { + this.num = num; + this.str = str; + } + getNum() : number { + return this.num; + } + getString() : string { + return this.str; + } + marshalling(messageParcel) { + messageParcel.writeInt(this.num); + messageParcel.writeString(this.str); + return true; + } + unmarshalling(messageParcel) { + this.num = messageParcel.readInt(); + this.str = messageParcel.readString(); + return true; + } + private num; + private str; +} +``` + + + +## How to Develop for Interworking Between C++ and TS + +### TS Proxy and C++ Stub Development + +#### C++ Service Object + +1. Use C++ to construct an IDL file and run commands to generate interfaces, stub files, and proxy files. + +2. Create a service object, inherit the interface class defined in the C++ stub file, and implement the methods in the class. An example is as follows: + + ``` + class IdlTestServiceImpl : public IdlTestServiceStub { + public: + IdlTestServiceImpl() = default; + virtual ~IdlTestServiceImpl() = default; + + ErrCode TestIntTransaction(int _data, int& result) override + { + result = 256; + return ERR_OK; + } + + ErrCode TestStringTransaction(const std::string& _data) override + { + return ERR_OK; + } + }; + ``` + +#### Native APIs in C++ + +C++ provides C++ service objects to TS in the format of native APIs. For example, C++ provides a **GetNativeObject** method, which is used to create an **IdlTestServiceImpl** instance. Using the **NAPI_ohos_rpc_CreateJsRemoteObject** method, you can create a JS remote object for the TS application. + +``` +NativeValue* GetNativeObject(NativeEngine& engine, NativeCallbackInfo& info) +{ + sptr impl = new IdlTestServiceImpl(); + napi_value napiRemoteObject = NAPI_ohos_rpc_CreateJsRemoteObject(reinterpret_cast(&engine), impl); + NativeValue* nativeRemoteObject = reinterpret_cast(napiRemoteObject); + return nativeRemoteObject; +} +``` + +#### TS Proxy Object + +Use TS to construct an IDL file and run commands to generate interfaces, stub files, and proxy files. An example proxy file is as follows: + +``` + +import {testIntTransactionCallback} from "./i_idl_test_service"; +import {testStringTransactionCallback} from "./i_idl_test_service"; +import IIdlTestService from "./i_idl_test_service"; +import rpc from "@ohos.rpc"; + +export default class IdlTestServiceProxy implements IIdlTestService { + constructor(proxy) { + this.proxy = proxy; + } + + testIntTransaction(data: number, callback: testIntTransactionCallback): void + { + let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); + let _data = new rpc.MessageParcel(); + let _reply = new rpc.MessageParcel(); + _data.writeInt(data); + this.proxy.sendRequest(IdlTestServiceProxy.COMMAND_TEST_INT_TRANSACTION, _data, _reply, _option).then(function(result) { + if (result.errCode === 0) { + let _errCode = result.reply.readInt(); + if (_errCode != 0) { + let _returnValue = undefined; + callback(_errCode, _returnValue); + return; + } + let _returnValue = result.reply.readInt(); + callback(_errCode, _returnValue); + } else { + console.log("sendRequest failed, errCode: " + result.errCode); + } + }) + } + + testStringTransaction(data: string, callback: testStringTransactionCallback): void + { + let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); + let _data = new rpc.MessageParcel(); + let _reply = new rpc.MessageParcel(); + _data.writeString(data); + this.proxy.sendRequest(IdlTestServiceProxy.COMMAND_TEST_STRING_TRANSACTION, _data, _reply, _option).then(function(result) { + if (result.errCode === 0) { + let _errCode = result.reply.readInt(); + callback(_errCode); + } else { + console.log("sendRequest failed, errCode: " + result.errCode); + } + }) + } + + static readonly COMMAND_TEST_INT_TRANSACTION = 1; + static readonly COMMAND_TEST_STRING_TRANSACTION = 2; + private proxy +} +``` + +#### Interworking Between TS and C++ Applications + +1. The TS application invokes the native API to obtain the remote C++ service object. +2. Construct a TS proxy and transfers the remote C++ service object to it. +3. Use the TS proxy to call the method declared in the IDL file to implement the interworking between the TS proxy and C++ stub. The following is an example: + +``` +import IdlTestServiceProxy from './idl_test_service_proxy' +import nativeMgr from 'nativeManager'; + +function testIntTransactionCallback(errCode: number, returnValue: number) +{ + console.log("errCode: " + errCode + " returnValue: " + returnValue); +} + +function testStringTransactionCallback(errCode: number) +{ + console.log("errCode: " + errCode); +} + +function jsProxyTriggerCppStub() +{ + let nativeObj = nativeMgr.GetNativeObject(); + let tsProxy = new IdlTestServiceProxy(nativeObj); + // Call testIntTransaction. + tsProxy.testIntTransaction(10, testIntTransactionCallback); + + // Call testStringTransaction. + tsProxy.testStringTransaction("test", testIntTransactionCallback); +} +``` diff --git a/en/application-dev/ability/fa-pageability.md b/en/application-dev/ability/fa-pageability.md index e6c097d55d25d1717c342c847452b0a84baf0d83..d4f6a193ff4b25859f6545b9bfd8eb2adf921229 100644 --- a/en/application-dev/ability/fa-pageability.md +++ b/en/application-dev/ability/fa-pageability.md @@ -2,13 +2,13 @@ ## Overview ### Concepts -The Page ability implements the ArkUI and provides the capability of interacting with developers. When you create an ability in the integrated development environment (IDE), the IDE automatically creates template code. The capabilities related to the Page ability are implemented through the **featureAbility**, and the lifecycle callbacks are implemented through the callbacks in **app.js/app.ets**. +The Page ability implements the ArkUI and provides the capability of interacting with developers. When you create an ability in DevEco Studio, DevEco Studio automatically creates template code. The capabilities related to the Page ability are implemented through the **featureAbility**, and the lifecycle callbacks are implemented through the callbacks in **app.js** or **app.ets**. ### Page Ability Lifecycle **Ability lifecycle** -The Page ability lifecycle is a general term for all states of a Page ability, such as **INACTIVE**, **ACTIVE**, and **BACKGROUND**. +The Page ability lifecycle defines all states of a Page ability, such as **INACTIVE**, **ACTIVE**, and **BACKGROUND**. The following figure shows the lifecycle state transition of the Page ability. @@ -17,25 +17,25 @@ The following figure shows the lifecycle state transition of the Page ability. Description of ability lifecycle states: - - **UNINITIALIZED**: The Page ability is not initialized. This is a temporary state. A Page ability changes directly to the **INITIAL** state upon its creation. + - **UNINITIALIZED**: The Page ability is not initialized. This is a temporary state, from which a Page ability changes directly to the **INITIAL** state upon its creation. - - **INITIAL**: This state refers to the initial or stopped state. The Page ability in this state is not running. The Page ability enters the **INACTIVE** state after it is started. + - **INITIAL**: The Page ability is initialized but not running. The Page ability enters the **INACTIVE** state after it is started. - - **INACTIVE**: The ability is visible but does not gain focus. + - **INACTIVE**: The Page ability is visible but does not gain focus. - - **ACTIVE**: The ability runs in the foreground and gains focus. + - **ACTIVE**: The Page ability runs in the foreground and has focus. - - **BACKGROUND**: The Page ability returns to the background. After being re-activated, the Page ability enters the **ACTIVE** state. After being destroyed, the Page ability enters the **INITIAL** state. + - **BACKGROUND**: The Page ability runs in the background. After being re-activated, the Page ability enters the **ACTIVE** state. After being destroyed, the Page ability enters the **INITIAL** state. **The following figure shows the relationship between lifecycle callbacks and lifecycle states of the Page ability.** ![fa-pageAbility-lifecycle](figures/fa-pageAbility-lifecycle.png) -You can override the lifecycle callbacks provided by the Page ability in the **app.js/app.ets** file. Currently, the **app.js** file provides only the **onCreate** and **onDestroy** callbacks, and the **app.ets** file provides the full lifecycle callbacks. +You can override the lifecycle callbacks provided by the Page ability in the **app.js** or **app.ets** file. Currently, the **app.js** file provides only the **onCreate** and **onDestroy** callbacks, and the **app.ets** file provides the full lifecycle callbacks. ### Launch Type The ability supports two launch types: singleton and multi-instance. -The **launchType** item in the **config.json** file is used to specify the launch type. +You can specify the launch type by setting **launchType** in the **config.json** file. | Launch Type | Description |Description | | ----------- | ------- |---------------- | @@ -55,7 +55,7 @@ By default, **singleton** is used. | void startAbility(parameter: StartAbilityParameter) | Starts an ability. | | Context getContext(): | Obtains the application context.| | void terminateSelf() | Terminates the ability. | -| bool hasWindowFocus() | Checks whether the ability gains focus. | +| bool hasWindowFocus() | Checks whether the ability has focus. | ### Starting a Local Page Ability @@ -76,37 +76,10 @@ By default, **singleton** is used. action: "", entities: [""], type: "", - options: { - // Grant the permission to perform read operations on the URI. - authReadUriPermission: true, - // Grant the permission to perform write operations on the URI. - authWriteUriPermission: true, - // Support forwarding the Want result to the ability. - abilityForwardResult: true, - // Enable abiligy continuation. - abilityContinuation: true, - // Specify that a component does not belong to ohos. - notOhosComponent: true, - // Specify that an ability is started. - abilityFormEnabled: true, - // Grant the permission for possible persisting on the URI. - authPersistableUriPermission: true, - // Grant the permission for possible persisting on the prefix URI. - authPrefixUriPermission: true, - // Support distributed scheduling system startup on multiple devices. - abilitySliceMultiDevice: true, - // A service ability is started regardless of whether the host application has been started. - startForegroundAbility: true, - // Install the specified ability if it is not installed. - installOnDemand: true, - // Return the result to the ability slice. - abilitySliceForwardResult: true, - // Install the specified ability with background mode if it is not installed. - installWithBackgroundMode: true - }, deviceId: "", - bundleName: "com.example.startability", - abilityName: "com.example.startability.MainAbility", + bundleName: "com.example.myapplication", + /* In the FA model, abilityName consists of package and ability name. */ + abilityName: "com.example.entry.secondAbility", uri: "" }, }, @@ -122,10 +95,10 @@ You can also include **parameters** in the **want** parameter and set its value featureAbility.startAbility({ want: { - bundleName: "com.example.startability", + bundleName: "com.example.myapplication", uri: "", parameters: { - abilityName: "com.example.startability.MainAbility" + abilityName: "com.example.entry.secondAbility" } }, }, @@ -227,15 +200,15 @@ In the cross-device scenario, the application must also apply for the data synch | API | Description | | ------------ | ------------------------------------------------------------ | | onShow() | Called when the ability is switched from the background to the foreground. In this case, the ability is visible to users.| -| onHide() | Called when the ability is switched from the foreground to the background. In this case, the ability is invisible.| -| onDestroy() | Called when the ability is destroyed. In this callback, you can make preparations for app exit, such as recycling resources and clearing the cache.| +| onHide() | Called when the ability is switched from the foreground to the background. In this case, the ability is invisible to users.| +| onDestroy() | Called when the ability is destroyed. In this callback, you can make preparations for application exit, such as recycling resources and clearing the cache.| | onCreate() | Called when the ability is created for the first time. You can initialize the application in this callback.| -| onInactive() | Called when the ability loses focus. An ability loses focus before entering the background state.| +| onInactive() | Called when the ability loses focus. An ability loses focus when it is about to enter the background state.| | onActive() | Called when the ability is switched to the foreground and gains focus. | **Example** -You need to override the lifecycle callbacks in **app.js/app.ets**. The IDE template generates **onCreate()** and **onDestroy()** by default. You need to override the other callbacks. +You need to override the lifecycle callbacks except **onCreate()** and **onDestroy()** in **app.js** or **app.ets**. The **onCreate()** and **onDestroy()** callbacks are automatically generated in the template code provided by DevEco Studio. ```javascript export default { @@ -261,4 +234,5 @@ export default { ``` ## Samples The following sample is provided to help you better understand how to develop a Page ability: -- [`DMS`: Distributed Demo (eTS) (API7)](https://gitee.com/openharmony/app_samples/tree/master/ability/DMS) + +- [`DMS`: Distributed Demo (eTS, API version 7)](https://gitee.com/openharmony/app_samples/tree/master/ability/DMS) diff --git a/en/application-dev/ability/stage-call.md b/en/application-dev/ability/stage-call.md index 6b1ab0c3cae210aca41488cc4750382128635a1e..9f7216de316df0e4d786e8e25b770dea45be7f6d 100644 --- a/en/application-dev/ability/stage-call.md +++ b/en/application-dev/ability/stage-call.md @@ -8,13 +8,17 @@ The following figure shows the ability call process. ![stage-call](figures/stage-call.png) +> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> The startup mode of the callee must be **singleton**. +> Currently, only system applications and Service Extension abilities can use the **Call** APIs to access the callee. + ## Available APIs The table below describes the ability call APIs. For details, see [Ability](../reference/apis/js-apis-application-ability.md#caller). **Table 1** Ability call APIs |API|Description| |:------|:------| -|Promise startAbilityByCall(want: Want)|Obtains the caller interface of the specified ability, and if the specified ability is not started, starts the ability in the background.| +|Promise startAbilityByCall(want: Want)|Obtains the caller interface of the specified ability and, if the specified ability is not running, starts the ability in the background.| |void on(method: string, callback: CalleeCallBack)|Callee.on: callback invoked when the callee registers a method.| |void off(method: string)|Callee.off: callback invoked when the callee deregisters a method.| |Promise call(method: string, data: rpc.Sequenceable)|Caller.call: sends agreed sequenceable data to the callee.| @@ -77,7 +81,7 @@ export default class MySequenceable { ``` 4. Implement **Callee.on** and **Callee.off**. - The time to register a listener for the callee depends on your application. The data sent and received before the listener is registered and that after the listener is deregistered are not processed. In the following example, the **CalleeSortMethod** listener is registered in **onCreate** of the ability and deregistered in **onDestroy**. After receiving sequenceable data, the application processes the data and returns them. You need to implement processing based on service requirements. The sample code is as follows: + The time to register a listener for the callee depends on your application. The data sent and received before the listener is registered and that after the listener is deregistered are not processed. In the following example, the **CalleeSortMethod** listener is registered in **onCreate** of the ability and deregistered in **onDestroy**. After receiving sequenceable data, the application processes the data and returns the data result. You need to implement processing based on service requirements. The sample code is as follows: ```ts const TAG: string = '[CalleeAbility]' const MSG_SEND_METHOD: string = 'CallSendMsg' @@ -196,7 +200,7 @@ context.requestPermissionsFromUser(permissions).then((data) => { ``` 3. Send agreed sequenceable data. -The sequenceable data can be sent to the callee in either of the following ways: without a return value or obtaining data returned by the callee. The method and sequenceable data must be consistent with those of the callee. The following example describes how to invoke the **Call** API to send data to the callee. The sample code is as follows: +The sequenceable data can be sent to the callee with or without a return value. The method and sequenceable data must be consistent with those of the callee. The following example describes how to invoke the **Call** API to send data to the callee. The sample code is as follows: ```ts const MSG_SEND_METHOD: string = 'CallSendMsg' async onButtonCall() { @@ -242,9 +246,6 @@ try { } ``` -## Development Example +## Samples The following sample is provided to help you better understand how to develop an ability call in the stage model: - -[StageCallAbility](https://gitee.com/openharmony/app_samples/tree/master/ability/StageCallAbility) - -In this sample, the **AbilityStage** APIs are implemented in the **AbilityStage.ts** file in the **Application** directory, the **Ability** APIs are implemented in the **MainAbility** directory, and **pages/index** is the pages of the ability. Another ability and callee are implemented in the **CalleeAbility** directory, and its pages are the content configured in **pages/second**. The **MainAbility** functions as the caller, and the **CalleeAbility** functions as the callee. After starting the **CalleeAbility**, the **MainAbility** obtains the caller interface, processes the string entered by the user, and transfers the processed string to the **CalleeAbility**. The **CalleeAbility** refreshes the page based on the received data and returns the result to the **MainAbility**. +- [`StageCallAbility`: Stage Ability Creation and Usage (eTS, API version 9)](https://gitee.com/openharmony/app_samples/tree/master/ability/StageCallAbility) diff --git a/en/application-dev/connectivity/ipc-rpc-overview.md b/en/application-dev/connectivity/ipc-rpc-overview.md index c586dbd1fe7e7b24496be753ef95a41f3355f119..19bbe8dc26871bec8b2f6f48273d90dacc148d70 100755 --- a/en/application-dev/connectivity/ipc-rpc-overview.md +++ b/en/application-dev/connectivity/ipc-rpc-overview.md @@ -19,4 +19,4 @@ In OpenHarmony documents, proxy represents the service requester, and stub repre ## Related Modules -Distributed Scheduler +[Distributed Scheduler](https://gitee.com/openharmony/distributedschedule_dms_fwk) diff --git a/en/application-dev/database/Readme-EN.md b/en/application-dev/database/Readme-EN.md index 2be9b2dc5a8f9d6c714cc81e695ade8ad11f23ab..9f7ccd0d08e8683aca6e6c86ddef80f8e0e5aad4 100644 --- a/en/application-dev/database/Readme-EN.md +++ b/en/application-dev/database/Readme-EN.md @@ -6,9 +6,9 @@ - Relational Database - [RDB Overview](database-relational-overview.md) - [RDB Development](database-relational-guidelines.md) -- Lightweight Data Store - - [Lightweight Data Store Overview](database-preference-overview.md) - - [Lightweight Data Store Development](database-preference-guidelines.md) +- Preferences + - [Preferences Overview](database-preference-overview.md) + - [Preferences Development](database-preference-guidelines.md) - Distributed Data Object - [Distributed Data Object Overview](database-distributedobject-overview.md) - [Distributed Data Object Development](database-distributedobject-guidelines.md) diff --git a/en/application-dev/database/database-preference-guidelines.md b/en/application-dev/database/database-preference-guidelines.md index fcee818beffac1e1cafaf89af82c5044f111a599..36b6878057640f6cf706efec6d9abbbc1e5b2980 100644 --- a/en/application-dev/database/database-preference-guidelines.md +++ b/en/application-dev/database/database-preference-guidelines.md @@ -1,44 +1,44 @@ -# Lightweight Data Store Development +# Preferences Development ## When to Use -The lightweight data store is ideal for storing lightweight and frequently used data, but not for storing a large amount of data or data with frequent changes. The application data is persistently stored on a device in the form of files. Note that the instance accessed by an application contains all data of the file. The data is always loaded to the memory of the device until the application removes it from the memory. The application can perform data operations using the **Storage** APIs. +Preferences are ideal for storing data frequently used by applications, but not for storing a large amount of data or data with frequent changes. The application data is persistently stored on a device in the form of files. Note that the instance accessed by an application contains all data of the file. The data is always loaded to the memory of the device until the application removes it from the memory. The application can perform data operations using the **Preferences** APIs. ## Available APIs -The lightweight data store provides applications with data processing capability and allows applications to perform lightweight data storage and query. Data is stored in key-value (KV) pairs. Keys are of the string type, and values can be of the number, string, or Boolean type. +Preferences provide capabilities for processing data in the form of key-value (KV) pairs and support data persistence, modification, and query. In KV pairs, keys are of the string type, and values can be of the number, string, or Boolean type. -**Creating a Storage Instance** +### Creating a Preferences Instance -Create a **Storage** instance for data operations. A **Storage** instance is created after data is read from a specified file and loaded to the instance. +Create a **Preferences** instance for data operations. A **Preferences** instance is created after data is read from a specified file and loaded to the instance. -**Table 1** API for creating a **Storage** instance +**Table 1** API for creating a **Preferences** instance | Package | API | Description | | ----------------- | ------------------------------------------- | ------------------------------------------- | -| ohos.data.storage | getStorage(path: string): Promise\ | Obtains the **Storage** singleton corresponding to a file for data operations.| +| ohos.data.preferences | getPreferences(context: Context, name: string): Promise\ | Obtains a **Preferences** instance for data operations.| -**Writing Data** +### Writing Data -Call the **put()** method to add or modify data in a **Storage** instance. +Call the **put()** method to add or modify data in a **Preferences** instance. **Table 2** API for writing data | Class | API | Description | | ------- | -------------------------------------------------- | ----------------------------------------------- | -| Storage | put(key: string, value: ValueType): Promise\ | Writes data of the number, string, and Boolean types.| +| Preferences | put(key: string, value: ValueType): Promise\ | Writes data of the number, string, and Boolean types.| -**Reading Data** +### Reading Data -Call the **get()** method to read data from a **Storage** instance. +Call the **get()** method to read data from a **Preferences** instance. **Table 3** API for reading data | Class | API | Description | | ------- | ---------------------------------------------------------- | ----------------------------------------------- | -| Storage | get(key: string, defValue: ValueType): Promise\ | Reads data of the number, string, and Boolean types.| +| Preferences | get(key: string, defValue: ValueType): Promise\ | Reads data of the number, string, and Boolean types.| -**Storing Data Persistently** +### Storing Data Persistently Call the **flush()** method to write the cached data back to its text file for persistent storage. @@ -46,119 +46,120 @@ Call the **flush()** method to write the cached data back to its text file for p | Class | API | Description | | ------- | ----------------------- | --------------------------------------- | -| Storage | flush(): Promise\ | Writes data in the **Storage** instance back to its file through an asynchronous thread.| +| Preferences | flush(): Promise\ | Writes data from the **Preferences** instance back to its file through an asynchronous thread.| -**Observing Data Changes** +### Observing Data Changes -Specify **StorageObserver** as the callback to subscribe to data changes. When the value of the subscribed key is changed and the **flush()** method is executed, **StorageObserver** will be invoked. +You can subscribe to data changes. When the value of the subscribed key is changed by **flush()**, a callback will be invoked to return the new data. -**Table 5** APIs for observing data changes +**Table 5** APIs for observing **Preferences** changes | Class | API | Description | | ------- | ------------------------------------------------------------ | -------------- | -| Storage | on(type: 'change', callback: Callback\): void | Subscribe to data changes.| -| Storage | off(type: 'change', callback: Callback\): void | Unsubscribes from data changes. | +| Preferences | on(type: 'change', callback: Callback<{ key : string }>): void | Subscribes to data changes.| +| Preferences | off(type: 'change', callback: Callback<{ key : string }>): void | Unsubscribes from data changes. | -**Deleting Data** +### Deleting Data -Use the following APIs to delete a **Storage** instance or data file. +Use the following APIs to delete a **Preferences** instance or data file. -**Table 6** APIs for deleting data +**Table 6** APIs for deleting **Preferences** | Package | API | Description | | ----------------- | ---------------------------------------------------- | ------------------------------------------------------------ | -| ohos.data.storage | deleteStorage(path: string): Promise\ | Deletes a **Storage** instance from the cache and deletes its file from the device.| -| ohos.data.storage | removeStorageFromCache(path: string): Promise\ | Deletes a **Storage** instance from the cache to release memory. | +| ohos.data.preferences | deletePreferences(context: Context, name: string): Promise; | Deletes a **Preferences** instance from the cache and deletes its file from the device.| +| ohos.data.preferences | removePreferencesFromCache(context: Context, name: string): Promise\; | Removes a **Preferences** instance from the memory to release memory. ## How to Develop -1. Import @ohos.data.storage and related modules to the development environment. +1. Import @ohos.data.preferences and related modules to the development environment. ```js - import dataStorage from '@ohos.data.storage' - import featureAbility from '@ohos.ability.featureAbility' // Used to obtain the file storage path. + import data_preferences from '@ohos.data.preferences' ``` -2. Create a **Storage** instance. +2. Create a **Preferences** instance. - Read the specified file and load its data to the **Storage** instance for data operations. + Read the specified file and load its data to the **Preferences** instance for data operations. ```js - var context = featureAbility.getContext() - context.getFilesDir().then(() => { - console.info("======================>getFilesDirPromsie====================>"); - }); - - let promise = dataStorage.getStorage(path + '/mystore') + let promise = data_preferences.getPreferences(this.context, 'mystore') ``` 3. Write data. - Use the **put()** method of the **Storage** class to write data to the cached **Storage** instance. + Use the **put()** method of the **Preferences** class to write data to the cached **Preferences** instance. ```js - promise.then((storage) => { - let getPromise = storage.put('startup', 'auto') // Save data to the Storage instance. + promise.then((preferences) => { + let getPromise = preferences.put('startup', 'auto') getPromise.then(() => { console.info("Put the value of startup successfully.") }).catch((err) => { - console.info("Put the value of startup failed with err: " + err) + console.info("Failed to put the value of startup with err: " + err) }) }).catch((err) => { - console.info("Get the storage failed") + console.info("Failed to get the preferences") }) ``` 4. Read data. - Use the **get()** method of the **Storage** class to read data. + Use the **get()** method of the **Preferences** class to read data. ```js - promise.then((storage) => { - let getPromise = storage.get('startup', 'default') + promise.then((preferences) => { + let getPromise = preferences.get('startup', 'default') getPromise.then((value) => { console.info("The value of startup is " + value) }).catch((err) => { - console.info("Get the value of startup failed with err: " + err) + console.info("Failed to get the value of startup with err: " + err) }) }).catch((err) => { - console.info("Get the storage failed")}) + console.info("Failed to get the preferences")}) ``` 5. Store data persistently. - Use the **flush()** or **flushSync()** method to flush data in the **Storage** instance to its file. + Use the **flush()** method to flush data from the **Preferences** instance to its file. ```js - storage.flush(); + preferences.flush(); ``` -6. Observe data changes. +6. Observe data changes. - Specify **StorageObserver** as the callback to subscribe to data changes for an application. When the value of the subscribed key is changed and the **flush()** method is executed, **StorageObserver** will be invoked. Unregister the **StorageObserver** when it is no longer required. + Specify an observer as the callback to subscribe to data changes for an application. When the value of the subscribed key is changed and the **flush()** method is executed, the observe callback will be invoked to return the change. ```js - promise.then((storage) => { - var observer = function (key) { - console.info("The key of " + key + " changed.") - } - storage.on('change', observer) - storage.putSync('startup', 'auto') // Modify data in the Storage instance. - storage.flushSync() // Trigger the StorageObserver callback. - - storage.off(...change..., observer) // Unsubscribe from the data changes. - }).catch((err) => { - console.info("Get the storage failed") - }) + var observer = function (key) { + console.info("The key of " + key + " changed.") + } + preferences.on('change', observer) + preferences.put('startup', 'auto', function (err) { + if (err) { + console.info("Failed to put the value of startup with err: " + err) + return + } + console.info("Put the value of startup successfully.") + preferences.flush(function (err) { + if (err) { + console.info("Failed to flush data to file with err: " + err) + return + } + console.info("Flushed to file successfully.") // Observer will be called. + }) + }) ``` 7. Delete the specified file. - Use the **deleteStorage** method to delete the **Storage** singleton of the specified file from the memory, and delete the specified file, its backup file, and damaged files. After the specified files are deleted, the application cannot use that instance to perform any data operation. Otherwise, data inconsistency will occur. The deleted data and files cannot be restored. + Use the **deletePreferences** method to delete the **Preferences** singleton of the specified file from the memory, and delete the specified file, its backup file, and corrupted files. After the specified files are deleted, the application cannot use that instance to perform any data operation. Otherwise, data inconsistency will occur. The deleted data and files cannot be restored. ```js - let promise = dataStorage.deleteStorage(path + '/mystore') - promise.then(() => { - console.info("Deleted successfully.") - }).catch((err) => { - console.info("Deleted failed with err: " + err)}) + let proDelete = data_preferences.deletePreferences(context, 'mystore') + proDelete.then(() => { + console.info("Data deleted successfully.") + }).catch((err) => { + console.info("Failed to delete data with err: " + err) + }) ``` diff --git a/en/application-dev/database/database-preference-overview.md b/en/application-dev/database/database-preference-overview.md index 45639c75e8ad5d1b3f68c79da90fbc598af7e840..b26943b6109818b1ca9d74038f9df4471f69531e 100644 --- a/en/application-dev/database/database-preference-overview.md +++ b/en/application-dev/database/database-preference-overview.md @@ -1,31 +1,29 @@ -# Lightweight Data Store Overview +# Preferences Overview -Lightweight data store is applicable to access and persistence operations on the data in key-value pairs. When an application accesses a lightweight **Storage** instance, data in the **Storage** instance will be cached in the memory for faster access. The cached data can also be written back to the text file for persistent storage. Since file read and write consume system resources, you are advised to minimize the frequency of reading and writing persistent files. +Preferences are used for access and persistence operations on the data in the key-value structure. When an application accesses a **Preferences** instance, the data in the instance will be cached in the memory for faster access. The cached data can also be written back to the text file for persistent storage. Since file read and write consume system resources, you are advised to minimize the frequency of reading and writing persistent files. -## Basic Concepts +## Basic Concepts -- **Key-Value data structure** +- **Key-value data structure** - A type of data structure. The key is the unique identifier for a piece of data, and the value is the specific data being identified. + A type of data structure. The key is the unique identifier for a piece of data, and the value is the specific data being identified. -- **Non-relational database** +- **Non-relational database** - A database not in compliance with the atomicity, consistency, isolation, and durability \(ACID\) database management properties of relational data transactions. The data in a non-relational database is independent. + A database not in compliance with the atomicity, consistency, isolation, and durability (ACID) database management properties of relational data transactions. The data in a non-relational database is independent. +## Working Principles -## Working Principles +When an application loads data from a **Preferences** file to a **Preferences** instance, the system stores the instance in the memory through a static container. Each file of an application or process has only one **Preferences** instance in the memory, till the application removes the instance from the memory or deletes the **Preferences** file. -1. When an application loads data from a specified **Storage** file to a **Storage** instance, the system stores the instance in the memory through a static container. Each file of an application or process has only one **Storage** instance in the memory, till the application removes the instance from the memory or deletes the **Storage** file. -2. When obtaining a **Storage** instance, the application can read data from or write data to the instance. The data in the **Storage** instance can be flushed to its **Storage** file by calling the **flush** or **flushSync** method. +When obtaining a **Preferences** instance, the application can read data from or write data to the instance. The data in the instance can be flushed to its **Preferences** file by calling the **flush()** method. -**Figure 1** How lightweight data store works +**Figure 1** How **Preferences** work +![](figures/preferences.png) -![](figures/en-us_image_0000001199139454.png) - -## Constraints - -- **Storage** instances are loaded to the memory. To minimize non-memory overhead, the number of data records stored in a **Storage** instance cannot exceed 10,000. Delete the instances that are no longer used in a timely manner. -- The key in the key-value pairs is of the string type. It cannot be empty or exceed 80 characters. -- If the value in the key-value pairs is of the string type, it can be empty or contain a maximum of 8192 characters. +## Constraints +- **Preferences** instances are loaded to the memory. To minimize non-memory overhead, the number of data records stored in a **Preferences** instance cannot exceed 10,000. Delete the instances that are no longer used in a timely manner. +- The key in key-value pairs is of the string type. It cannot be empty or exceed 80 bytes. +- The value of the string type in key-value pairs can be empty, but cannot exceed 8192 bytes if not empty. diff --git a/en/application-dev/database/figures/en-us_image_0000001199139454.png b/en/application-dev/database/figures/en-us_image_0000001199139454.png deleted file mode 100644 index ca52bd43d384c5b2d06fe19623b50e0c66ba6295..0000000000000000000000000000000000000000 Binary files a/en/application-dev/database/figures/en-us_image_0000001199139454.png and /dev/null differ diff --git a/en/application-dev/database/figures/preferences.png b/en/application-dev/database/figures/preferences.png new file mode 100644 index 0000000000000000000000000000000000000000..ab91e2d4fb3019ca3f48a195041c9b19bdaec830 Binary files /dev/null and b/en/application-dev/database/figures/preferences.png differ diff --git a/en/application-dev/device/Readme-EN.md b/en/application-dev/device/Readme-EN.md index f77f56a5cab3c2d3765762fe6790566405e9c119..41f8cf0de280706eff7ae88c051d50d18630f173 100644 --- a/en/application-dev/device/Readme-EN.md +++ b/en/application-dev/device/Readme-EN.md @@ -13,3 +13,6 @@ - Vibrator - [Vibrator Overview](vibrator-overview.md) - [Vibrator Development](vibrator-guidelines.md) +- Update Servcie + - [Sample Server Overview](sample-server-overview.md) + - [Sample Server Development](sample-server-guidelines.md) diff --git a/en/application-dev/device/sample-server-guidelines.md b/en/application-dev/device/sample-server-guidelines.md new file mode 100644 index 0000000000000000000000000000000000000000..c957c109caf505ba90686d62e7ca3d1b9ab8f89a --- /dev/null +++ b/en/application-dev/device/sample-server-guidelines.md @@ -0,0 +1,198 @@ +# Sample Server Development + +## When to Use + +The sample server provides a package search server for checking update packages and obtaining the update package download URLs, which was previously unavailable in the real-world update service. The sample server supports update service testing and secondary development function verification, building an end-to-end environment to cater for diverse update service use cases. + +## How to Develop + +1. Generate an SSL certificate. + + Generate the **serverKey.pem** and **serverCert.cer** files for SSL communication of the sample server. + + ``` + openssl req -newkey rsa:2048 -nodes -keyout serverKey.pem -x509 -days 365 -out serverCert.cer -subj "/C=CN/ST=GD/L=GZ/O=abc/OU=defg/CN=hijk/emailAddress=test.com" + ``` + + + +2. Modify the **bundle.json** file. + + Add **sub_component** to the **build** field. + + ``` + "sub_component": [ + "//base/update/updateservice/server_sample:testserver", + ... + ], + ``` + +3. Create a code directory. + + Go to the **update_updateservice** directory and run the following commands to create a code directory: + + ``` + mkdir server_sample // Create the server_sample folder. + touch server_sample/BUILD.gn // Create the BUILD.gn file. + mkdir server_sample/include // Create the include folder to store the header file of the sample server. + touch server_process.h // Create the server_process.h header file. + mkdir server_sample/src // Create the src folder to store the C/C++ files of the sample server. + touch server_sample/src/server_process.c // Create the server_process.c file. + touch server_sample/src/main.cpp // Create the main.cpp file. + ``` + +4. Write the **BUILD.gn** file. + + The **BUILD.gn** file contains two **ohos** components: **ohos_shared_library** file named **libserver_process.z.so** and **ohos_executable** file named **testserver**. + + ``` + import("//build/ohos.gni") + + ohos_shared_library("server_process") { + sources = [ + "//base/update/updateservice/server_sample/src/server_process.c", + ] + + include_dirs = [ + "//base/update/updateservice/server_sample/include", + "//third_party/openssl/include", + ] + + deps = [ + "//base/update/updater/services/log:libupdaterlog", + "//third_party/bounds_checking_function:libsec_static", + "//third_party/openssl:crypto_source", + "//third_party/openssl:ssl_source", + "//utils/native/base:utils", + ] + + part_name = "update_service" + } + + ohos_executable("testserver") { + sources = [ + "//base/update/updateservice/server_sample/src/main.cpp", + ] + + include_dirs = [ + "//base/update/updateservice/server_sample/include", + ] + + deps = [ + "//base/update/updateservice/server_sample:server_process", + ] + + part_name = "update_service" + } + ``` + +5. Write the **server_process.h** file. + + Declare the sample server APIs in the **server_process.h** file. + + ```c++ + #ifndef __SERVER_PROCESS_H__ + #define __SERVER_PROCESS_H__ + + /* + Init: creates a socket environment and presets certain attributes. + */ + int Init(); + + /* + SetParam: sets all plug-in parameters. + */ + int SetParam(const char *key, const char *value); + + /* + GetParam: obtains all plug-in parameters. + */ + int GetParam(const char *key, char *value); + + /* + ReverseSetParamCallback: callback. + */ + int ReverseSetParamCallback(int(*setParam)(const char *key, const char *value)); + + /* + Open: starts the service. + */ + int Open(); + + /* + MainLoop: invoked every 100 ms. + */ + int MainLoop(); + + /* + Close: stops the service and releases related resources. + */ + int Close(); + + #endif //__SERVER_PROCESS_H__ + ``` + +6. Write the **server_process.c** and **main.cpp** files. + + In the **server_process.c** file, mainly declare **respondContent**, the format of the response message returned by the server. Write the **main.cpp** file based on instructions for the common SSL protocol server. Be sure to include related header files and load the **serverKey.pem** and **serverCert.cer** files. + + ```c + #include "server_process.h" + + #include + #include + #include + #include + #include + #include + #include + #include + + #include "openssl/err.h" + #include "openssl/ssl.h" + + #define SERVER_PEM "/data/sdcard/serverKey.pem" // Use an absolute path. + #define SERVER_CER "/data/sdcard/serverCert.cer" // Use an absolute path. + + #define LOG_PRINT(fmt, ...) printf("[ServerProcess][%s:%d] " fmt "\n", __func__, __LINE__, ##__VA_ARGS__) + #define DO_CHECK(cond, log, ...) \ + if (!(cond)) {\ + LOG_PRINT(log);\ + __VA_ARGS__;\ + return -1;\ + } + + // Implement the function by referring to the APIs in the server_process.h file. Pay attention to the format of the response message from the server. + respondContent = "{" + "\"searchStatus\": 0," + "\"errMsg\": \"success\"," + "\"checkResults\": [{" + "\"versionName\": \"sampleVersionName\"," + "\"versionCode\": \"sampleVersionCode\"," + "\"verifyInfo\": \"sampleVerifyInfoSha256Value\"," + "\"size\": 1234567," + "\"packageType\": 1," + "\"descriptPackageId\": \"abcdefg1234567ABCDEFG\"," + "}]," + "\"descriptInfo\": [{" + "\"descriptPackageId\": \"abcdefg1234567ABCDEFG\"," + "\"content\": \"This package message is used for sampleContent\"" + "}]" + "}"; + ``` + +7. Start building. + + The **testserver** and **libserver_process.z.so** files are added to the build output directory. + +8. Develop an update package. + + For details, see the [update_packaging_tools repository](https://gitee.com/openharmony/update_packaging_tools). + +9. Start the package search server. + + Create a directory that contains only English characters on the development board. Place the **testserver**, **libserver_process.z.so**, **serverCert.cer**, and **serverKey.pem** files in the directory, go to the directory, and run the following command to start the package search server: + + ``` + ./testserver ./libserver_process.z.so & + ``` diff --git a/en/application-dev/device/sample-server-overview.md b/en/application-dev/device/sample-server-overview.md new file mode 100644 index 0000000000000000000000000000000000000000..6924f8d7f2256dff9ec828cc5fb62248f68599f1 --- /dev/null +++ b/en/application-dev/device/sample-server-overview.md @@ -0,0 +1,37 @@ +# Sample Server Overview + +The sample server provides a simple server instance for deploying update packages. It can be used as an auxiliary test environment for the UpdateService subsystem. + +## Basic Concepts + +- Package search service: one of the service capabilities provided by the UpdateService. It depends on the server that supports the TCP and SSL protocols. + +- Package search server: a server that provisions the package search service through the TCP connection and the SSL protocol. The sample server mentioned in this document is such a package search server. + +- Download server: an HTTP server. + +- update.serverip.search: a system parameter that indicates the IP address of the package search server configured on the UpdateService. The default value is **127.0.0.1**. + +## Constraints + +The following is an example of the JSON response returned by the server. Note that the **verifyInfo** field indicates the SHA-256 value of the update package, and the **size** field indicates the size of the update package, in bytes. + +```json +{ + "searchStatus": 0, + "errMsg": "success", + "checkResults": [{ + "versionName": "versionNameSample", + "versionCode": "versionCodeSample", + "verifyInfo": "verifyInfoSHA256Value1234567", + "size": 1234567, + "packageType": 1, + "url": "http://serverAddressSample/packageNameSample.fileTypeSample", + "descriptPackageId": "abcdefg1234567ABCDEFG" + }], + "descriptInfo": [{ + "descriptPackageId": "abcdefg1234567ABCDEFG", + "content": "This package is used for update." + }] +} +``` diff --git a/en/application-dev/notification/notification.md b/en/application-dev/notification/notification.md index 129db615d8cf7bc52d3707cbace5121546203868..8aee267205b79aa897b8e48fbd9606b76a16263f 100644 --- a/en/application-dev/notification/notification.md +++ b/en/application-dev/notification/notification.md @@ -133,7 +133,7 @@ var subscriber = { ##### Enabling Notification -Before publishing a notification, check whether the notification feature is enabled for your application. By default, the feature is disabled. The application can use **Notification.requestEnableNotification** to prompt the user to enable the feature. +Before publishing a notification, check whether the notification feature is enabled for your application. By default, the feature is disabled. The application calls **Notification.requestEnableNotification** to prompt the user to enable the feature. ```js Notification.requestEnableNotification() .then((data) => { diff --git a/en/application-dev/quick-start/Readme-EN.md b/en/application-dev/quick-start/Readme-EN.md index 502646515c46571cc935c4dedb76db01925c09f2..228d2f0442007f51177f074b6d2e70fcf7486395 100644 --- a/en/application-dev/quick-start/Readme-EN.md +++ b/en/application-dev/quick-start/Readme-EN.md @@ -6,10 +6,9 @@ - [Getting Started with eTS in the Low-Code Approach](start-with-ets-low-code.md) - [Getting Started with JavaScript in the Traditional Coding Approach](start-with-js.md) - [Getting Started with JavaScript in the Low-Code Approach](start-with-js-low-code.md) - - Development Fundamentals - [Application Package Structure Configuration File (FA Model)](package-structure.md) - - [Application Package Structure Configuration File (Stage Model)](module-structure.md) + - [Application Package Structure Configuration File (Stage Model)](stage-structure.md) - [Resource File Categories](basic-resource-file-categories.md) - [SysCap](syscap.md) diff --git a/en/application-dev/quick-start/stage-structure.md b/en/application-dev/quick-start/stage-structure.md index ef19d2b394b87375811dd483ab162d81a7068b4a..7d733b1b06c5996fb16cc01cbeb712422edf2b1f 100644 --- a/en/application-dev/quick-start/stage-structure.md +++ b/en/application-dev/quick-start/stage-structure.md @@ -175,12 +175,12 @@ Table 2 Internal structure of the app tag | vendor | Application vendor. The value is a string with a maximum of 255 bytes.| String | Yes (initial value: left empty) | | versionCode | Version number of the application. The value is a 32-bit non-negative integer and less than 2 to the power of 31. It is used only to determine whether a version is later than another version. A larger value indicates a later version. Ensure that a new version of the application uses a value greater than any of its predecessors. | Number | No | | versionName | Text description of the version number, which is displayed to users.
The value consists of only digits and dots. The four-segment format *A.B.C.D* is recommended, wherein:
Segment 1: major version number, which ranges from 0 to 99. A major version consists of major new features or large changes.
Segment 2: minor version number, which ranges from 0 to 99. A minor version consists of some new features and large bug fixes.
Segment 3: feature version number, which ranges from 0 to 99. A feature version consists of scheduled new features.
Segment 4: maintenance release number or patch number, which ranges from 0 to 999. A maintenance release or patch consists of resolution to security flaws or minor bugs.| String | No | -| minCompatibleVersionCode | Minimum API version required for running the application. | Number | Yes (initial value: value of **versionCode**)| -| minAPIVersion | Target API version required for running the application. | Number | No | +| minCompatibleVersionCode | Minimum API version compatible with the application. | Number | Yes (initial value: value of **versionCode**)| +| minAPIVersion | Minimum API version required for running the application. | Number | No | | targetAPIVersion | Target API version required for running the application. | Integer | No | | apiReleaseType | Type of the target API version required for running the application. The value can be **CanaryN**, **BetaN**, or **Release**, where **N** represents a positive integer.
**Canary**: indicates a restricted release.
**Beta**: indicates a publicly released beta version.
**Release**: indicates a publicly released official version.| String | Yes (initial value: **"Release"**) | | distributedNotificationEnabled | Whether the distributed notification feature is enabled for the application. | Boolean | Yes (initial value: **true**) | -| entityType | Category of the application, which can be **game**, **media**, **communication**, **news**, **travel**, **utility**, **shopping**, **education**, **kids**, **business**, and **photography**.| String | Yes (initial value: unspecified) | +| entityType | Type of the application, which can be **game**, **media**, **communication**, **news**, **travel**, **utility**, **shopping**, **education**, **kids**, **business**, and **photography**.| String | Yes (initial value: unspecified) | ### Internal Structure of the module Tag @@ -212,9 +212,9 @@ Table 4 System-defined deviceTypes values | Device Type | Value | Description | | ------------ | ------------ | -------------------------------------------------------- | | tablet | tablet | Tablet, speaker with a screen | -| smart TV | tv | | +| smart TV | tv | N/A | | smart watch | wearable | Smart watch, kids' watch, especially a watch that provides call features| -| head unit | car | | +| head unit | car | N/A | | router | router | Router | Example of the **deviceTypes** attribute structure: @@ -309,7 +309,7 @@ Table 6 Internal structure of the abilities attribute | icon | Icon of the ability. The value is the index to the resource file. This attribute can be left empty, and the default value is an empty array.
If **ability** is set to **MainElement**, this attribute is mandatory.| String | Yes (initial value: left empty)
If **ability** is set to **MainElement**, this attribute is mandatory.| | permissions | A set of permissions that need to be applied for when the capability of another application is invoked. The value is a string array. Each array element is a permission name, which is usually represented by a reverse domain name (a maximum of 255 bytes). The permission can be predefined by the system or customized by the application. For the latter, the value must be the same as the **name** value of a permission defined in the **defPermissions** attribute. | String array| Yes (initial value: left empty) | | metadata | Metadata about the ability. For details about metadata, see [Internal Structure of the metadata Attribute](#internal-structure-of-the-metadata-attribute).| Array | Yes (initial value: left empty) | -| visible | Indicates whether the ability can be invoked by other applications. The value **true** means that the ability can be invoked by other applications, and **false** means the opposite.| Boolean | Yes (initial value: **false**) | +| visible | Whether the ability can be invoked by other applications. The value **true** means that the ability can be invoked by other applications, and **false** means the opposite.| Boolean | Yes (initial value: **false**) | | continuable | Whether the ability can be migrated. The value **true** means that the ability can be migrated, and **false** means the opposite.| Boolean | Yes (initial value: **false**) | | skills | Feature set of wants that can be received by the ability.
Configuration rule: In an entry package, you can configure multiple abilities with the **skills** attribute (where **action.system.home** and **entity.system.home** are configured) that has the entry capability. The **label** and **icon** in the first ability that has **skills** configured are used as the **label** and **icon** of the entire service/application.
The **skills** attribute with the entry capability can be configured for the feature package of an OpenHarmony application,
but not for an OpenHarmony service.
For details about the internal structure of **skills**, see [Internal Structure of the skills Attribute](#internal-structure-of-the-skills-attribute).| Array | Yes (initial value: left empty) | | backgroundModes | Continuous task modes of the ability.
Continuous tasks are classified into the following types:
**dataTransfer**: service for downloading, backing up, sharing, or transferring data from the network or peer devices
**audioPlayback**: audio playback service
**audioRecording**: audio recording service
**location**: location and navigation services
**bluetoothInteraction**: Bluetooth scanning, connection, and transmission services (wearables)
**multiDeviceConnection**: multi-device interconnection service
**wifiInteraction**: Wi-Fi scanning, connection, and transmission services (multi-screen cloning)
**voip**: voice/video call and VoIP services
**taskKeeping**: computing service
| String | Yes (initial value: left empty) | @@ -361,7 +361,7 @@ Table 7 Internal structure of the skills attribute | -------- | ------------------------------------------------------------ | ---------- | -------------------- | | actions | A set of want action values that can be received. The value can be a value predefined by the system or a custom value.| String array| Yes (initial value: left empty)| | entities | Categories of abilities that can receive the want. The value can be a value predefined by the system or a custom value.| String array| Yes (initial value: left empty)| -| uris | Data specifications to be added to the want filter. The specification can be of data type only (**mimeType** attribute), URI only, or both. For details about the internal structure of **uris**, see Table 8.| Object array | Yes (initial value: left empty)| +| uris | Data specification to be added to the want filter. The specification can be of data type only (**mimeType** attribute), URI only, or both. For details about the internal structure of **uris**, see Table 8.| Object array | Yes (initial value: left empty)| Table 8 Internal structure of the uris attribute @@ -612,7 +612,7 @@ Table 13 Internal structure of the shortcuts attribute | Attribute | Description | Data Type| Initial Value Allowed | | ---------- | ------------------------------------------------------------ | -------- | -------------------------- | -| shortcutId | Shortcut ID. The value is a string with a maximum of 63 bytes. | String | No | +| shortcutId | ID of the shortcut. The value is a string with a maximum of 63 bytes. | String | No | | label | Label of the shortcut, that is, the text description displayed by the shortcut. The value can be a string or a resource index to the description. The value is a string with a maximum of 63 bytes.| String | Yes (initial value: left empty) | | icon | Icon of the shortcut. The value is the index to the resource file. | String | Yes (initial value: left empty)| | wants | Wants to which the shortcut points. The attribute consists of the **bundleName** and **abilityName** sub-attributes.
**bundleName**: target bundle name of the shortcut; string type.
**abilityName**: target component name of the shortcut; string type.| Object | Yes (initial value: left empty) | diff --git a/en/application-dev/reference/Readme-EN.md b/en/application-dev/reference/Readme-EN.md index c2252e1a8f56f93c52ee4278681fc7fb23d28366..30bb3aacd85d9e11012fb66dc276a88476139126 100644 --- a/en/application-dev/reference/Readme-EN.md +++ b/en/application-dev/reference/Readme-EN.md @@ -4,7 +4,8 @@ - [TypeScript-based Declarative Development Paradigm](arkui-ts/Readme-EN.md) - [APIs](apis/Readme-EN.md) - - [JS (eTS Included) APIs](reference/apis/Readme-EN.md) + - [JS (eTS Included) APIs](apis/Readme-EN.md) - Native APIs - - [Standard Library](reference/native-lib/third_party_libc/musl.md) - - [Node_API](reference/native-lib/third_party_napi/napi.md) \ No newline at end of file + - [Standard Library](native-lib/third_party_libc/musl.md) + - [Node_API](native-lib/third_party_napi/napi.md) + diff --git a/en/application-dev/reference/apis/js-apis-Bundle.md b/en/application-dev/reference/apis/js-apis-Bundle.md index 83b61077eeae144c95e92cdad94b35b8f01ccca7..f97cfdbebe1ae0cc37229bb77117627472b1ad5a 100644 --- a/en/application-dev/reference/apis/js-apis-Bundle.md +++ b/en/application-dev/reference/apis/js-apis-Bundle.md @@ -1,8 +1,8 @@ # Bundle Module (JavaScript SDK APIs) -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API version 7. 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. ## Modules to Import ``` @@ -463,7 +463,7 @@ bundle.getAllApplicationInfo(bundleFlags, userId, (err, data) => { getAllApplicationInfo(bundleFlags: number, callback: AsyncCallback>) : void; -Obtains the information about all applications of the specified user. This API uses an asynchronous callback to return the result. +Obtains the information about all applications. This API uses an asynchronous callback to return the result. **Required permissions** @@ -649,7 +649,7 @@ bundle.getAbilityLabel(bundleName, abilityName, (err, data) => { isAbilityEnabled(info: AbilityInfo): Promise\ -Checks whether an ability is enabled based on a given want. This API uses a promise to return the result. +Checks whether an ability is enabled based on a given **AbilityInfo** object. This API uses a promise to return the result. **Required permissions** @@ -690,7 +690,7 @@ bundle.isAbilityEnabled(Info) isAbilityEnabled(info : AbilityInfo, callback : AsyncCallback\): void -Checks whether an ability is enabled based on a given want. This API uses an asynchronous callback to return the result. +Checks whether an ability is enabled based on a given **AbilityInfo** object. This API uses an asynchronous callback to return the result. **Required permissions** @@ -727,7 +727,7 @@ bundle.isAbilityEnabled(Info, (err, data) => { isApplicationEnabled(bundleName: string): Promise\ -Checks whether an application is enabled based on a given want. This API uses a promise to return the result. +Checks whether an application is enabled based on a given bundle name. This API uses a promise to return the result. **Required permissions** @@ -857,7 +857,7 @@ SystemCapability.BundleManager.BundleFramework | Name | Type | Mandatory | Description | | ----------- | ---------------------------------- | ---- | ------------------------------------- | | want | Want | Yes | Want that contains the bundle name. | -| bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| +| bundleFlags | number | Yes | Type of the ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| | userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | | callback | AsyncCallback> | Yes | Callback used to return the ability information. | @@ -894,7 +894,7 @@ SystemCapability.BundleManager.BundleFramework | Name | Type | Mandatory | Description | | ----------- | ---------------------------------- | ---- | ------------------------------------- | | want | Want | Yes | Want that contains the bundle name. | -| bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| +| bundleFlags | number | Yes | Type of the ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| | callback | AsyncCallback> | Yes | Callback used to return the ability information. | **Example** @@ -1056,7 +1056,7 @@ bundle.getNameForUid(uid, (err, data) => { getAbilityIcon(bundleName: string, abilityName: string): Promise\; -Obtains the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md) of the corresponding icon based on a given bundle name and ability name. This API uses a promise to return the result. +Obtains the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses a promise to return the result. **Required permissions** @@ -1095,7 +1095,7 @@ bundle.getAbilityIcon(bundleName, abilityName) getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback\): void; -Obtains the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md) of the corresponding icon based on a given bundle name and ability name. This API uses an asynchronous callback to return the result. +Obtains the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses an asynchronous callback to return the result. **Required permissions** @@ -1274,13 +1274,13 @@ bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, (err, data) => { | Name | Default Value | Description | | ---------------------------------------- | ---- | ------------------------- | | SUCCESS | 0 | Installation succeeded. | -| STATUS_INSTALL_FAILURE | 1 | Installation failed. (The application to be installed does not exist.) | +| STATUS_INSTALL_FAILURE | 1 | Installation failed. (The application to be installed is not found.) | | STATUS_INSTALL_FAILURE_ABORTED | 2 | Installation aborted. | | STATUS_INSTALL_FAILURE_INVALID | 3 | Invalid installation parameter. | -| STATUS_INSTALL_FAILURE_CONFLICT | 4 | Installation conflict. (The basic information about the application to upgrade is inconsistent with that of the existing application.) | +| STATUS_INSTALL_FAILURE_CONFLICT | 4 | Installation conflict. (The basic information of the application to update is inconsistent with that of the existing application.) | | STATUS_INSTALL_FAILURE_STORAGE | 5 | Failed to store the bundle information. | -| STATUS_INSTALL_FAILURE_INCOMPATIBLE | 6 | Installation incompatible. (A downgrade occurs or the signature information is incorrect.) | -| STATUS_UNINSTALL_FAILURE | 7 | Uninstallation failed. (The application to be uninstalled does not exist.) | +| STATUS_INSTALL_FAILURE_INCOMPATIBLE | 6 | Installation incompatibility. (A downgrade occurs or the signature information is incorrect.) | +| STATUS_UNINSTALL_FAILURE | 7 | Uninstallation failed. (The application to be uninstalled is not found.) | | STATUS_UNINSTALL_FAILURE_BLOCKED | 8 | Uninstallation aborted. (This error code is not in use.) | | STATUS_UNINSTALL_FAILURE_ABORTED | 9 | Uninstallation aborted. (Invalid parameters.) | | STATUS_UNINSTALL_FAILURE_CONFLICT | 10 | Uninstallation conflict. (Failed to uninstall a system application or end the application process.)| @@ -1311,7 +1311,7 @@ Enumerates bundle flags. | GET_ABILITY_INFO_WITH_METADATA8+ | 0x00000020 | Obtains the ability metadata information. | | GET_BUNDLE_WITH_EXTENSION_ABILITY9+ | 0x00000020 | Obtains the bundle information with the Extension ability information.| | GET_APPLICATION_INFO_WITH_METADATA8+ | 0x00000040 | Obtains the application metadata information. | -| GET_ABILITY_INFO_SYSTEMAPP_ONLY8+ | 0x00000080 | Obtains the ability information with information about system applications.| +| GET_ABILITY_INFO_SYSTEMAPP_ONLY8+ | 0x00000080 | Obtains the ability information of system applications.| | GET_ABILITY_INFO_WITH_DISABLE8+ | 0x00000100 | Obtains information about disabled abilities. | | GET_APPLICATION_INFO_WITH_DISABLE8+ | 0x00000200 | Obtains information about disabled applications. | | GET_ALL_APPLICATION_INFO | 0xFFFF0000 | Obtains all application information. | @@ -1355,7 +1355,7 @@ Describes the application bundle information. | cpuAbi | string | Yes | No | cpuAbi information of the bundle. | | isSilentInstallation | string | Yes | No | Whether to install the bundle in silent mode. | | minCompatibleVersionCode | number | Yes | No | Earliest version compatible with the bundle in the distributed scenario. | -| entryInstallationFree | boolean | Yes | No | Whether installation-free is supported for the entry. | +| entryInstallationFree | boolean | Yes | No | Whether installation-free is supported for the entry module. | | reqPermissionStates8+ | Array\ | Yes | No | Permission grant state. | | extensionAbilityInfo9+ | Array\ | Yes | No | Extended information of the ability. | @@ -1376,7 +1376,7 @@ Describes the application information. | labelId | string | Yes | No | Application label ID. | | icon | string | Yes | No | Application icon. | | iconId | string | Yes | No | Application icon ID. | -| process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used by default.| +| process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used.| | supportedModes | number | Yes | No | Running modes supported by the application. | | moduleSourceDirs | Array\ | Yes | No | Relative paths for storing application resources. | | permissions | Array\ | Yes | No | Permissions required for accessing the application. | @@ -1599,7 +1599,7 @@ Enumerates color modes. ## GrantStatus -Enumerates permission grant statuses. +Enumerates permission grant states. **System capability**: SystemCapability.BundleManager.BundleFramework diff --git a/en/application-dev/reference/apis/js-apis-application-abilityDelegator.md b/en/application-dev/reference/apis/js-apis-application-abilityDelegator.md index 13cfb0005a19959b23f14334296a9398a0308d0a..9e0d3e602e74c621b139bdc45857f2ce3d395490 100644 --- a/en/application-dev/reference/apis/js-apis-application-abilityDelegator.md +++ b/en/application-dev/reference/apis/js-apis-application-abilityDelegator.md @@ -1,6 +1,6 @@ # AbilityDelegator -> **Note** +> **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. @@ -423,7 +423,7 @@ Starts an ability. This API uses an asynchronous callback to return the result. | Name | Type | Mandatory| Description | | -------- | -------------------------------------- | ---- | ------------------ | -| want | [Want](js-apis-featureAbility.md#Want) | Yes | **Want** parameter for starting the ability. | +| want | [Want](js-apis-application-Want.md) | Yes | **Want** parameter for starting the ability. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -455,7 +455,7 @@ Starts an ability. This API uses a promise to return the result. | Name| Type | Mandatory| Description | | ------ | -------------------------------------- | ---- | --------------- | -| want | [Want](js-apis-featureAbility.md#Want) | Yes | **Want** parameter for starting the ability.| +| want | [Want](js-apis-application-Want.md) | Yes | **Want** parameter for starting the ability.| **Return value** diff --git a/en/application-dev/reference/apis/js-apis-data-rdb.md b/en/application-dev/reference/apis/js-apis-data-rdb.md index 5a688b89db49c1d008e82a263024b45c6032bc40..73a87a94f29df9c506a2ea1b41dd7e5f69610e7b 100644 --- a/en/application-dev/reference/apis/js-apis-data-rdb.md +++ b/en/application-dev/reference/apis/js-apis-data-rdb.md @@ -1,10 +1,8 @@ # Relational Database -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. - - ## Modules to Import ```js diff --git a/en/application-dev/reference/apis/js-apis-display.md b/en/application-dev/reference/apis/js-apis-display.md index 72dfe4beb9d6151dfab5acf8636711b1437e7c3d..22ea52f17d7b5996d536c8dc223ada7ee9ae1fa2 100644 --- a/en/application-dev/reference/apis/js-apis-display.md +++ b/en/application-dev/reference/apis/js-apis-display.md @@ -1,6 +1,6 @@ # Display -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. ## Modules to Import @@ -56,7 +56,7 @@ getDefaultDisplay(callback: AsyncCallback<Display>): void Obtains the default display object. -**System capabilities**: SystemCapability.WindowManager.WindowManager.Core +**System capability**: SystemCapability.WindowManager.WindowManager.Core **Parameters** | Name| Type| Mandatory| Description| @@ -82,7 +82,7 @@ getDefaultDisplay(): Promise<Display> Obtains the default display object. -**System capabilities**: SystemCapability.WindowManager.WindowManager.Core +**System capability**: SystemCapability.WindowManager.WindowManager.Core **Return value** @@ -107,7 +107,7 @@ getAllDisplay(callback: AsyncCallback<Array<Display>>): void Obtains all the display objects. -**System capabilities**: SystemCapability.WindowManager.WindowManager.Core +**System capability**: SystemCapability.WindowManager.WindowManager.Core **Parameters** @@ -133,7 +133,7 @@ getAllDisplay(): Promise<Array<Display>> Obtains all the display objects. -**System capabilities**: SystemCapability.WindowManager.WindowManager.Core +**System capability**: SystemCapability.WindowManager.WindowManager.Core **Return value** @@ -158,7 +158,7 @@ on(type: 'add'|'remove'|'change', callback: Callback<number>): void Enables listening. -**System capabilities**: SystemCapability.WindowManager.WindowManager.Core +**System capability**: SystemCapability.WindowManager.WindowManager.Core **Parameters** | Name| Type| Mandatory| Description| @@ -182,7 +182,7 @@ off(type: 'add'|'remove'|'change', callback?: Callback<number>): void Disables listening. -**System capabilities**: SystemCapability.WindowManager.WindowManager.Core +**System capability**: SystemCapability.WindowManager.WindowManager.Core **Parameters** | Name| Type| Mandatory| Description| diff --git a/en/application-dev/reference/apis/js-apis-formextension.md b/en/application-dev/reference/apis/js-apis-formextension.md index f7302bbc65e031f06b732d519c8320172278ab83..dea964de0b45fdeca88defea6cb06cd70d8eb43a 100644 --- a/en/application-dev/reference/apis/js-apis-formextension.md +++ b/en/application-dev/reference/apis/js-apis-formextension.md @@ -1,6 +1,6 @@ # FormExtension -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> 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. Provides **FormExtension** APIs. @@ -35,7 +35,7 @@ Called to notify the widget provider that a **Form** instance (widget) has been | Name| Type | Mandatory| Description | | ------ | -------------------------------------- | ---- | ------------------------------------------------------------ | - | want | [Want](js-apis-featureAbility.md#want) | Yes | Information related to the extension, including the widget ID, name, and style. The information must be managed as persistent data to facilitate subsequent widget update and deletion.| + | want | [Want](js-apis-application-Want.md) | Yes | Information related to the extension, including the widget ID, name, and style. The information must be managed as persistent data to facilitate subsequent widget update and deletion.| **Return value** diff --git a/en/application-dev/reference/apis/js-apis-formhost.md b/en/application-dev/reference/apis/js-apis-formhost.md index 0cf54af57b8aacb91bb487e49bf8a74074ecc8da..0c01c3bcbca95cfd5fd9b2b5c42f06faa1b83fbb 100644 --- a/en/application-dev/reference/apis/js-apis-formhost.md +++ b/en/application-dev/reference/apis/js-apis-formhost.md @@ -1,6 +1,6 @@ # FormHost -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> ![icon-note.gif](public_sys-resources/icon-note.gif) **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. Provides APIs related to the widget host. @@ -23,24 +23,24 @@ deleteForm(formId: string, callback: AsyncCallback<void>): void; Deletes a widget. This API uses an asynchronous callback to return the result. After this API is called, the application can no longer use the widget, and the Widget Manager will not retain the widget information. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | formId | string | Yes | ID of a widget.| - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| formId | string | Yes | ID of a widget.| +| callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** ```js var formId = "12400633174999288"; formHost.deleteForm(formId, (error, data) => { - if (error) { - console.log('formHost deleteForm, error:' + error.code); + if (error.code) { + console.log('formHost deleteForm, error:' + JSON.stringify(error)); } }); ``` @@ -51,7 +51,7 @@ deleteForm(formId: string): Promise<void>; Deletes a widget. This API uses a promise to return the result. After this API is called, the application can no longer use the widget, and the Widget Manager will not retain the widget information. -**System capability**: +**System capability** SystemCapability.Ability.Form @@ -71,8 +71,10 @@ SystemCapability.Ability.Form ```js var formId = "12400633174999288"; - formHost.deleteForm(formId).catch((error) => { - console.log('formProvider deleteForm, error:' + JSON.stringify(error)); + formHost.deleteForm(formId).then(() => { + console.log('formHost deleteForm success'); + }).catch((error) => { + console.log('formHost deleteForm, error:' + JSON.stringify(error)); }); ``` @@ -82,24 +84,24 @@ releaseForm(formId: string, callback: AsyncCallback<void>): void; Releases a widget. This API uses an asynchronous callback to return the result. After this API is called, the application can no longer use the widget, but the Widget Manager still retains the widget cache and storage information. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | formId | string | Yes | ID of a widget.| - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| formId | string | Yes | ID of a widget.| +| callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** ```js var formId = "12400633174999288"; formHost.releaseForm(formId, (error, data) => { - if (error) { - console.log('formHost releaseForm, error:' + error.code); + if (error.code) { + console.log('formHost releaseForm, error:' + JSON.stringify(error)); } }); ``` @@ -108,27 +110,27 @@ SystemCapability.Ability.Form releaseForm(formId: string, isReleaseCache: boolean, callback: AsyncCallback<void>): void; -Releases a widget. This API uses an asynchronous callback to return the result. After this API is called, the application can no longer use the widget, but the Widget Manager retains the storage information about the widget and determines whether to retain the cache information based on the setting. +Releases a widget. This API uses an asynchronous callback to return the result. After this API is called, the application can no longer use the widget, but the Widget Manager retains the storage information about the widget and retains or releases the cache information based on the setting. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name | Type | Mandatory| Description | - | -------------- | ------ | ---- | ----------- | - | formId | string | Yes | ID of a widget. | - | isReleaseCache | boolean | Yes | Whether to release the cache.| - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------------- | ------ | ---- | ----------- | +| formId | string | Yes | ID of a widget. | +| isReleaseCache | boolean | Yes | Whether to release the cache.| +| callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** ```js var formId = "12400633174999288"; formHost.releaseForm(formId, true, (error, data) => { - if (error) { - console.log('formHost releaseForm, error:' + error.code); + if (error.code) { + console.log('formHost releaseForm, error:' + JSON.stringify(error)); } }); ``` @@ -137,9 +139,9 @@ SystemCapability.Ability.Form releaseForm(formId: string, isReleaseCache?: boolean): Promise<void>; -Releases a widget. This API uses a promise to return the result. After this API is called, the application can no longer use the widget, but the Widget Manager retains the storage information about the widget and determines whether to retain the cache information based on the setting. +Releases a widget. This API uses a promise to return the result. After this API is called, the application can no longer use the widget, but the Widget Manager retains the storage information about the widget and retains or releases the cache information based on the setting. -**System capability**: +**System capability** SystemCapability.Ability.Form @@ -160,8 +162,10 @@ SystemCapability.Ability.Form ```js var formId = "12400633174999288"; - formHost.releaseForm(formId, true).catch((error) => { - console.log('formProvider releaseForm, error:' + JSON.stringify(error)); + formHost.releaseForm(formId, true).then(() => { + console.log('formHost releaseForm success'); + }).catch((error) => { + console.log('formHost releaseForm, error:' + JSON.stringify(error)); }); ``` @@ -177,18 +181,18 @@ SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | formId | string | Yes | ID of a widget.| - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| formId | string | Yes | ID of a widget.| +| callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** ```js var formId = "12400633174999288"; formHost.requestForm(formId, (error, data) => { - if (error) { - console.log('formHost requestForm, error:' + error.code); + if (error.code) { + console.log('formHost requestForm, error:' + JSON.stringify(error)); } }); ``` @@ -219,8 +223,10 @@ SystemCapability.Ability.Form ```js var formId = "12400633174999288"; - formHost.requestForm(formId).catch((error) => { - console.log('formProvider requestForm, error:' + JSON.stringify(error)); + formHost.requestForm(formId).then(() => { + console.log('formHost requestForm success'); + }).catch((error) => { + console.log('formHost requestForm, error:' + JSON.stringify(error)); }); ``` @@ -230,24 +236,24 @@ castTempForm(formId: string, callback: AsyncCallback<void>): void; Converts a temporary widget to a normal one. This API uses an asynchronous callback to return the result. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | formId | string | Yes | ID of a widget.| - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| formId | string | Yes | ID of a widget.| +| callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** ```js var formId = "12400633174999288"; formHost.castTempForm(formId, (error, data) => { - if (error) { - console.log('formHost castTempForm, error:' + error.code); + if (error.code) { + console.log('formHost castTempForm, error:' + JSON.stringify(error)); } }); ``` @@ -258,7 +264,7 @@ castTempForm(formId: string): Promise<void>; Converts a temporary widget to a normal one. This API uses a promise to return the result. -**System capability**: +**System capability** SystemCapability.Ability.Form @@ -278,54 +284,56 @@ SystemCapability.Ability.Form ```js var formId = "12400633174999288"; - formHost.castTempForm(formId).catch((error) => { - console.log('formProvider castTempForm, error:' + JSON.stringify(error)); + formHost.castTempForm(formId).then(() => { + console.log('formHost castTempForm success'); + }).catch((error) => { + console.log('formHost castTempForm, error:' + JSON.stringify(error)); }); ``` ## notifyVisibleForms -notifyVisibleForms(formId: string, callback: AsyncCallback<void>): void; +notifyVisibleForms(formIds: Array<string>, callback: AsyncCallback<void>): void; Instructs the widget framework to make a widget visible. This API uses an asynchronous callback to return the result. After this API is called, **onVisibilityChange** is invoked to notify the widget provider. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | formId | string | Yes | ID of a widget.| - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| formIds | Array<string> | Yes | List of widget IDs. | +| callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** ```js var formId = "12400633174999288"; formHost.notifyVisibleForms(formId, (error, data) => { - if (error) { - console.log('formHost notifyVisibleForms, error:' + error.code); + if (error.code) { + console.log('formHost notifyVisibleForms, error:' + JSON.stringify(error)); } }); ``` ## notifyVisibleForms -notifyVisibleForms(formId: string): Promise<void>; +notifyVisibleForms(formIds: Array<string>): Promise<void>; Instructs the widget framework to make a widget visible. This API uses a promise to return the result. After this API is called, **onVisibilityChange** is invoked to notify the widget provider. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | formId | string | Yes | ID of a widget.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| formIds | Array<string> | Yes | List of widget IDs.| **Return value** @@ -337,54 +345,56 @@ SystemCapability.Ability.Form ```js var formId = "12400633174999288"; - formHost.notifyVisibleForms(formId).catch((error) => { - console.log('formProvider notifyVisibleForms, error:' + JSON.stringify(error)); + formHost.notifyVisibleForms(formId).then(() => { + console.log('formHost notifyVisibleForms success'); + }).catch((error) => { + console.log('formHost notifyVisibleForms, error:' + JSON.stringify(error)); }); ``` ## notifyInvisibleForms -notifyInvisibleForms(formId: string, callback: AsyncCallback<void>): void; +notifyInvisibleForms(formIds: Array<string>, callback: AsyncCallback<void>): void; Instructs the widget framework to make a widget invisible. This API uses an asynchronous callback to return the result. After this API is called, **onVisibilityChange** is invoked to notify the widget provider. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | formId | string | Yes | ID of a widget.| - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| formIds | Array<string> | Yes | List of widget IDs. | +| callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** ```js var formId = "12400633174999288"; formHost.notifyInvisibleForms(formId, (error, data) => { - if (error) { - console.log('formHost notifyInvisibleForms, error:' + error.code); + if (error.code) { + console.log('formHost notifyInvisibleForms, error:' + JSON.stringify(error)); } }); ``` ## notifyInvisibleForms -notifyInvisibleForms(formId: string): Promise<void>; +notifyInvisibleForms(formIds: Array<string>): Promise<void>; Instructs the widget framework to make a widget invisible. This API uses a promise to return the result. After this API is called, **onVisibilityChange** is invoked to notify the widget provider. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | formId | string | Yes | ID of a widget.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| formIds | Array<string> | Yes | List of widget IDs.| **Return value** @@ -396,54 +406,56 @@ SystemCapability.Ability.Form ```js var formId = "12400633174999288"; - formHost.notifyInvisibleForms(formId).catch((error) => { - console.log('formProvider notifyInvisibleForms, error:' + JSON.stringify(error)); + formHost.notifyInvisibleForms(formId).then(() => { + console.log('formHost notifyInvisibleForms success'); + }).catch((error) => { + console.log('formHost notifyInvisibleForms, error:' + JSON.stringify(error)); }); ``` ## enableFormsUpdate -enableFormsUpdate(formId: string, callback: AsyncCallback<void>): void; +enableFormsUpdate(formIds: Array<string>, callback: AsyncCallback<void>): void; -Instructs the widget framework to make a widget to be updatable. This API uses an asynchronous callback to return the result. After this API is called, the widget is in the enabled state and can receive updates from the widget provider. +Instructs the widget framework to make a widget updatable. This API uses an asynchronous callback to return the result. After this API is called, the widget is in the enabled state and can receive updates from the widget provider. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | formId | string | Yes | ID of a widget.| - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| formIds | Array<string> | Yes | List of widget IDs. | +| callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** ```js var formId = "12400633174999288"; formHost.enableFormsUpdate(formId, (error, data) => { - if (error) { - console.log('formHost enableFormsUpdate, error:' + error.code); + if (error.code) { + console.log('formHost enableFormsUpdate, error:' + JSON.stringify(error)); } }); ``` ## enableFormsUpdate -enableFormsUpdate(formId: string): Promise<void>; +enableFormsUpdate(formIds: Array<string>): Promise<void>; -Instructs the widget framework to make a widget to be updatable. This API uses a promise to return the result. After this API is called, the widget is in the enabled state and can receive updates from the widget provider. +Instructs the widget framework to make a widget updatable. This API uses a promise to return the result. After this API is called, the widget is in the enabled state and can receive updates from the widget provider. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | formId | string | Yes | ID of a widget.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| formIds | Array<string> | Yes | List of widget IDs.| **Return value** @@ -455,54 +467,56 @@ SystemCapability.Ability.Form ```js var formId = "12400633174999288"; - formHost.enableFormsUpdate(formId).catch((error) => { - console.log('formProvider enableFormsUpdate, error:' + JSON.stringify(error)); + formHost.enableFormsUpdate(formId).then(() => { + console.log('formHost enableFormsUpdate success'); + }).catch((error) => { + console.log('formHost enableFormsUpdate, error:' + JSON.stringify(error)); }); ``` ## disableFormsUpdate -disableFormsUpdate(formId: string, callback: AsyncCallback<void>): void; +disableFormsUpdate(formIds: Array<string>, callback: AsyncCallback<void>): void; -Instructs the widget framework to make a widget not to be updatable. This API uses an asynchronous callback to return the result. After this API is called, the widget is in the disabled state and cannot receive updates from the widget provider. +Instructs the widget framework to make a widget not updatable. This API uses an asynchronous callback to return the result. After this API is called, the widget cannot receive updates from the widget provider. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | formId | string | Yes | ID of a widget.| - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| formIds | Array<string> | Yes | List of widget IDs. | +| callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** ```js var formId = "12400633174999288"; formHost.disableFormsUpdate(formId, (error, data) => { - if (error) { - console.log('formHost disableFormsUpdate, error:' + error.code); + if (error.code) { + console.log('formHost disableFormsUpdate, error:' + JSON.stringify(error)); } }); ``` ## disableFormsUpdate -disableFormsUpdate(formId: string): Promise<void>; +disableFormsUpdate(formIds: Array<string>): Promise<void>; -Instructs the widget framework to make a widget not to be updatable. This API uses a promise to return the result. After this API is called, the widget is in the disabled state and cannot receive updates from the widget provider. +Instructs the widget framework to make a widget not updatable. This API uses a promise to return the result. After this API is called, the widget cannot receive updates from the widget provider. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | formId | string | Yes | ID of a widget.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| formIds | Array<string> | Yes | List of widget IDs.| **Return value** @@ -514,8 +528,10 @@ SystemCapability.Ability.Form ```js var formId = "12400633174999288"; - formHost.disableFormsUpdate(formId).catch((error) => { - console.log('formProvider disableFormsUpdate, error:' + JSON.stringify(error)); + formHost.disableFormsUpdate(formId).then(() => { + console.log('formHost disableFormsUpdate success'); + }).catch((error) => { + console.log('formHost disableFormsUpdate, error:' + JSON.stringify(error)); }); ``` @@ -525,23 +541,23 @@ isSystemReady(callback: AsyncCallback<void>): void; Checks whether the system is ready. This API uses an asynchronous callback to return the result. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** ```js var formId = "12400633174999288"; formHost.isSystemReady((error, data) => { - if (error) { - console.log('formHost isSystemReady, error:' + error.code); + if (error.code) { + console.log('formHost isSystemReady, error:' + JSON.stringify(error)); } }); ``` @@ -552,7 +568,7 @@ isSystemReady(): Promise<void>; Checks whether the system is ready. This API uses a promise to return the result. -**System capability**: +**System capability** SystemCapability.Ability.Form @@ -566,8 +582,10 @@ SystemCapability.Ability.Form ```js var formId = "12400633174999288"; - formHost.isSystemReady().catch((error) => { - console.log('formProvider isSystemReady, error:' + JSON.stringify(error)); + formHost.isSystemReady().then(() => { + console.log('formHost isSystemReady success'); + }).catch((error) => { + console.log('formHost isSystemReady, error:' + JSON.stringify(error)); }); ``` @@ -577,7 +595,7 @@ getAllFormsInfo(callback: AsyncCallback<Array<FormInfo>>): void; Obtains the widget information provided by all applications on the device. This API uses an asynchronous callback to return the result. -**System capability**: +**System capability** SystemCapability.Ability.Form @@ -591,8 +609,10 @@ SystemCapability.Ability.Form ```js formHost.getAllFormsInfo((error, data) => { - if (error) { - console.log('formHost getAllFormsInfo, error:' + error.code); + if (error.code) { + console.log('formHost getAllFormsInfo, error:' + JSON.stringify(error)); + } else { + console.log('formHost getAllFormsInfo, data:' + JSON.stringify(data)); } }); ``` @@ -603,7 +623,7 @@ getAllFormsInfo(): Promise<Array<FormInfo>>; Obtains the widget information provided by all applications on the device. This API uses a promise to return the result. -**System capability**: +**System capability** SystemCapability.Ability.Form @@ -616,8 +636,10 @@ SystemCapability.Ability.Form **Example** ```js - formHost.getAllFormsInfo().catch((error) => { - console.log('formProvider getAllFormsInfo, error:' + JSON.stringify(error)); + formHost.getAllFormsInfo().then((data) => { + console.log('formHost getAllFormsInfo data:' + JSON.stringify(data)); + }).catch((error) => { + console.log('formHost getAllFormsInfo, error:' + JSON.stringify(error)); }); ``` @@ -627,7 +649,7 @@ getFormsInfo(bundleName: string, callback: AsyncCallback<Array<FormInfo> Obtains the widget information provided by a given application on the device. This API uses an asynchronous callback to return the result. -**System capability**: +**System capability** SystemCapability.Ability.Form @@ -641,9 +663,11 @@ SystemCapability.Ability.Form **Example** ```js - formHost.getFormsInfo("com.example.ohos.accountjsdemo", (error, data) => { - if (error) { - console.log('formHost getFormsInfo, error:' + error.code); + formHost.getFormsInfo("com.example.ohos.formjsdemo", (error, data) => { + if (error.code) { + console.log('formHost getFormsInfo, error:' + JSON.stringify(error)); + } else { + console.log('formHost getFormsInfo, data:' + JSON.stringify(data)); } }); ``` @@ -654,7 +678,7 @@ getFormsInfo(bundleName: string, moduleName: string, callback: AsyncCallback< Obtains the widget information provided by a given application on the device. This API uses an asynchronous callback to return the result. -**System capability**: +**System capability** SystemCapability.Ability.Form @@ -669,9 +693,11 @@ SystemCapability.Ability.Form **Example** ```js - formHost.getFormsInfo("com.example.ohos.accountjsdemo", (error, data) => { - if (error) { - console.log('formHost getFormsInfo, error:' + error.code); + formHost.getFormsInfo("com.example.ohos.formjsdemo", "entry", (error, data) => { + if (error.code) { + console.log('formHost getFormsInfo, error:' + JSON.stringify(error)); + } else { + console.log('formHost getFormsInfo, data:' + JSON.stringify(data)); } }); ``` @@ -682,7 +708,7 @@ getFormsInfo(bundleName: string, moduleName?: string): Promise<Array<FormI Obtains the widget information provided by a given application on the device. This API uses a promise to return the result. -**System capability**: +**System capability** SystemCapability.Ability.Form @@ -702,8 +728,10 @@ SystemCapability.Ability.Form **Example** ```js - formHost.getAllFormsInfo().catch((error) => { - console.log('formProvider getAllFormsInfo, error:' + JSON.stringify(error)); + formHost.getFormsInfo("com.example.ohos.formjsdemo", "entry").then((data) => { + console.log('formHost getFormsInfo, data:' + JSON.stringify(data)); + }).catch((error) => { + console.log('formHost getFormsInfo, error:' + JSON.stringify(error)); }); ``` @@ -713,43 +741,45 @@ deleteInvalidForms(formIds: Array<string>, callback: AsyncCallback<numb Deletes invalid widgets from the list. This API uses an asynchronous callback to return the result. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | formIds | Array<string> | Yes | List of widget IDs.| - | callback | AsyncCallback<number> | Yes| Callback used to return the number of widgets deleted.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| formIds | Array<string> | Yes | List of valid widget IDs.| +| callback | AsyncCallback<number> | Yes| Callback used to return the number of widgets deleted.| **Example** ```js var formIds = new Array("12400633174999288", "12400633174999289"); formHost.deleteInvalidForms(formIds, (error, data) => { - if (error) { - console.log('formHost deleteInvalidForms, error:' + error.code); + if (error.code) { + console.log('formHost deleteInvalidForms, error:' + JSON.stringify(error)); + } else { + console.log('formHost deleteInvalidForms, data:' + JSON.stringify(data)); } }); ``` ## deleteInvalidForms -function deleteInvalidForms(formIds: Array<string>): Promise<number>; +function deleteInvalidForms(formIds: Array<string>): Promise<number>; Deletes invalid widgets from the list. This API uses a promise to return the result. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | formIds | Array<string> | Yes | List of widget IDs.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| formIds | Array<string> | Yes | List of valid widget IDs.| **Return value** @@ -761,8 +791,10 @@ SystemCapability.Ability.Form ```js var formIds = new Array("12400633174999288", "12400633174999289"); - formHost.deleteInvalidForms(formIds).catch((error) => { - console.log('formProvider deleteInvalidForms, error:' + JSON.stringify(error)); + formHost.deleteInvalidForms(formIds).then((data) => { + console.log('formHost deleteInvalidForms, data:' + JSON.stringify(data)); + }).catch((error) => { + console.log('formHost deleteInvalidForms, error:' + JSON.stringify(error)); }); ``` @@ -772,7 +804,7 @@ acquireFormState(want: Want, callback: AsyncCallback<FormStateInfo>): void Obtains the widget state. This API uses an asynchronous callback to return the result. -**System capability**: +**System capability** SystemCapability.Ability.Form @@ -780,7 +812,7 @@ SystemCapability.Ability.Form | Name| Type | Mandatory| Description | | ------ | ------ | ---- | ------- | -| want | [Want](js-apis-featureAbility.md#want) | Yes | **Want** information carried to query the widget state.| +| want | [Want](js-apis-application-Want.md) | Yes | **Want** information carried to query the widget state.| | callback | AsyncCallback<[FormStateInfo](js-apis-formInfo.md#formstateinfo)> | Yes| Callback used to return the widget state.| **Example** @@ -792,8 +824,10 @@ SystemCapability.Ability.Form "abilityName": "com.extreme.test.MainAbility" }; formHost.acquireFormState(want, (error, data) => { - if (error) { - console.log('formHost acquireFormState, error:' + error.code); + if (error.code) { + console.log('formHost acquireFormState, error:' + JSON.stringify(error)); + } else { + console.log('formHost acquireFormState, data:' + JSON.stringify(data)); } }); ``` @@ -806,9 +840,9 @@ Obtains the widget state. This API uses a promise to return the result. **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | formIds | Array<string> | Yes | List of widget IDs.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| want | [Want](js-apis-application-Want.md) | Yes | **Want** information carried to query the widget state.| **Return value** @@ -816,7 +850,7 @@ Obtains the widget state. This API uses a promise to return the result. | :------------ | :---------------------------------- | | Promise<[FormStateInfo](js-apis-formInfo.md#formstateinfo)> | Promise used to return the widget state.| -**System capability**: +**System capability** SystemCapability.Ability.Form @@ -828,8 +862,10 @@ SystemCapability.Ability.Form "bundleName": "com.extreme.test", "abilityName": "com.extreme.test.MainAbility" }; - formHost.acquireFormState(want).catch((error) => { - console.log('formProvider acquireFormState, error:' + JSON.stringify(error)); + formHost.acquireFormState(want).then((data) => { + console.log('formHost acquireFormState, data:' + JSON.stringify(data)); + }).catch((error) => { + console.log('formHost acquireFormState, error:' + JSON.stringify(error)); }); ``` @@ -839,52 +875,50 @@ on(type: "formUninstall", callback: Callback<string>): void; Subscribes to widget uninstall events. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | type | string | Yes | Type of event to subscribe to. The value **formUninstall** indicates a widget uninstallation event.| - | callback | Callback<string> | Yes| Callback used to return the result.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| type | string | Yes | Type of event to subscribe to. The value **formUninstall** indicates a widget uninstallation event.| +| callback | Callback<string> | Yes| Callback used for event subscription.| **Example** ```js - formHost.on("formUninstall", (error, data) => { - if (error) { - console.log('formHost on formUninstall, error:' + error.code); - } - }); + let callback = function(formId) { + console.log('formHost on formUninstall, formId:' + formId); + } + formHost.on("formUninstall", callback); ``` ## off("formUninstall") -off(type: "formUninstall", callback: Callback<string>): void; +off(type: "formUninstall", callback?: Callback<string>): void; Unsubscribes from widget uninstall events. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | type | string | Yes | Type of event to unsubscribe from. The value **formUninstall** indicates a widget uninstallation event.| - | callback | Callback<string> | Yes| Callback used to return the result.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| type | string | Yes | Type of event to subscribe to. The value **formUninstall** indicates a widget uninstallation event.| +| callback | Callback<string> | No| Callback used for event unsubscription. If it is left unspecified, it indicates the callback for all the events that have been subscribed.| **Example** ```js - formHost.off("formUninstall", (error, data) => { - if (error) { - console.log('formHost off formUninstall, error:' + error.code); - } - }); + let callback = function(formId) { + console.log('formHost on formUninstall, formId:' + formId); + } + formHost.off("formUninstall", callback); ``` ## notifyFormsVisible @@ -893,25 +927,25 @@ notifyFormsVisible(formIds: Array<string>, isVisible: boolean, callback: A Instructs the widgets to make themselves visible. This API uses an asynchronous callback to return the result. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | formIds | Array<string> | Yes | List of widget IDs.| - | isVisible | boolean | Yes | Whether to be visible.| - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| formIds | Array<string> | Yes | List of widget IDs.| +| isVisible | boolean | Yes | Whether to be visible.| +| callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** ```js var formIds = new Array("12400633174999288", "12400633174999289"); formHost.notifyFormsVisible(formIds, true, (error, data) => { - if (error) { - console.log('formHost notifyFormsVisible, error:' + error.code); + if (error.code) { + console.log('formHost notifyFormsVisible, error:' + JSON.stringify(error)); } }); ``` @@ -922,7 +956,7 @@ notifyFormsVisible(formIds: Array<string>, isVisible: boolean): Promise< Instructs the widgets to make themselves visible. This API uses a promise to return the result. -**System capability**: +**System capability** SystemCapability.Ability.Form @@ -943,8 +977,10 @@ SystemCapability.Ability.Form ```js var formIds = new Array("12400633174999288", "12400633174999289"); - formHost.notifyFormsVisible(formIds, true).catch((error) => { - console.log('formProvider notifyFormsVisible, error:' + JSON.stringify(error)); + formHost.notifyFormsVisible(formIds, true).then(() => { + console.log('formHost notifyFormsVisible success'); + }).catch((error) => { + console.log('formHost notifyFormsVisible, error:' + JSON.stringify(error)); }); ``` @@ -952,27 +988,27 @@ SystemCapability.Ability.Form notifyFormsEnableUpdate(formIds: Array<string>, isEnableUpdate: boolean, callback: AsyncCallback<void>): void; -Instructs the widgets to enable or disable update. This API uses an asynchronous callback to return the result. +Instructs the widgets to enable or disable updates. This API uses an asynchronous callback to return the result. -**System capability**: +**System capability** SystemCapability.Ability.Form **Parameters** - | Name| Type | Mandatory| Description | - | ------ | ------ | ---- | ------- | - | formIds | Array<string> | Yes | List of widget IDs.| - | isEnableUpdate | boolean | Yes | Whether to enable update.| - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------- | +| formIds | Array<string> | Yes | List of widget IDs.| +| isEnableUpdate | boolean | Yes | Whether to enable update.| +| callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** ```js var formIds = new Array("12400633174999288", "12400633174999289"); formHost.notifyFormsEnableUpdate(formIds, true, (error, data) => { - if (error) { - console.log('formHost notifyFormsEnableUpdate, error:' + error.code); + if (error.code) { + console.log('formHost notifyFormsEnableUpdate, error:' + JSON.stringify(error)); } }); ``` @@ -981,9 +1017,9 @@ SystemCapability.Ability.Form notifyFormsEnableUpdate(formIds: Array<string>, isEnableUpdate: boolean): Promise<void>; -Instructs the widgets to enable or disable update. This API uses a promise to return the result. +Instructs the widgets to enable or disable updates. This API uses a promise to return the result. -**System capability**: +**System capability** SystemCapability.Ability.Form @@ -1004,7 +1040,9 @@ SystemCapability.Ability.Form ```js var formIds = new Array("12400633174999288", "12400633174999289"); - formHost.notifyFormsEnableUpdate(formIds, true).catch((error) => { - console.log('formProvider notifyFormsEnableUpdate, error:' + JSON.stringify(error)); + formHost.notifyFormsEnableUpdate(formIds, true).then(() => { + console.log('formHost notifyFormsEnableUpdate success'); + }).catch((error) => { + console.log('formHost notifyFormsEnableUpdate, error:' + JSON.stringify(error)); }); ``` diff --git a/en/application-dev/reference/apis/js-apis-hidebug.md b/en/application-dev/reference/apis/js-apis-hidebug.md index 0c64cfbb3dca5439a38adc0f4090322a10604680..1a60d7d8e44145f22df7a25328f371e578fcc302 100644 --- a/en/application-dev/reference/apis/js-apis-hidebug.md +++ b/en/application-dev/reference/apis/js-apis-hidebug.md @@ -1,6 +1,6 @@ # HiDebug -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> **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. You can run the hidebug command to obtain the memory usage of an application, including the static heap memory (native heap) and proportional set size (PSS) occupied by the application process. You can also export VM memory slices and collect VM CPU profiling data. @@ -18,6 +18,8 @@ getNativeHeapSize(): bigint Obtains the total size of the native heap memory. +This API is defined but not implemented in OpenHarmony 3.1 Release. + **System capability**: SystemCapability.HiviewDFX.HiProfiler.HiDebug **Return value** @@ -39,6 +41,8 @@ getNativeHeapAllocatedSize(): bigint Obtains the size of the allocated native heap memory. +This API is defined but not implemented in OpenHarmony 3.1 Release. + **System capability**: SystemCapability.HiviewDFX.HiProfiler.HiDebug @@ -60,6 +64,8 @@ getNativeHeapFreeSize(): bigint Obtains the size of the free native heap memory. +This API is defined but not implemented in OpenHarmony 3.1 Release. + **System capability**: SystemCapability.HiviewDFX.HiProfiler.HiDebug diff --git a/en/application-dev/reference/apis/js-apis-hitracechain.md b/en/application-dev/reference/apis/js-apis-hitracechain.md index 3b90d20a1ea1199ba2da94d3e600d1bf6c9b2e5f..485eddc0fbfb59946228e859760885ad0ce1b633 100644 --- a/en/application-dev/reference/apis/js-apis-hitracechain.md +++ b/en/application-dev/reference/apis/js-apis-hitracechain.md @@ -155,6 +155,7 @@ Sets a trace ID. This API works in synchronous manner. **Example** ```js +let asyncTraceId; let traceId = hiTraceChain.begin("business"); // Set the current trace ID after the service logic is executed for several times. hiTraceChain.setId(asyncTraceId); @@ -297,7 +298,7 @@ Enables the specified trace flag in the **HiTraceId** instance. This API works i ```js let asyncTraceId = hiTraceChain.begin("business", hiTraceChain.HiTraceFlag.INCLUDE_ASYNC); -hiTraceChain.enable(asyncTraceId, hiTraceChain.HiTraceFlag.DONOT_CREATE_SPAN); +hiTraceChain.enableFlag(asyncTraceId, hiTraceChain.HiTraceFlag.DONOT_CREATE_SPAN); // The value of enabledDoNotCreateSpanFlag is true. let enabledDoNotCreateSpanFlag = hiTraceChain.isFlagEnabled(asyncTraceId, hiTraceChain.HiTraceFlag.DONOT_CREATE_SPAN); -``` \ No newline at end of file +``` diff --git a/en/application-dev/reference/apis/js-apis-hitracemeter.md b/en/application-dev/reference/apis/js-apis-hitracemeter.md index c77e4f8125228ec96fdc602e9d781fbff863a894..656063edf90a71a74e8f7b5e90375acfccfdae9c 100644 --- a/en/application-dev/reference/apis/js-apis-hitracemeter.md +++ b/en/application-dev/reference/apis/js-apis-hitracemeter.md @@ -34,7 +34,6 @@ If the trace tasks with the same name are not performed at the same time, the sa ```js hiTraceMeter.startTrace("myTestFunc", 1); -hiTraceMeter.startTrace("myTestFunc", 1, 5); // The expected duration of the trace task is 5 ms. ``` diff --git a/en/application-dev/reference/apis/js-apis-medialibrary.md b/en/application-dev/reference/apis/js-apis-medialibrary.md index 5499cc815509f85de6930cf7130d7ac1e74f259a..6b1b11f9e17627eea877edf5b34b25551f25ce24 100644 --- a/en/application-dev/reference/apis/js-apis-medialibrary.md +++ b/en/application-dev/reference/apis/js-apis-medialibrary.md @@ -1,6 +1,6 @@ # Media Library Management -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> **NOTE**
> This component is supported since API version 6. Updates will be marked with a superscript to indicate their earliest API version. ## Modules to Import @@ -208,7 +208,7 @@ async function example() { let mediaType = mediaLibrary.MediaType.IMAGE; let DIR_IMAGE = mediaLibrary.DirectoryType.DIR_IMAGE; const path = await media.getPublicDirectory(DIR_IMAGE); - mediaLibrary.createAsset(mediaType, 'imageCallBack.jpg', path + 'myPicture/', (err, fileAsset) => { + media.createAsset(mediaType, 'imageCallBack.jpg', path + 'myPicture/', (err, fileAsset) => { if (fileAsset != undefined) { console.info('createAsset successfully, message = ' + err); } else { @@ -250,7 +250,7 @@ async function example() { let mediaType = mediaLibrary.MediaType.IMAGE; let DIR_IMAGE = mediaLibrary.DirectoryType.DIR_IMAGE; const path = await media.getPublicDirectory(DIR_IMAGE); - mediaLibrary.createAsset(mediaType, "image01.jpg", path + 'myPicture/').then (function (asset) { + media.createAsset(mediaType, "image01.jpg", path + 'myPicture/').then (function (asset) { console.info("createAsset successfully:"+ JSON.stringify(asset)); }).catch(function(err){ console.info("createAsset failed with error:"+ err); @@ -720,29 +720,29 @@ Provides APIs for encapsulating file asset attributes. **System capability**: SystemCapability.Multimedia.MediaLibrary.Core -| Name | Type | Readable | Writable | Description | +| Name | Type | Readable| Writable| Description | | ------------------------- | ------------------------ | ---- | ---- | ------------------------------------------------------ | -| id | number | Yes | No | File asset ID. | -| uri | string | Yes | No | File asset URI, for example, dataability:///media/image/2. | -| mimeType | string | Yes | No | Extended file attributes. | -| mediaType8+ | [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. | -| relativePath8+ | string | Yes | Yes | Relative public directory of the file. | -| parent8+ | number | Yes | No | Parent directory ID. | -| size | number | Yes | No | File size, in bytes. | -| dateAdded | number | Yes | No | Date when the file was added. (The value is the number of seconds elapsed since the Epoch time.) | -| dateModified | number | Yes | No | Date when the file was modified. (The value is the number of seconds elapsed since the Epoch time.) | -| dateTaken | number | Yes | No | Date when the file (photo) was taken. (The value is the number of seconds elapsed since the Epoch time.) | -| artist8+ | string | Yes | No | Artist of the file. | -| audioAlbum8+ | string | Yes | No | Audio album. | -| width | number | Yes | No | Image width, in pixels. | -| height | number | Yes | No | Image height, in pixels. | -| orientation | number | Yes | Yes | Image display direction (clockwise rotation angle, for example, 0, 90, or 180, in degrees). | -| duration8+ | number | Yes | No | Duration, in seconds. | -| albumId | number | Yes | No | ID of the album to which the file belongs. | -| albumUri8+ | string | Yes | No | URI of the album to which the file belongs. | -| albumName | string | Yes | No | Name of the album to which the file belongs. | +| id | number | Yes | No | File asset ID. | +| uri | string | Yes | No | File asset URI, for example, dataability:///media/image/2. | +| mimeType | string | Yes | No | Extended file attributes. | +| mediaType8+ | [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. | +| relativePath8+ | string | Yes | Yes | Relative public directory of the file. | +| parent8+ | number | Yes | No | Parent directory ID. | +| size | number | Yes | No | File size, in bytes. | +| dateAdded | number | Yes | No | Date when the file was added. (The value is the number of seconds elapsed since the Epoch time.) | +| dateModified | number | Yes | No | Date when the file was modified. (The value is the number of seconds elapsed since the Epoch time.) | +| dateTaken | number | Yes | No | Date when the file (photo) was taken. (The value is the number of seconds elapsed since the Epoch time.) | +| artist8+ | string | Yes | No | Artist of the file. | +| audioAlbum8+ | string | Yes | No | Audio album. | +| width | number | Yes | No | Image width, in pixels. | +| height | number | Yes | No | Image height, in pixels. | +| orientation | number | Yes | Yes | Image display direction (clockwise rotation angle, for example, 0, 90, or 180, in degrees).| +| duration8+ | number | Yes | No | Duration, in seconds. | +| albumId | number | Yes | No | ID of the album to which the file belongs. | +| albumUri8+ | string | Yes | No | URI of the album to which the file belongs. | +| albumName | string | Yes | No | Name of the album to which the file belongs. | ### isDirectory8+ @@ -757,9 +757,9 @@ Checks whether this file asset is a directory. This API uses an asynchronous cal **Parameters** -| Parameter | Type | Mandatory | Description | +| Name | Type | Mandatory | Description | | -------- | ---------------------------- | ---- | ------------------- | -| callback | AsyncCallback<boolean> | Yes | Callback used to return whether the file asset is a directory. | +| callback | AsyncCallback<boolean> | Yes | Callback used to return whether the file asset is a directory.| **Example** diff --git a/en/application-dev/reference/apis/js-apis-missionManager.md b/en/application-dev/reference/apis/js-apis-missionManager.md index a36fc053da29747df95dcab84468288cd7421acc..a9c0c75becf3397a933fe15dc57429029759624b 100644 --- a/en/application-dev/reference/apis/js-apis-missionManager.md +++ b/en/application-dev/reference/apis/js-apis-missionManager.md @@ -1,11 +1,11 @@ # missionManager -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> ![icon-note.gif](public_sys-resources/icon-note.gif) **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. -Provides mission management. You can use the APIs to lock, unlock, and clear missions, and switch a mission to the foreground. +missionManager provides APIs to lock, unlock, and clear missions, and switch a mission to the foreground. ## Modules to Import @@ -34,7 +34,7 @@ Registers a listener to observe the mission status. | Type| Description| | -------- | -------- | - | number | Returns the index of the listener, which is created by the system and allocated when the mission status listener is registered. Each listener has a unique index.| + | number | Returns the unique index of the mission status listener, which is created by the system and allocated when the listener is registered.| **Example** @@ -55,7 +55,7 @@ Registers a listener to observe the mission status. unregisterMissionListener(listenerId: number, callback: AsyncCallback<void>): void; -Unregisters a mission status listener. This API uses an asynchronous callback to return the result. +Deregisters a mission status listener. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Mission @@ -63,7 +63,7 @@ Unregisters a mission status listener. This API uses an asynchronous callback to | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | - | listenerId | number | Yes| Index of the mission status listener to unregister. Each listener has a unique index, which is returned by **registerMissionListener**.| + | listenerId | number | Yes| Unique index of the mission status listener to unregister. It is returned by **registerMissionListener**.| | callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** @@ -88,7 +88,7 @@ Unregisters a mission status listener. This API uses an asynchronous callback to unregisterMissionListener(listenerId: number): Promise<void>; -Unregisters a mission status listener. This API uses a promise to return the result. +Deregisters a mission status listener. This API uses a promise to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Mission @@ -96,7 +96,7 @@ Unregisters a mission status listener. This API uses a promise to return the res | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | - | listenerId | number | Yes| Index of the mission status listener to unregister. Each listener has a unique index, which is returned by **registerMissionListener**.| + | listenerId | number | Yes| Unique index of the mission status listener to unregister. It is returned by **registerMissionListener**.| **Return value** @@ -126,7 +126,7 @@ Unregisters a mission status listener. This API uses a promise to return the res getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback<MissionInfo>): void; -Obtains the information of a given mission. This API uses an asynchronous callback to return the result. +Obtains the information about a given mission. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Mission @@ -159,7 +159,7 @@ Obtains the information of a given mission. This API uses an asynchronous callba getMissionInfo(deviceId: string, missionId: number): Promise<MissionInfo>; -Obtains the information of a given mission. This API uses a promise to return the result. +Obtains the information about a given mission. This API uses a promise to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Mission @@ -191,7 +191,7 @@ Obtains the information of a given mission. This API uses a promise to return th getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback<Array<MissionInfo>>): void; -Obtains information of all missions. This API uses an asynchronous callback to return the result. +Obtains information about all missions. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Mission @@ -220,7 +220,7 @@ Obtains information of all missions. This API uses an asynchronous callback to r getMissionInfos(deviceId: string, numMax: number): Promise<Array<MissionInfo>>; -Obtains information of all missions. This API uses a promise to return the result. +Obtains information about all missions. This API uses a promise to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Mission @@ -617,7 +617,7 @@ Switches a given mission to the foreground. This API uses an asynchronous callba moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCallback<void>): void; -Switches a given mission to the foreground, with the startup parameters for the switch specified, such as the window mode and device ID. This API uses an asynchronous callback to return the result. +Switches a given mission to the foreground, with the startup parameters for the switching specified. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Mission @@ -651,7 +651,7 @@ Switches a given mission to the foreground, with the startup parameters for the moveMissionToFront(missionId: number, options?: StartOptions): Promise<void>; -Switches a given mission to the foreground, with the startup parameters for the switch specified, such as the window mode and device ID. This API uses a promise to return the result. +Switches a given mission to the foreground, with the startup parameters for the switching specified. This API uses a promise to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Mission @@ -697,7 +697,7 @@ Describes the mission information. | runningState | number | Yes| Yes| Running state of the mission.| | lockedState | boolean | Yes| Yes| Locked state of the mission.| | timestamp | string | Yes| Yes| Latest time when the mission was created or updated.| -| want | [Want](js-apis-featureAbility.md#want) | Yes| Yes| **Want** information of the mission.| +| want | [Want](js-apis-application-Want.md) | Yes| Yes| **Want** information of the mission.| | label | string | Yes| Yes| Label of the mission.| | iconPath | string | Yes| Yes| Path of the mission icon.| | continuable | boolean | Yes| Yes| Whether the mission is continuable.| diff --git a/en/application-dev/reference/apis/js-apis-particleAbility.md b/en/application-dev/reference/apis/js-apis-particleAbility.md index 7955a810d33f3b6e9cfe23d6c939c1a83bae92c4..a5a215f95741a7467179df5e59fef4115012d5c3 100644 --- a/en/application-dev/reference/apis/js-apis-particleAbility.md +++ b/en/application-dev/reference/apis/js-apis-particleAbility.md @@ -1,6 +1,6 @@ # ParticleAbility Module -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. ## Constraints @@ -260,16 +260,16 @@ Requests a continuous task from the system. This API uses a promise to return th **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory | Description | | -------- | -------- | -------- | -------- | -| id | number | Yes| Notification ID of a continuous task.| -| request | NotificationRequest | Yes| Notification parameter, which is used to display information in the notification bar.| +| id | number | Yes | Notification ID of a continuous task. | +| request | NotificationRequest | Yes | Notification parameter, which is used to display information in the notification bar. | **Return value** -| Type | Description | +| Type | Description | | -------------- | ------------------------- | -| Promise\ | Promise used to return the result.| +| Promise\ | Promise used to return the result. | **Example** @@ -323,9 +323,9 @@ Requests to cancel a continuous task from the system. This API uses an asynchron **Parameters** - | Name| Type| Mandatory| Description| + | Name | Type | Mandatory | Description | | -------- | -------- | -------- | -------- | - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| + | callback | AsyncCallback<void> | Yes | Callback used to return the result. | **Example** @@ -354,9 +354,9 @@ Requests a continuous task from the system. This API uses a promise to return th **Return value** -| Type | Description | +| Type | Description | | -------------- | ------------------------- | -| Promise\ | Promise used to return the result.| +| Promise\ | Promise used to return the result. | **Example** @@ -382,21 +382,21 @@ Connects this ability to a specific Service ability. This API uses a callback to **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory | Description | | ------- | -------------- | ---- | ---------------------------- | -| request | [Want](js-apis-featureAbility.md#want) | Yes | Service ability to connect.| -| options | ConnectOptions | Yes | Callback used to return the result. | +| request | [Want](js-apis-application-Want.md) | Yes | Service ability to connect. | +| options | ConnectOptions | Yes | Callback used to return the result. | -ConnectOptions +**ConnectOptions** **System capability**: SystemCapability.Ability.AbilityRuntime.Core -| Name | Readable/Writable| Type | Mandatory | Description | +| Name | Readable/Writable | Type | Mandatory | Description | | ------------ | ---- | -------- | ---- | ------------------------- | -| onConnect | Read only | function | Yes | Callback invoked when the connection is successful. | -| onDisconnect | Read only | function | Yes | Callback invoked when the connection fails. | -| onFailed | Read only | function | Yes | Callback invoked when **connectAbility** fails to be called.| +| onConnect | Read only | function | Yes | Callback invoked when the connection is successful. | +| onDisconnect | Read only | function | Yes | Callback invoked when the connection fails. | +| onFailed | Read only | function | Yes | Callback invoked when **connectAbility** fails to be called. | **Example** @@ -440,9 +440,9 @@ Disconnects this ability from the Service ability. This API uses a callback to r **Parameters** - | Name| Type| Mandatory| Description| + | Name | Type | Mandatory | Description | | -------- | -------- | -------- | -------- | - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| + | callback | AsyncCallback<void> | Yes | Callback used to return the result. | **Example** @@ -486,9 +486,9 @@ Disconnects this ability from the Service ability. This API uses a promise to re **Return value** -| Type | Description | +| Type | Description | | -------------- | ------------------------- | -| Promise\ | Promise used to return the result.| +| Promise\ | Promise used to return the result. | **Example** diff --git a/en/application-dev/reference/apis/js-apis-pasteboard.md b/en/application-dev/reference/apis/js-apis-pasteboard.md index b12ac722319812d2682821495dffe35ebde1000c..c5ca90fd33c1de4b2eb4f4fff33eee5e2d899a79 100644 --- a/en/application-dev/reference/apis/js-apis-pasteboard.md +++ b/en/application-dev/reference/apis/js-apis-pasteboard.md @@ -279,7 +279,7 @@ A data record is an abstract definition of the content on the pasteboard. The pa | Name | Type | Readable | Writable | Description | | -------- | -------- | -------- | -------- | -------- | | htmlText7+ | string | Yes | No | HTML text. | -| want7+ | [Want](js-apis-featureAbility.md#want) | Yes | No | Want text. | +| want7+ | [Want](js-apis-application-Want.md) | Yes | No | Want text. | | mimeType7+ | string | Yes | No | Data type. | | plainText7+ | string | Yes | No | Plain text. | | uri7+ | string | Yes | No | URI text. | @@ -506,7 +506,7 @@ The pasteboard supports a maximum number of 128 data records. | Name | Type | Mandatory | Description | | -------- | -------- | -------- | -------- | -| want | [Want](js-apis-featureAbility.md#want) | Yes | Want object. | +| want | [Want](js-apis-application-Want.md) | Yes | Want object. | **Example** diff --git a/en/application-dev/reference/apis/js-apis-router.md b/en/application-dev/reference/apis/js-apis-router.md index 50205792031201bfae6b3bb2d8fbbcfbad0cb426..b17d29151d7c1c9a9ee53de976cd4c0f77ea838a 100644 --- a/en/application-dev/reference/apis/js-apis-router.md +++ b/en/application-dev/reference/apis/js-apis-router.md @@ -1,6 +1,6 @@ # Page Routing -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> ![icon-note.gif](public_sys-resources/icon-note.gif) **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. > - Page routing APIs can be invoked only after page rendering is complete. Do not call the APIs in **onInit** and **onReady** when the page is still in the rendering phase. @@ -24,13 +24,13 @@ Navigates to a specified page in the application. **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | options | [RouterOptions](#routeroptions) | Yes| Page routing parameters.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| options | [RouterOptions](#routeroptions) | Yes| Page routing parameters.| **Example** - ``` + ```js // Current page export default { pushPage() { @@ -46,7 +46,7 @@ Navigates to a specified page in the application. } } ``` - ``` + ```js // routerpage2 page export default { data: { @@ -72,12 +72,13 @@ Replaces the current page with another one in the application and destroys the c **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | options | [RouterOptions](#routeroptions) | Yes| Description of the new page.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| options | [RouterOptions](#routeroptions) | Yes| Description of the new page.| **Example** - ``` + + ```js // Current page export default { replacePage() { @@ -91,7 +92,7 @@ Replaces the current page with another one in the application and destroys the c } ``` - ``` + ```js // detail page export default { data: { @@ -112,12 +113,12 @@ Returns to the previous page or a specified page. **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | options | [RouterOptions](#routeroptions) | Yes| Description of the page. The **url** parameter indicates the URL of the page to return to. If the specified page does not exist in the page stack, the application does not respond. If this parameter is not set, the application returns to the previous page.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| options | [RouterOptions](#routeroptions) | Yes| Description of the page. The **url** parameter indicates the URL of the page to return to. If the specified page does not exist in the page stack, the application does not respond. If this parameter is not set, the application returns to the previous page.| **Example** - ``` + ```js // index page export default { indexPushPage() { @@ -128,7 +129,7 @@ Returns to the previous page or a specified page. } ``` - ``` + ```js // detail page export default { detailPushPage() { @@ -139,7 +140,7 @@ Returns to the previous page or a specified page. } ``` - ``` + ```js // Navigate from the mall page to the detail page through router.back(). export default { mallBackPage() { @@ -148,7 +149,7 @@ Returns to the previous page or a specified page. } ``` - ``` + ```js // Navigate from the detail page to the index page through router.back(). export default { defaultBack() { @@ -157,7 +158,7 @@ Returns to the previous page or a specified page. } ``` - ``` + ```js // Return to the detail page through router.back(). export default { backToDetail() { @@ -175,12 +176,12 @@ Clears all historical pages in the stack and retains only the current page at th **System capability**: SystemCapability.ArkUI.ArkUI.Full **Example** - ``` + ```js export default { clearPage() { router.clear(); } - } + }js ``` ## router.getLength @@ -190,12 +191,12 @@ getLength(): string Obtains the number of pages in the current stack. **Return value** - | Type| Description| - | -------- | -------- | - | string | Number of pages in the stack. The maximum value is **32**.| +| Type| Description| +| -------- | -------- | +| string | Number of pages in the stack. The maximum value is **32**.| **Example** - ``` + ```js export default { getLength() { var size = router.getLength(); @@ -222,14 +223,14 @@ Describes the page routing state. **System capability**: SystemCapability.ArkUI.ArkUI.Full - | Name| Type| Description| - | -------- | -------- | -------- | - | index | number | Index of the current page in the stack.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The index starts from 1 from the bottom to the top of the stack.| - | name | string | Name of the current page, that is, the file name.| - | path | string | Path of the current page.| +| Name| Type| Description| +| -------- | -------- | -------- | +| index | number | Index of the current page in the stack.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The index starts from 1 from the bottom to the top of the stack.| +| name | string | Name of the current page, that is, the file name.| +| path | string | Path of the current page.| **Example** - ``` + ```js export default { getState() { var page = router.getState(); @@ -249,13 +250,13 @@ Enables the display of a confirm dialog box before returning to the previous pag **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | options | [EnableAlertOptions](#enablealertoptions) | Yes| Description of the dialog box.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| options | [EnableAlertOptions](#enablealertoptions) | Yes| Description of the dialog box.| **Example** - ``` + ```js export default { enableAlertBeforeBackPage() { router.enableAlertBeforeBackPage({ @@ -289,7 +290,7 @@ Disables the display of a confirm dialog box before returning to the previous pa **System capability**: SystemCapability.ArkUI.ArkUI.Full **Example** - ``` + ```js export default { disableAlertBeforeBackPage() { router.disableAlertBeforeBackPage(); @@ -314,7 +315,7 @@ Obtains the parameters passed from the page that initiates redirection to the cu **Example** - Web-like example - ``` + ```js // Current page export default { pushPage() { @@ -327,7 +328,7 @@ Obtains the parameters passed from the page that initiates redirection to the cu } } ``` - ``` + ```js // detail page export default { onInit() { @@ -338,7 +339,7 @@ Obtains the parameters passed from the page that initiates redirection to the cu - Declarative example - ``` + ```ts // Navigate to the target page through router.push with the params parameter carried. import router from '@ohos.router' @@ -384,7 +385,7 @@ Obtains the parameters passed from the page that initiates redirection to the cu } ``` - ``` + ```ts // Receive the transferred parameters on the second page. import router from '@ohos.router' @@ -392,8 +393,8 @@ Obtains the parameters passed from the page that initiates redirection to the cu @Component struct Second { private content: string = "This is the second page." - @State text: string = router.getParams().text - @State data: any = router.getParams().data + @State text: string = router.getParams()['text'] + @State data: any = router.getParams()['data'] @State secondData : string = '' build() { diff --git a/en/application-dev/reference/apis/js-apis-screenshot.md b/en/application-dev/reference/apis/js-apis-screenshot.md index cd33c37764b39dbf11bd630a3b3fba3ac45a1f92..690a77e0d9563a066d7f1da9352aca640b6fbea3 100644 --- a/en/application-dev/reference/apis/js-apis-screenshot.md +++ b/en/application-dev/reference/apis/js-apis-screenshot.md @@ -1,6 +1,6 @@ # Screenshot -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. ## Modules to Import @@ -54,7 +54,7 @@ save(options?: ScreenshotOptions, callback: AsyncCallback<image.PixelMap>) Takes a screenshot and saves it as a **PixelMap** object. This method uses a callback to return the result. -**System capabilities**: SystemCapability.WindowManager.WindowManager.Core +**System capability**: SystemCapability.WindowManager.WindowManager.Core **Required permissions**: ohos.permission.CAPTURE_SCREEN @@ -94,15 +94,15 @@ save(options?: ScreenshotOptions): Promise<image.PixelMap> Takes a screenshot and saves it as a **PixelMap** object. This method uses a promise to return the result. -**System capabilities**: SystemCapability.WindowManager.WindowManager.Core +**System capability**: SystemCapability.WindowManager.WindowManager.Core **Required permissions**: ohos.permission.CAPTURE_SCREEN **Parameters** - | Name | Type | Mandatory| Description | - | ------- | --------------------------------------- | ---- | ------------------------------------------------------------ | - | options | [ScreenshotOptions](#screenshotoptions) | No | Screenshot options, which consist of **screenRect**, **imageSize**, and **rotation**. You need to set these parameters.| +| Name | Type | Mandatory| Description | +| ------- | --------------------------------------- | ---- | ------------------------------------------------------------ | +| options | [ScreenshotOptions](#screenshotoptions) | No | Screenshot options, which consist of **screenRect**, **imageSize**, and **rotation**. You need to set these parameters.| **Return value** diff --git a/en/application-dev/reference/apis/js-apis-settings.md b/en/application-dev/reference/apis/js-apis-settings.md index 82ae2c2f0c346f80cf133ec75700a78ff4cb59c1..9b56d25f9f841be73f607a6ef249d57c3f3f3a8d 100644 --- a/en/application-dev/reference/apis/js-apis-settings.md +++ b/en/application-dev/reference/apis/js-apis-settings.md @@ -9,7 +9,7 @@ This module provides APIs for setting data items. ## Modules to Import -``` +```typescript import settings from '@ohos.settings'; ``` @@ -34,7 +34,7 @@ Obtains the URI of a data item. | string | URI of the data item.| - Example - ``` + ```typescript // Obtain the URI of a data item. let urivar = settings.getUriSync('settings.screen.brightness'); ``` @@ -61,7 +61,7 @@ Obtains the value of a data item. | string | Value of the data item.| - Example - ``` + ```typescript import featureAbility from '@ohos.featureAbility'; // Obtain the value of 'settings.screen.brightness' (this data item already exists in the database). @@ -96,7 +96,7 @@ If the specified data item exists in the database, the **setValueSync** method u | boolean | Result indicating whether the value is set successfully. Returns **true** if the value is set successfully; returns **false** otherwise.| - Example - ``` + ```typescript import featureAbility from '@ohos.featureAbility'; // Update the value of 'settings.screen.brightness'. (As this data item exists in the database, the setValueSync diff --git a/en/application-dev/reference/apis/js-apis-system-app.md b/en/application-dev/reference/apis/js-apis-system-app.md index 761d2276e31642f1890ce4127929fb9272c62602..e0cf8d10a1e79872dc6d59a908281610fd01ba23 100644 --- a/en/application-dev/reference/apis/js-apis-system-app.md +++ b/en/application-dev/reference/apis/js-apis-system-app.md @@ -1,6 +1,6 @@ # Application Context -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> - The APIs of this module are no longer maintained since API version 7. You are advised to use the new APIs. > > - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version. @@ -138,7 +138,8 @@ Sets the maximum size (in bytes) of the image data cached in the memory before d export default { onCreate() { - app.setImageRawDataCacheSize(100) // Set the upper limit of the memory for caching image data before decoding to 100 MB. + app.setImageRawDataCacheSize(104857600) + // Set the upper limit of the memory for caching image data before decoding to 100 MB. (100 x 1024 x 1024 B =104857600 B = 100 MB). console.info('Application onCreate') }, onDestroy() { @@ -168,7 +169,8 @@ Sets the maximum size of the image file cache (in bytes) to speed up the loading export default { onCreate() { - app.setImageFileCacheSize(200) // Set the upper limit of the image file cache to 200 MB. + app.setImageFileCacheSize(209715200) + // Set the upper limit of the image file cache to 200 MB. (200 x 1024 x 1024 B= 209715200 B = 200 MB). console.info('Application onCreate') }, onDestroy() { diff --git a/en/application-dev/reference/apis/js-apis-uri.md b/en/application-dev/reference/apis/js-apis-uri.md index 0975f28256cffeacdfbf40ed5dcf56250ff21d5d..4952c227c32677d8bc1f13b3cd07d448ff0d21f0 100644 --- a/en/application-dev/reference/apis/js-apis-uri.md +++ b/en/application-dev/reference/apis/js-apis-uri.md @@ -1,6 +1,6 @@ # URI String Parsing -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> ![icon-note.gif](public_sys-resources/icon-note.gif) **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. @@ -10,15 +10,12 @@ import uri from '@ohos.uri' ``` -## System Capabilities - -SystemCapability.Utils.Lang - ## URI - ### Attributes +**System capability**: SystemCapability.Utils.Lang + | Name| Type| Readable| Writable| Description| | -------- | -------- | -------- | -------- | -------- | | scheme | string | Yes| No| Scheme in the URI.| @@ -38,6 +35,8 @@ constructor(uri: string) A constructor used to create a URI instance. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name| Type.| Readable| Writable| Description| @@ -59,6 +58,8 @@ new uri.URI('http://username:password@host:8080'); // Output 'http://username:pa toString(): string +**System capability**: SystemCapability.Utils.Lang + Obtains the query string applicable to this URL. **Return value** @@ -81,6 +82,8 @@ equals(other: URI): boolean Checks whether this URI is the same as another URI object. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name| Type.| Mandatory| Description| @@ -107,6 +110,8 @@ checkIsAbsolute(): boolean Checks whether this URI is an absolute URI (whether the scheme component is defined). +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type.| Description| @@ -127,6 +132,8 @@ normalize(): URI Normalizes the path of this URI. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type.| Description| diff --git a/en/application-dev/reference/apis/js-apis-url.md b/en/application-dev/reference/apis/js-apis-url.md index ea081f10a0d64302ff5ab8de73b5536ee0c4b7fe..9f105f845950f1f206c326dcd94c4adf8b83c12c 100755 --- a/en/application-dev/reference/apis/js-apis-url.md +++ b/en/application-dev/reference/apis/js-apis-url.md @@ -10,10 +10,6 @@ import Url from '@ohos.url' ``` -## System Capabilities - -SystemCapability.Utils.Lang - ## URLSearchParams @@ -23,11 +19,13 @@ constructor(init?: string[][] | Record<string, string> | string | URLSearc Creates a **URLSearchParams** instance. +**System capability**: SystemCapability.Utils.Lang + **Parameters** - | Name | Type | Mandatory | Description | - | -------- | -------- | -------- | -------- | - | init | string[][] \ | Record<string, string> \ | string \ | URLSearchParams | No | Input parameter objects, which include the following:
- **string[][]**: two-dimensional string array
- **Record<string, string>**: list of objects
- **string**: string
- **URLSearchParams**: object | +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| init | string[][] \| Record<string, string> \| string \| URLSearchParams | No| Input parameter objects, which include the following:
- **string[][]**: two-dimensional string array
- **Record<string, string>**: list of objects
- **string**: string
- **URLSearchParams**: object | **Example** @@ -46,6 +44,8 @@ append(name: string, value: string): void Appends a key-value pair into the query string. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name | Type | Mandatory | Description | @@ -68,6 +68,8 @@ delete(name: string): void Deletes key-value pairs of the specified key. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name | Type | Mandatory | Description | @@ -89,6 +91,8 @@ getAll(name: string): string[] Obtains all the key-value pairs based on the specified key. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name | Type | Mandatory | Description | @@ -117,6 +121,8 @@ entries(): IterableIterator<[string, string]> Obtains an ES6 iterator. Each item of the iterator is a JavaScript array, and the first and second fields of each array are the key and value respectively. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type | Description | @@ -139,6 +145,8 @@ forEach(callbackfn: (value: string, key: string, searchParams: this) => void, th Traverses the key-value pairs in the **URLSearchParams** instance by using a callback. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name | Type | Mandatory | Description | @@ -170,6 +178,8 @@ get(name: string): string | null Obtains the value of the first key-value pair based on the specified key. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name | Type | Mandatory | Description | @@ -199,6 +209,8 @@ has(name: string): boolean Checks whether a key has a value. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name | Type | Mandatory | Description | @@ -226,6 +238,8 @@ set(name: string, value: string): void Sets the value for a key. If key-value pairs matching the specified key exist, the value of the first key-value pair will be set to the specified value and other key-value pairs will be deleted. Otherwise, the key-value pair will be appended to the query string. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name | Type | Mandatory | Description | @@ -246,8 +260,9 @@ paramsObject.set('baz', 3); // Add a third parameter. sort(): void +Sorts all key-value pairs contained in this object based on the Unicode code points of the keys and returns undefined. This method uses a stable sorting algorithm, that is, the relative order between key-value pairs with equal keys is retained. -Sorts all key-value pairs contained in this object based on the Unicode code points of the keys and returns undefined. This method uses a stable sorting algorithm, that is, the relative order between key-value pairs with equal keys is retained. +**System capability**: SystemCapability.Utils.Lang **Example** @@ -262,9 +277,10 @@ console.log(searchParamsObject.toString()); // Display the sorted query string / keys(): IterableIterator<string> - Obtains an ES6 iterator that contains the keys of all the key-value pairs. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type | Description | @@ -287,6 +303,8 @@ values(): IterableIterator<string> Obtains an ES6 iterator that contains the values of all the key-value pairs. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type | Description | @@ -307,9 +325,10 @@ for (var value of searchParams.values()) { [Symbol.iterator]\(): IterableIterator<[string, string]> - Obtains an ES6 iterator. Each item of the iterator is a JavaScript array, and the first and second fields of each array are the key and value respectively. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type | Description | @@ -330,9 +349,10 @@ for (const [name, value] of paramsObject) { toString(): string - Obtains search parameters that are serialized as a string and, if necessary, percent-encodes the characters in the string. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type | Description | @@ -351,32 +371,34 @@ console.log(params.toString()); ## URL - ### Attributes - | Name | Type | Readable | Writable | Description | - | -------- | -------- | -------- | -------- | -------- | - | hash | string | Yes | Yes | String that contains a harsh mark (#) followed by the fragment identifier of a URL. | - | host | string | Yes | Yes | Host information in a URL. | - | hostname | string | Yes | Yes | Hostname (without the port) in a URL. | - | href | string | Yes | Yes | String that contains the whole URL. | - | origin | string | Yes | No | Read-only string that contains the Unicode serialization of the origin of the represented URL. | - | password | string | Yes | Yes | Password in a URL. | - | pathname | string | Yes | Yes | Path in a URL. | - | port | string | Yes | Yes | Port in a URL. | - | protocol | string | Yes | Yes | Protocol in a URL. | - | search | string | Yes | Yes | Serialized query string in a URL. | - | searchParams | URLsearchParams | Yes | No | **URLSearchParams** object allowing access to the query parameters in a URL. | - | username | string | Yes | Yes | Username in a URL. | +**System capability**: SystemCapability.Utils.Lang + +| Name| Type| Readable| Writable| Description| +| -------- | -------- | -------- | -------- | -------- | +| hash | string | Yes| Yes| String that contains a harsh mark (#) followed by the fragment identifier of a URL.| +| host | string | Yes| Yes| Host information in a URL.| +| hostname | string | Yes| Yes| Hostname (without the port) in a URL.| +| href | string | Yes| Yes| String that contains the whole URL.| +| origin | string | Yes| No| Read-only string that contains the Unicode serialization of the origin of the represented URL.| +| password | string | Yes| Yes| Password in a URL.| +| pathname | string | Yes| Yes| Path in a URL.| +| port | string | Yes| Yes| Port in a URL.| +| protocol | string | Yes| Yes| Protocol in a URL.| +| search | string | Yes| Yes| Serialized query string in a URL.| +| searchParams | URLsearchParams | Yes| No| **URLSearchParams** object allowing access to the query parameters in a URL.| +| username | string | Yes| Yes| Username in a URL.| ### constructor constructor(url: string, base?: string | URL) - Creates a URL. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name | Type | Mandatory | Description | @@ -408,6 +430,8 @@ toString(): string Converts the parsed URL into a string. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type | Description | @@ -426,9 +450,10 @@ url.toString() toJSON(): string - Converts the parsed URL into a JSON string. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type | Description | diff --git a/en/application-dev/reference/apis/js-apis-webgl.md b/en/application-dev/reference/apis/js-apis-webgl.md index 93a0097271884f8fb6a1db27be251d658c2a63b7..5538e471be7bc9d6541a54438f9eb0008483b170 100644 --- a/en/application-dev/reference/apis/js-apis-webgl.md +++ b/en/application-dev/reference/apis/js-apis-webgl.md @@ -1,6 +1,6 @@ # webgl -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. @@ -13,10 +13,10 @@ Create a **** component in the HML file. The following is an example: ``` - - +
+ - +
``` Obtain the **** component instance in the JS file. The following is an example: diff --git a/en/application-dev/reference/apis/js-apis-webgl2.md b/en/application-dev/reference/apis/js-apis-webgl2.md index 3f96a4e9ad839f6201c1303c2f6bad2dce249ab7..85559c1a9fcff3f4ac093fb4cf00957972f05145 100644 --- a/en/application-dev/reference/apis/js-apis-webgl2.md +++ b/en/application-dev/reference/apis/js-apis-webgl2.md @@ -1,6 +1,6 @@ # webgl2 -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. @@ -13,10 +13,10 @@ Create a **** component in the HML file. The following is an example: ``` - - +
+ - +
``` Obtain the **** component instance in the JS file. The following is an example: diff --git a/en/application-dev/reference/apis/js-apis-window.md b/en/application-dev/reference/apis/js-apis-window.md index d2dfe5b33e2b60e2da26f66fb998d0123ee5247e..358dead42d99dc9a23977d1e9299c5f5e01ae27b 100644 --- a/en/application-dev/reference/apis/js-apis-window.md +++ b/en/application-dev/reference/apis/js-apis-window.md @@ -2,9 +2,8 @@ The **Window** module provides basic capabilities for managing windows, including creating and destroying windows and setting serial port attributes. -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. -> ## Modules to Import @@ -96,7 +95,7 @@ This is a system API and cannot be called by third-party applications. ## Rect7+ -Describes a rectangle. +Describes the rectangular area of the window. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -371,6 +370,8 @@ getTopWindow(callback: AsyncCallback<Window>): void Obtains the top window of the current application. This API uses an asynchronous callback to return the result. +This API is discarded since API version 8. You are advised to use [window.getTopWindow8+](#windowgettopwindow8) instead. + **System capability**: SystemCapability.WindowManager.WindowManager.Core **Parameters** @@ -399,6 +400,8 @@ getTopWindow(): Promise<Window> Obtains the top window of the current application. This API uses a promise to return the result. +This API is discarded since API version 8. You are advised to use [window.getTopWindow8+](#windowgettopwindow8) instead. + **System capability**: SystemCapability.WindowManager.WindowManager.Core **Return value** @@ -2393,7 +2396,7 @@ loadContent(path: string, callback: AsyncCallback<void>): void Loads content to this window stage. This API uses an asynchronous callback to return the result. -**System capability**: SystemCapability.WindowManager.WindowManager.Coretype with the value 'windowSizeChange' +**System capability**: SystemCapability.WindowManager.WindowManager.Coretype with the value **windowSizeChange** **Parameters** diff --git a/en/application-dev/reference/apis/js-apis-xml.md b/en/application-dev/reference/apis/js-apis-xml.md index 124d845c0e1101346a0783b9e56cd74b089b2424..c014e5dbbef4cd972a9af5bb77efd71c3c363ae3 100644 --- a/en/application-dev/reference/apis/js-apis-xml.md +++ b/en/application-dev/reference/apis/js-apis-xml.md @@ -1,6 +1,6 @@ # XML Parsing and Generation -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> ![icon-note.gif](public_sys-resources/icon-note.gif) **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. @@ -10,10 +10,6 @@ import xml from '@ohos.xml'; ``` -## System Capabilities - -SystemCapability.Utils.Lang - ## XmlSerializer @@ -23,6 +19,8 @@ constructor(buffer: ArrayBuffer | DataView, encoding?: string) A constructor used to create an **XmlSerializer** instance. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name| Type| Mandatory| Description| @@ -45,6 +43,8 @@ setAttributes(name: string, value: string): void Sets an attribute. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name| Type| Mandatory| Description| @@ -66,6 +66,8 @@ addEmptyElement(name: string): void Adds an empty element. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name| Type| Mandatory| Description| @@ -86,6 +88,8 @@ setDeclaration(): void Sets a declaration. +**System capability**: SystemCapability.Utils.Lang + **Example** ```js @@ -100,6 +104,8 @@ startElement(name: string): void Writes the start tag based on the given element name. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name| Type| Mandatory| Description| @@ -122,6 +128,8 @@ endElement(): void Writes the end tag of the element. +**System capability**: SystemCapability.Utils.Lang + **Example** ```js @@ -140,6 +148,8 @@ setNamespace(prefix: string, namespace: string): void Sets the namespace for an element tag. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name| Type| Mandatory| Description| @@ -164,6 +174,8 @@ setComment(text: string): void Sets the comment. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name| Type| Mandatory| Description| @@ -187,6 +199,8 @@ setCDATA(text: string): void Sets CDATA attributes. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name| Type| Mandatory| Description| @@ -208,6 +222,8 @@ setText(text: string): void Sets **Text**. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name| Type| Mandatory| Description| @@ -232,6 +248,8 @@ setDocType(text: string): void Sets **DocType**. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name| Type| Mandatory| Description| @@ -256,6 +274,8 @@ constructor(buffer: ArrayBuffer | DataView, encoding?: string) Creates and returns an **XmlPullParser** object. The **XmlPullParser** object passes two parameters. The first parameter is the memory of the **ArrayBuffer** or **DataView** type, and the second parameter is the file format (UTF-8 by default). +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name| Type| Mandatory| Description| @@ -289,6 +309,8 @@ parse(option: ParseOptions): void Parses XML information. +**System capability**: SystemCapability.Utils.Lang + **Parameters** | Name| Type| Mandatory| Description| @@ -329,6 +351,8 @@ that.parse(options); Defines the XML parsing options. +**System capability**: SystemCapability.Utils.Lang + | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | @@ -349,6 +373,8 @@ getColumnNumber(): number Obtains the column line number, which starts from 1. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type| Description| @@ -362,6 +388,8 @@ getDepth(): number Obtains the depth of this element. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type| Description| @@ -375,6 +403,8 @@ getLineNumber(): number Obtains the current line number, starting from 1. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type| Description| @@ -388,6 +418,8 @@ getName(): string Obtains the name of this element. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type| Description| @@ -401,6 +433,8 @@ getNamespace(): string Obtains the namespace of this element. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type| Description| @@ -414,6 +448,8 @@ getPrefix(): string Obtains the prefix of this element. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type| Description| @@ -427,6 +463,8 @@ getText(): string Obtains the text of the current event. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type| Description| @@ -440,6 +478,8 @@ isEmptyElementTag(): boolean Checks whether the current element is empty. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type| Description| @@ -453,6 +493,8 @@ isWhitespace(): boolean Checks whether the current text event contains only whitespace characters. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type| Description| @@ -466,6 +508,8 @@ getAttributeCount(): number Obtains the number of attributes for the current start tag. +**System capability**: SystemCapability.Utils.Lang + **Return value** | Type| Description| | -------- | -------- | @@ -476,6 +520,8 @@ Obtains the number of attributes for the current start tag. Enumerates the events. +**System capability**: SystemCapability.Utils.Lang + | Name| Value| Description| | -------- | -------- | -------- | | START_DOCUMENT | 0 | Indicates a start document event.| diff --git a/en/application-dev/reference/arkui-js/Readme-EN.md b/en/application-dev/reference/arkui-js/Readme-EN.md index f0b0e7b6c9d76f3380dd78f21c92108c969f9e77..fd00b650bc95c252d91fc55c323af6882030d93c 100644 --- a/en/application-dev/reference/arkui-js/Readme-EN.md +++ b/en/application-dev/reference/arkui-js/Readme-EN.md @@ -106,5 +106,5 @@ - [Event Parameter](js-components-custom-event-parameter.md) - [slot](js-components-custom-slot.md) - [Lifecycle Definition](js-components-custom-lifecycle.md) -- [Type Attributes](js-appendix-types.md) - +- Appendix + - [Type Attributes](js-appendix-types.md) diff --git a/en/application-dev/reference/arkui-js/js-framework-multiple-languages.md b/en/application-dev/reference/arkui-js/js-framework-multiple-languages.md deleted file mode 100644 index 30b72ecc2952f75283be2f275dd59af37ee9eb09..0000000000000000000000000000000000000000 --- a/en/application-dev/reference/arkui-js/js-framework-multiple-languages.md +++ /dev/null @@ -1,196 +0,0 @@ -# Multi-Language Capability - - -Applications designed based on the JS UI framework apply to different countries and regions. With the multi-language capability, you do not need to develop application versions in different languages, and your users can switch between various locales. This also facilitates project maintenance. - - -You only need to perform operations in [Resource Files](#resource-files) and [Resource Reference](#resource-reference) to use the multi-language capability of this framework. For details about how to obtain the current system language, see [Language Acquisition](#language-acquisition). - - -## Resource Files - -Resource files store application content in multiple languages. This framework uses JSON files to store resource definitions. Place the resource file of each locale in the i18n directory described in [File Organization](js-framework-file.md). - -Resource files should be named in _language-script-region_.json format. For example, the resource file for Hong Kong Chinese in the traditional script is named zh-Hant-HK. You can omit the region, for example, zh-CN for simplified Chinese, or omit both the script and region, for example, zh for Chinese. - - -``` -language[-script-region].json -``` - -The following table describes the requirements for the qualifiers of resource file names. - -Table 1 Requirements for qualifier values - -| Qualifier Type | Description and Value Range | -| -------- | -------- | -| Language | Indicates the language used by the device. The value consists of two or three lowercase letters, for example, zh indicates Chinese, en indicates English, and mai indicates Maithili.
For details about the value range, refer to ISO 639 (codes for the representation of names of languages). | -| Script | Indicates the script type used by the device. The value starts with one uppercase letter followed by three lowercase letters, for example, Hans indicates simplified Chinese and Hant indicates traditional Chinese.
For details about the value range, refer to ISO 15924 (codes for the representation of names of scripts). | -| Country/Region | Indicates the country or region where a user is located. The value consists of two or three uppercase letters or three digits, for example, CN indicates China and GB indicates the United Kingdom.
For details about the value range, refer to ISO 3166-1 (codes for the representation of names of countries and their subdivisions). | - -If there is no resource file of the locale that matches the system language, content in the en-US.json file will be used by default. - -The format of the resource file content is as follows: - -**en-US.json** - -``` -{ - "strings": { - "hello": "Hello world!", - "object": "Object parameter substitution-{name}", - "array": "Array type parameter substitution-{0}", - "symbol": "@#$%^&*()_+-={}[]\\|:;\"'<>,./?" - }, - - "files": { - "image": "image/en_picture.PNG" - } -} -``` - - -Different languages have different matching rules for singular and plural forms. In the resource file, zero, one, two, few, many, and other are used to define the string content in different singular and plural forms. For example, there is only the other scenario in Chinese since the language does not have singular and plural forms. one and other scenarios are applicable to English. All six scenarios are needed for Arabic. - - -The following example takes en-US.json and ar-AE.json as examples: - -**en-US.json** - - -``` -{ - "strings": { - "people": { - "one": "one person", - "other": "{count} people" - } - } -} -``` - - -ar-AE.json - - -``` -{ - "strings": { - "people": { - "zero": "لا أحد", - "one": "وحده", - "two": "اثنان", - "few": "ستة اشخاص", - "many": "خمسون شخص", - "other": "مائة شخص" - } - } -} -``` - - -## Resource Reference - -Multi-language syntax used on application development pages (including simple formatting and singular-plural formatting) can be used in .hml or .js files. - -- Simple formatting - - Use the `$t` function to reference to resources of different locales. The `$t` function is available for both .hml and .js files. The system displays content based on a resource file path specified via $t and the specified resource file whose locale matches the current system language. - - Table 2 Simple formatting - - | Attribute | Type | Parameter | Mandatory | Description | - | -------- | -------- | -------- | -------- | -------- | - | $t | Function | See Table3 | Yes | Sets the parameters based on the system language, for example, this.$t('strings.hello'). | - - -Table 3 $t function parameters - -| Parameter | Type | Mandatory | Description | -| -------- | -------- | -------- | -------- | -| path | string | Yes | Path of the language resource key | -| params | Array\|Object | No | Content used to replace placeholders during runtime. There are two types of placeholders available:
- Named placeholder, for example, {name}. The actual content must be of the object type, for example, \```$t('strings.object', {name:'Hello world'})```.
- Digit placeholder, for example, {0}. The actual content must be of the array type, for example, \```$t('strings.array', [Hello world']```. | - -- Example code for simple formatting - - ``` - -
- - {{ $t('strings.hello') }} - - {{ $t('strings.object', { name: 'Hello world' }) }} - - {{ $t('strings.array', ['Hello world']) }} - - {{ hello }} - - {{ replaceObject }} - - {{ replaceArray }} - - - - - -
- ``` - - - ``` - // xxx.js - // The following example uses the $t function in the .js file. - export default { - data: { - hello: '', - replaceObject: '', - replaceArray: '', - replaceSrc: '', - }, - onInit() { - this.hello = this.$t('strings.hello'); - this.replaceObject = this.$t('strings.object', { name: 'Hello world' }); - this.replaceArray = this.$t('strings.array', ['Hello world']); - this.replaceSrc = this.$t('files.image'); - }, - } - ``` - -- Singular-plural formatting - Table 4 Singular-plural formatting - - | Attribute | Type | Parameter | Mandatory | Description | - | -------- | -------- | -------- | -------- | -------- | - | $tc | Function | See Table 5. | Yes | Converts between the singular and plural forms based on the system language, for example, this.$tc('strings.people').
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The resource content is distinguished by the following JSON keys: zero, one, two, few, many, and other. | - - Table 5 $tc function parameters - - | Parameter | Type | Mandatory | Description | - | -------- | -------- | -------- | -------- | - | path | string | Yes | Path of the language resource key | - | count | number | Yes | Number | - -- Sample code for singular-plural formatting - - ``` - -
- - {{ $tc('strings.people', 0) }} - - {{ $tc('strings.people', 1) }} - - {{ $tc('strings.people', 2) }} - - {{ $tc('strings.people', 6) }} - - {{ $tc('strings.people', 50) }} - - {{ $tc('strings.people', 100) }} -
- ``` - - -## Language Acquisition - -For details about how to obtain the language, see the Application Configuration section. diff --git a/en/contribute/OpenHarmony-hdf-coding-guide.md b/en/contribute/OpenHarmony-hdf-coding-guide.md index e63cca63bec7351de9f2166fa2f362cfa38439ce..84deab62a8cea60e9cd9febfe50ab8df0b3dc2f7 100644 --- a/en/contribute/OpenHarmony-hdf-coding-guide.md +++ b/en/contribute/OpenHarmony-hdf-coding-guide.md @@ -139,10 +139,10 @@ The driver loading information required by the HDF comes from the driver device ```bash $openharmony_src_root/vendor/hisilicon/hispark_taurus/hdf_config # Directory for storing the kernel-mode configuration file. There are no user-mode configuration files. -$openharmony_src_root/vendor/hisilicon/Hi3516DV300/hdf_config/khdf # Directory for storing the kernel-mode configuration file. -$openharmony_src_root/vendor/hisilicon/Hi3516DV300/hdf_config/uhdf # Directory for storing the user-mode configuration file. -$openharmony_src_root/vendor/hisilicon/Hi3516DV300/hdf_config/khdf/device_info/device_info.hcs # Device description file of the kernel-mode driver. -$openharmony_src_root/vendor/hisilicon/Hi3516DV300/hdf_config/khdf/lcd/lcd_config.hcs # Private configuration file of the kernel-mode driver. +$openharmony_src_root/vendor/hisilicon/hispark_taurus_standard/hdf_config/khdf # Directory for storing the kernel-mode configuration file. +$openharmony_src_root/vendor/hisilicon/hispark_taurus_standard/hdf_config/uhdf # Directory for storing the user-mode configuration file. +$openharmony_src_root/vendor/hisilicon/hispark_taurus_standard/hdf_config/khdf/device_info/device_info.hcs # Device description file of the kernel-mode driver. +$openharmony_src_root/vendor/hisilicon/hispark_taurus_standard/hdf_config/khdf/lcd/lcd_config.hcs # Private configuration file of the kernel-mode driver. ``` #### [Rule] Use existing configuration information and inherit existing configuration templates during driver configuration. @@ -373,9 +373,9 @@ If a driver has private configurations, you can add a driver configuration file [Example] ```bash -$openharmony_src_root/vendor/hisilicon/Hi3516DV300/hdf_config/khdf/sample/sample_config.hcs # Correct. The private configuration file is stored in the sample directory. +$openharmony_src_root/vendor/hisilicon/hispark_taurus_standard/hdf_config/khdf/sample/sample_config.hcs # Correct. The private configuration file is stored in the sample directory. -$openharmony_src_root/vendor/hisilicon/Hi3516DV300/hdf_config/khdf/sample_config.hcs # Incorrect. The private configuration file is placed in the root directory. +$openharmony_src_root/vendor/hisilicon/hispark_taurus_standard/hdf_config/khdf/sample_config.hcs # Incorrect. The private configuration file is placed in the root directory. ``` #### [Rule] Add the private configuration file of a driver to the hdf.hcs file in the hdf_config directory. diff --git a/en/device-dev/device-dev-guide.md b/en/device-dev/device-dev-guide.md index 8a891ecc8c8d2db8510d4ae2ffa7cde541e08eeb..b255de5e0633381bb2d81acc4f4f794c1887b790 100644 --- a/en/device-dev/device-dev-guide.md +++ b/en/device-dev/device-dev-guide.md @@ -27,7 +27,7 @@ In addition, OpenHarmony provides a wide array of system components that can be ## Document Outline -**Table 1** Mini and small system development guidelines (reference memory < 128 MB) +**Table 1** Mini and small system development guidelines (reference memory < 128 MiB) | Topic| Development Scenario| Related Documentation| | -------- | -------- | -------- | @@ -41,7 +41,7 @@ In addition, OpenHarmony provides a wide array of system components that can be | Reference| Referring to development specifications| [FAQs](faqs/faqs-overview.md) | -**Table 2** Standard system development guidelines (reference memory ≥ 128 MB) +**Table 2** Standard system development guidelines (reference memory ≥ 128 MiB) | Topic| Development Scenario| Related Documentation| | -------- | -------- | -------- | | About OpenHarmony| Getting familiar with OpenHarmony| - [About OpenHarmony](https://gitee.com/openharmony)
- [Glossary](../glossary.md) | diff --git a/en/device-dev/driver/driver-develop.md b/en/device-dev/driver/driver-develop.md deleted file mode 100644 index b35b64a64ffb11c51d1ce56d98942de8d032b5a3..0000000000000000000000000000000000000000 --- a/en/device-dev/driver/driver-develop.md +++ /dev/null @@ -1,33 +0,0 @@ -# Platform Driver Development - -- **[ADC](driver-platform-adc-develop.md)** - -- **[DAC](driver-platform-dac-develop.md)** - -- **[GPIO](driver-platform-gpio-develop.md)** - -- **[HDMI](driver-platform-hdmi-develop.md)** - -- **[I2C](driver-platform-i2c-develop.md)** - -- **[I3C](driver-platform-i3c-develop.md)** - -- **[MIPI CSI](driver-platform-mipicsi-develop.md)** - -- **[MIPI DSI](driver-platform-mipidsi-develop.md)** - -- **[MMC](driver-platform-mmc-develop.md)** - -- **[PWM](driver-platform-pwm-develop.md)** - -- **[RTC](driver-platform-rtc-develop.md)** - -- **[SDIO](driver-platform-sdio-develop.md)** - -- **[SPI](driver-platform-spi-develop.md)** - -- **[UART](driver-platform-uart-develop.md)** - -- **[Watchdog](driver-platform-watchdog-develop.md)** - - diff --git a/en/device-dev/driver/driver-hdf.md b/en/device-dev/driver/driver-hdf.md deleted file mode 100644 index b406f2aa2a6be96024b32f200b4f56c441e1882b..0000000000000000000000000000000000000000 --- a/en/device-dev/driver/driver-hdf.md +++ /dev/null @@ -1,15 +0,0 @@ -# HDF - -- **[HDF Overview](driver-hdf-overview.md)** - -- **[Driver Development](driver-hdf-development.md)** - -- **[Driver Service Management](driver-hdf-servicemanage.md)** - -- **[Driver Message Mechanism Management](driver-hdf-message-management.md)** - -- **[Driver Configuration Management](driver-hdf-manage.md)** - -- **[HDF Development Example](driver-hdf-sample.md)** - - diff --git a/en/device-dev/driver/driver-peripherals-audio-des.md b/en/device-dev/driver/driver-peripherals-audio-des.md index 6f66786fe60ddf8f603022b3bb9e49054605df4f..b8b5d25fb78b5aded9b13be33aaf3ba8d7ebef00 100644 --- a/en/device-dev/driver/driver-peripherals-audio-des.md +++ b/en/device-dev/driver/driver-peripherals-audio-des.md @@ -273,7 +273,7 @@ int32_t CodecDaiHwParams(const struct AudioCard *card, const struct AudioPcmHwPa #### Registering and Binding Codec to HDF -This process depends on the driver implementation mode of the HDF. For details, see [HDF](https://gitee.com/openharmony/docs/blob/master/en/device-dev/driver/driver-hdf.md). +This process depends on the driver implementation mode of the HDF. For details, see [HDF](https://gitee.com/openharmony/docs/blob/master/en/device-dev/driver/Readme-EN.md). Fill in the **g_codecDriverEntry** structure. Ensure that the value of **moduleName** is the same as that in **device_info.hcs**. Implement the pointers to the **Bind**, **Init**, and **Release** functions. @@ -335,7 +335,7 @@ Configure the driver node, loading sequence, and service name in the .hcs file. Path of the standard-system configuration file: -**vendor/hisilicon/Hi3516DV300/hdf_config/khdf/** +**vendor/hisilicon/hispark_taurus_standard/hdf_config/khdf/** Path of the small-system configuration file: @@ -779,7 +779,7 @@ int32_t Tfa9879DaiHwParams(const struct AudioCard *card, const struct AudioPcmHw #### Registering and Binding Accessory to HDF -This process depends on the driver implementation mode of the HDF. For details, see [HDF](https://gitee.com/openharmony/docs/blob/master/en/device-dev/driver/driver-hdf.md). +This process depends on the driver implementation mode of the HDF. For details, see [HDF](https://gitee.com/openharmony/docs/blob/master/en/device-dev/driver/Readme-EN.md). Fill in the **g_tfa9879DriverEntry** structure. Ensure that the value of **moduleName** is the same as that in **device_info.hcs**. Implement the pointers to the **Bind**, **Init**, and **Release** functions. @@ -900,7 +900,7 @@ int32_t Hi3516DmaPointer(struct PlatformData *data, uint32_t *pointer); #### Registering and Binding Platform to HDF -This process depends on the driver implementation mode of the HDF. For details, see [HDF](https://gitee.com/openharmony/docs/blob/master/en/device-dev/driver/driver-hdf.md). +This process depends on the driver implementation mode of the HDF. For details, see [HDF](https://gitee.com/openharmony/docs/blob/master/en/device-dev/driver/Readme-EN.md). - Fill in the **g_platformDriverEntry** structure. - Ensure that the value of **moduleName** is the same as that in **device_info.hcs**. @@ -1064,7 +1064,7 @@ int32_t DaiStartup(const struct AudioCard *card, const struct DaiDevice *device) #### Registering and Binding DAI to HDF -This process depends on the driver implementation mode of the HDF. For details, see [HDF](https://gitee.com/openharmony/docs/blob/master/en/device-dev/driver/driver-hdf.md). +This process depends on the driver implementation mode of the HDF. For details, see [HDF](https://gitee.com/openharmony/docs/blob/master/en/device-dev/driver/Readme-EN.md). - Fill in the **g_daiDriverEntry** structure. - Ensure that the value of **moduleName** is the same as that in **device_info.hcs**. @@ -1215,7 +1215,7 @@ HCS Files and Directory ``` Standard system: -vendor/hisilicon/Hi3516DV300/ +vendor/hisilicon/hispark_taurus_standard/ └── hdf_config └── khdf ├── audio diff --git a/en/device-dev/driver/driver-peripherals.md b/en/device-dev/driver/driver-peripherals.md deleted file mode 100644 index e4137579577b8b5786fd5c45e7545617e29ece75..0000000000000000000000000000000000000000 --- a/en/device-dev/driver/driver-peripherals.md +++ /dev/null @@ -1,16 +0,0 @@ -# Peripheral Driver Usage - -- **[LCD](driver-peripherals-lcd-des.md)** - -- **[Touchscreen](driver-peripherals-touch-des.md)** - -- **[Sensor](driver-peripherals-sensor-des.md)** - -- **[WLAN](driver-peripherals-external-des.md)** - -- **[Audio](driver-peripherals-audio-des.md)** - -- **[USB](driver-peripherals-usb-des.md)** - -- **[Camera](driver-peripherals-camera-des.md)** - diff --git a/en/device-dev/driver/driver-platform.md b/en/device-dev/driver/driver-platform.md deleted file mode 100644 index 3a41a94032a8661dc459dd8bda1a6956b87c567d..0000000000000000000000000000000000000000 --- a/en/device-dev/driver/driver-platform.md +++ /dev/null @@ -1,31 +0,0 @@ -# Driver Platform Usage - -- **[ADC](driver-platform-adc-des.md)** - -- **[DAC](driver-platform-dac-des.md)** - -- **[GPIO](driver-platform-gpio-des.md)** - -- **[HDMI](driver-platform-hdmi-des.md)** - -- **[I2C](driver-platform-i2c-des.md)** - -- **[I3C](driver-platform-i3c-des.md)** - -- **[MIPI CSI](driver-platform-mipicsi-des.md)** - -- **[MIPI DSI](driver-platform-mipidsi-des.md)** - -- **[Pin](driver-platform-pin-des.md)** - -- **[PWM](driver-platform-pwm-des.md)** - -- **[RTC](driver-platform-rtc-des.md)** - -- **[SDIO](driver-platform-sdio-des.md)** - -- **[SPI](driver-platform-spi-des.md)** - -- **[UART](driver-platform-uart-des.md)** - -- **[Watchdog](driver-platform-watchdog-des.md)** diff --git a/en/device-dev/driver/driver.md b/en/device-dev/driver/driver.md deleted file mode 100644 index bca7b47489b24cc2d47a713736a6aeaec3753103..0000000000000000000000000000000000000000 --- a/en/device-dev/driver/driver.md +++ /dev/null @@ -1,11 +0,0 @@ -# Drivers - -- **[HDF](driver-hdf.md)** - -- **[Platform Driver Development](driver-develop.md)** - -- **[Platform Driver Usage](driver-platform.md)** - -- **[Peripheral Driver Usage](driver-peripherals.md)** - - diff --git a/en/device-dev/faqs/faqs-startup.md b/en/device-dev/faqs/faqs-startup.md index e5523f7697bb40b5e33ec4d3afe177556ed1c556..cab83bad0559355247228160615a856826ccff9d 100644 --- a/en/device-dev/faqs/faqs-startup.md +++ b/en/device-dev/faqs/faqs-startup.md @@ -1,4 +1,4 @@ -# Startup and Recovery +# Startup ## System Startup Interrupted Due to "parse failed!" Error diff --git a/en/device-dev/get-code/gettools-acquire.md b/en/device-dev/get-code/gettools-acquire.md index c47f2c8f37a7704e2d74539d80dc9e47489ace04..20a3b4a94175786f864d4450e3b14b8e6722b634 100644 --- a/en/device-dev/get-code/gettools-acquire.md +++ b/en/device-dev/get-code/gettools-acquire.md @@ -156,7 +156,7 @@ Run the following script to start building for standard-system devices \(referen ./build.sh --product-name {product_name} --ccache ``` -**product\_name** indicates the platform supported by the current distribution, for example, Hi3516DV300 and rk3568. +**product\_name** indicates the platform supported by the current distribution, for example, hispark_taurus_standard and rk3568. Files generated during building are stored in the **out/{device_name}/** directory, and the generated image is stored in the **out/{device_name}/packages/phone/images/** directory. diff --git a/en/device-dev/guide/device-camera-control-demo-photoguide.md b/en/device-dev/guide/device-camera-control-demo-photoguide.md index e0046ccac0e5ce11729608e499db15ee02759bbc..de61ed05e5c83016c0669fe568d3db79cbe9a6fa 100644 --- a/en/device-dev/guide/device-camera-control-demo-photoguide.md +++ b/en/device-dev/guide/device-camera-control-demo-photoguide.md @@ -6,7 +6,7 @@ Use the camera module APIs to capture frames \(photographing\). ## Available APIs -**Table 1** APIs for photographing +**Table 1** APIs for photographing

Class

diff --git a/en/device-dev/guide/device-camera-control-demo.md b/en/device-dev/guide/device-camera-control-demo.md index 48b36ad9d6493fe655779cd63e2c9b8be7c2e1f4..0656cdd72908cb5fd9c21e373f478b09c3693406 100644 --- a/en/device-dev/guide/device-camera-control-demo.md +++ b/en/device-dev/guide/device-camera-control-demo.md @@ -1,4 +1,4 @@ -# Development Guidelines +# Screen and Camera Control Development - **[Photographing](device-camera-control-demo-photoguide.md)** diff --git a/en/device-dev/guide/device-camera-control-example.md b/en/device-dev/guide/device-camera-control-example.md index c9920f4b3bfa6aa40c3f315c86410cb56bc5cf84..dbe3e5744342b584ae913d8bca561323a67c1dd4 100644 --- a/en/device-dev/guide/device-camera-control-example.md +++ b/en/device-dev/guide/device-camera-control-example.md @@ -5,7 +5,7 @@ This use case takes **camera\_sample** \(contained in the source code\) as an - You can obtain source code of the sample from **applications/sample/camera/media/camera\_sample.cpp**. - Before running the sample camera, you need to compile, burn, and run the image. For details, see [Hi3516 Development Board](../quick-start/quickstart-lite-introduction-hi3516#section26131214194212). - >![](../public_sys-resources/icon-note.gif) **NOTE:** + >![](../public_sys-resources/icon-note.gif) **NOTE**
>After the development board is started, the home screen is loaded and displayed above the media layer by default. To prevent covering **camera\_sample**, you should remove the home screen during compilation or packaging. >How to Remove: In **build/lite/components/applications.json**, comment out or delete the **//applications/sample/camera/launcher:launcher\_hap** line from the **target** field of **camera\_sample\_app**. @@ -18,7 +18,7 @@ This use case takes **camera\_sample** \(contained in the source code\) as an Recompile the source code repository and burn the code into the development board. Then you can find the **camera\_sample** file in the **bin** directory of the board. - >![](../public_sys-resources/icon-notice.gif) **NOTICE:** + >![](../public_sys-resources/icon-notice.gif) **NOTICE**
>You should insert a TF card \(up to 128 GB supported\) for photographing and video recording before system startup. This way, the TF card will be automatically mounted to the **/sdcard** directory. If you insert the TF card after the system is started, you have to manually mount the TF card. >To view the photos and videos in the TF card, copy them to a computer. If you just want to preview photos and videos, you do not need to insert a TF card. @@ -26,14 +26,14 @@ This use case takes **camera\_sample** \(contained in the source code\) as an 1. Run the **cd** command to go to the end path of the executable program and start **camera\_sample** by running the command in the following figure. - **Figure 1** Starting camera\_sample + **Figure 1** Starting camera\_sample ![](figures/starting-camera_sample.png "starting-camera_sample") The control commands are displayed as shown in the preceding figure. Press **S** to stop the current operation \(including video recording and preview\), and press **Q** to exit the program. 2. Press **1** to take a photo in JPG format. The photo is saved in the **/sdcard** directory and named **Capture\***. - **Figure 2** Serial port logs displayed after the photographing command is executed + **Figure 2** Serial port logs displayed after the photographing command is executed ![](figures/serial-port-logs-displayed-after-the-photographing-command-is-executed.png "serial-port-logs-displayed-after-the-photographing-command-is-executed") To view the saved file, exit the program and enter the file system. To start the program again, return to the previous step. @@ -41,24 +41,24 @@ This use case takes **camera\_sample** \(contained in the source code\) as an **Figure 3** Saved files ![](figures/saved-files.png "saved-files") -3. Press **2** to start recording. The video file is in MP4 format and saved in the **/sdcard** directory with the name **Record\***. Press **S** to stop recording. +3. Press **2** to start recording. The video file is in MP4 format and saved in the **/sdcard** directory with the name **Record\***. Press **S** to stop recording. - **Figure 4** Serial port logs displayed after the recording command is executed + **Figure 4** Serial port logs displayed after the recording command is executed ![](figures/serial-port-logs-displayed-after-the-recording-command-is-executed.png "serial-port-logs-displayed-after-the-recording-command-is-executed") 4. Press **3** to start preview. The preview is displayed on the screen. Press **S** to stop preview. - **Figure 5** Serial port logs displayed after the preview command is executed + **Figure 5** Serial port logs displayed after the preview command is executed ![](figures/serial-port-logs-displayed-after-the-preview-command-is-executed.png "serial-port-logs-displayed-after-the-preview-command-is-executed") The following figure shows the preview. - **Figure 6** Preview effect + **Figure 6** Preview effect ![](figures/preview-effect.jpg "preview-effect") 5. Press **Q** to exit. - **Figure 7** Serial port logs displayed after the exit command is executed + **Figure 7** Serial port logs displayed after the exit command is executed ![](figures/serial-port-logs-displayed-after-the-exit-command-is-executed.png "serial-port-logs-displayed-after-the-exit-command-is-executed") diff --git a/en/device-dev/guide/device-camera-control-overview.md b/en/device-dev/guide/device-camera-control-overview.md index 61f5aa13eb0b6a3e4cdf4362bd5355846f7f4135..878d479a2fe586236b0679da452430b5257dce52 100644 --- a/en/device-dev/guide/device-camera-control-overview.md +++ b/en/device-dev/guide/device-camera-control-overview.md @@ -1,10 +1,10 @@ -# Overview +# Screen and Camera Control Overview This document describes how to use the IoT camera development board \(Hi3516D V300\) and its camera and screen to implement photographing, video recording, and video preview. This document helps you take a deep dive into OpenHarmony camera control. With this reference, you can develop devices, such as peephole cameras, smart rear-view mirrors, and smart displays. -If you want to view the running effect first, see [Use Case](device-camera-control-example.md). To customize application behavior, modify the sample code by referring to APIs described in the "Development Guidelines" section. +If you want to view the running effect first, see [Use Case](device-camera-control-example.md). To customize application behavior, modify the sample code by referring to APIs described in the "Development Guidelines" section. -For basic concepts of camera development, see [Camera Development Overview](../subsystems/subsys-multimedia-camera-overview.md). +For basic concepts of camera development, see [Camera Development Overview](../subsystems/subsys-multimedia-camera-overview.md). diff --git a/en/device-dev/guide/device-camera-control.md b/en/device-dev/guide/device-camera-control.md index 062b965f7a68b9f00b602b2dfb8fe3b1cbacfbc1..e57f328b6d90589b33abc16752c301b2ef78a158 100644 --- a/en/device-dev/guide/device-camera-control.md +++ b/en/device-dev/guide/device-camera-control.md @@ -1,8 +1,8 @@ # Screen and Camera Control -- **[Overview](device-camera-control-overview.md)** +- **[Screen and Camera Control Overview](device-camera-control-overview.md)** -- **[Development Guidelines](device-camera-control-demo.md)** +- **[Screen and Camera Control Development](device-camera-control-demo.md)** - **[Use Case](device-camera-control-example.md)** diff --git a/en/device-dev/guide/device-iotcamera-control-demo.md b/en/device-dev/guide/device-iotcamera-control-demo.md index 6f187156291b9c813d199060c055e0d205e295db..2d711a2c708133b926a17f2f21ee576171b4541d 100644 --- a/en/device-dev/guide/device-iotcamera-control-demo.md +++ b/en/device-dev/guide/device-iotcamera-control-demo.md @@ -1,4 +1,4 @@ -# Development Guidelines +# Camera Control Development - **[Photographing](device-iotcamera-control-demo-photodevguide.md)** diff --git a/en/device-dev/guide/device-iotcamera-control-overview.md b/en/device-dev/guide/device-iotcamera-control-overview.md index d5a493f3a209e1fd4dc4deb2b2c195956bcac273..d67f97231ed8c18469818d1d0e1c43cb69ab1141 100644 --- a/en/device-dev/guide/device-iotcamera-control-overview.md +++ b/en/device-dev/guide/device-iotcamera-control-overview.md @@ -1,10 +1,10 @@ -# Overview +# Camera Control Overview This document describes how to use the IoT camera development board and the built-in camera of the development kit to implement photographing and video recording. -You can perform operations provided in [Use Case](device-iotcamera-control-example.md) to learn more about development board peripheral control and then develop devices such as cameras. +You can perform operations provided in [Use Case](device-iotcamera-control-example.md) to learn more about development board peripheral control and then develop devices such as cameras. -If you want to view the sample effect first, see [Use Case](device-iotcamera-control-example.md). To customize application behavior, modify the sample code by referring to APIs described in the next section. +If you want to view the sample effect first, see [Use Case](device-iotcamera-control-example.md). To customize application behavior, modify the sample code by referring to APIs described in the next section. -For details about basic concepts for camera development, see the [camera development overview](../subsystems/subsys-multimedia-camera-overview.md). +For details about basic concepts for camera development, see [Camera Overview](../subsystems/subsys-multimedia-camera-overview.md). diff --git a/en/device-dev/guide/device-iotcamera-control.md b/en/device-dev/guide/device-iotcamera-control.md index f2720769bb74584a87e538a45093ee13bfb95869..35d1af547b6a0b579c201e01079c1429f5249492 100644 --- a/en/device-dev/guide/device-iotcamera-control.md +++ b/en/device-dev/guide/device-iotcamera-control.md @@ -1,8 +1,8 @@ # Camera Control -- **[Overview](device-iotcamera-control-overview.md)** +- **[Camera Control Overview](device-iotcamera-control-overview.md)** -- **[Development Guidelines](device-iotcamera-control-demo.md)** +- **[Camera Control Development](device-iotcamera-control-demo.md)** - **[Use Case](device-iotcamera-control-example.md)** diff --git a/en/device-dev/kernel/Readme-EN.md b/en/device-dev/kernel/Readme-EN.md index 87197a93f35151ec462438d991ac14185da1115d..3d8321373b9c1c0b873ad0833b5f3e0fe3b059a8 100644 --- a/en/device-dev/kernel/Readme-EN.md +++ b/en/device-dev/kernel/Readme-EN.md @@ -1,181 +1,184 @@ # Kernel -- [Kernel for Mini Systems](kernel-mini.md) - - [Kernel Overview](kernel-mini-overview.md) - - [Basic Kernel](kernel-mini-basic.md) - - [Interrupt Management](kernel-mini-basic-interrupt.md) - - [Task Management](kernel-mini-basic-task.md) - - [Memory Management](kernel-mini-basic-memory.md) - - [Basic Concepts](kernel-mini-basic-memory-basic.md) - - [Static Memory](kernel-mini-basic-memory-static.md) - - [Dynamic Memory](kernel-mini-basic-memory-dynamic.md) - - [Kernel Communication Mechanisms](kernel-mini-basic-ipc.md) - - [Event](kernel-mini-basic-ipc-event.md) - - [Mutex](kernel-mini-basic-ipc-mutex.md) - - [Queue](kernel-mini-basic-ipc-queue.md) - - [Semaphore](kernel-mini-basic-ipc-sem.md) - - [Time Management](kernel-basic-mini-time.md) - - [Software Timer](kernel-mini-basic-soft.md) - - [Extended Components](kernel-mini-extend.md) - - [C++ Support](kernel-mini-extend-support.md) - - [CPUP](kernel-mini-extend-cpup.md) - - [Dynamic Loading](kernel-mini-extend-dynamic-loading.md) - - [File System](kernel-mini-extend-file.md) - - [FAT](kernel-mini-extend-file-fat.md) - - [LittleFS](kernel-mini-extend-file-lit.md) - - [Kernel Debugging](kernel-mini-debug.md) - - [Memory Debugging](kernel-mini-memory-debug.md) - - [Memory Information Statistics](kernel-mini-memory-debug-mes.md) - - [Memory Leak Check](kernel-mini-imemory-debug-det.md) - - [Memory Corruption Check](kernel-mini-memory-debug-cet.md) - - [Exception Debugging](kernel-mini-memory-exception.md) - - [Trace](kernel-mini-memory-trace.md) - - [LMS](kernel-mini-memory-lms.md) - - [Appendix](kernel-mini-app.md) - - [Kernel Coding Specification](kernel-mini-appx-code.md) - - [Basic Data Structure](kernel-mini-appx-data.md) - - [Doubly Linked List](kernel-mini-appx-data-list.md) - - [Standard Libraries](kernel-mini-appx-lib.md) - - [CMSIS Support](kernel-mini-appx-lib-cmsis.md) - - [POSIX Support](kernel-mini-appx-lib-posix.md) -- [Kernel for Small Systems](kernel-small.md) - - [Kernel Overview](kernel-small-overview.md) - - [Kernel Startup](kernel-small-start.md) - - [Startup in Kernel Space](kernel-small-start-kernel.md) - - [Startup in User Space](kernel-small-start-user.md) - - [Basic Kernel](kernel-small-basics.md) - - [Interrupt and Exception Handling](kernel-small-basic-interrupt.md) - - [Process Management](kernel-small-basic-process.md) - - [Process](kernel-small-basic-process-process.md) - - [Task](kernel-small-basic-process-thread.md) - - [Scheduler](kernel-small-basic-process-scheduler.md) - - [Memory Management](kernel-small-basic-memory.md) - - [Heap Memory Management](kernel-small-basic-memory-heap.md) - - [Physical Memory Management](kernel-small-basic-memory-physical.md) - - [Virtual Memory Management](kernel-small-basic-memory-virtual.md) - - [Virtual-to-Physical Mapping](kernel-small-basic-inner-reflect.md) - - [Kernel Communication Mechanisms](kernel-small-basic-trans.md) - - [Event](kernel-small-basic-trans-event.md) - - [Semaphore](kernel-small-basic-trans-semaphore.md) - - [Mutex](kernel-small-basic-trans-mutex.md) - - [Queue](kernel-small-basic-trans-queue.md) - - [RW Lock](kernel-small-basic-trans-rwlock.md) - - [Futex](kernel-small-basic-trans-user-mutex.md) - - [Signal](kernel-small-basic-trans-user-signal.md) - - [Time Management](kernel-small-basic-time.md) - - [Software Timer](kernel-small-basic-softtimer.md) - - [Atomic Operation](kernel-small-basic-atomic.md) - - [Extension Components](kernel-small-bundles.md) - - [System Call](kernel-small-bundles-system.md) - - [Dynamic Loading and Linking](kernel-small-bundles-linking.md) - - [Virtual Dynamic Shared Object](kernel-small-bundles-share.md) - - [LiteIPC](kernel-small-bundles-ipc.md) - - [File Systems](kernel-small-bundles-fs.md) - - [Virtual File System](kernel-small-bundles-fs-virtual.md) - - [Supported File Systems](kernel-small-bundles-fs-support.md) - - [FAT](kernel-small-bundles-fs-support-fat.md) - - [JFFS2](kernel-small-bundles-fs-support-jffs2.md) - - [NFS](kernel-small-bundles-fs-support-nfs.md) - - [Ramfs](kernel-small-bundles-fs-support-ramfs.md) - - [procfs](kernel-small-bundles-fs-support-procfs.md) - - [File System Adaptation](kernel-small-bundles-fs-new.md) - - [Debugging and Tools](kernel-small-debug.md) - - [Shell](kernel-small-debug-shell.md) - - [Introduction to the Shell](kernel-small-debug-shell-overview.md) - - [Shell Command Development Guidelines](kernel-small-debug-shell-guide.md) - - [Shell Command Programming Example](kernel-small-debug-shell-build.md) - - [Shell Command Reference](kernel-small-debug-shell-details.md) - - [System Commands](kernel-small-debug-shell-cmd.md) - - [cpup](kernel-small-debug-shell-cmd-cpup.md) - - [date](kernel-small-debug-shell-cmd-date.md) - - [dmesg](kernel-small-debug-shell-cmd-dmesg.md) - - [exec](kernel-small-debug-shell-cmd-exec.md) - - [free](kernel-small-debug-shell-cmd-free.md) - - [help](kernel-small-debug-shell-cmd-help.md) - - [hwi](kernel-small-debug-shell-cmd-hwi.md) - - [kill](kernel-small-debug-shell-cmd-kill.md) - - [log](kernel-small-debug-shell-cmd-log.md) - - [memcheck](kernel-small-debug-shell-cmd-memcheck.md) - - [oom](kernel-small-debug-shell-cmd-oom.md) - - [pmm](kernel-small-debug-shell-cmd-pmm.md) - - [reset](kernel-small-debug-shell-cmd-reset.md) - - [sem](kernel-small-debug-shell-cmd-sem.md) - - [stack](kernel-small-debug-shell-cmd-stack.md) - - [su](kernel-small-debug-shell-cmd-su.md) - - [swtmr](kernel-small-debug-shell-cmd-swtmr.md) - - [systeminfo](kernel-small-debug-shell-cmd-sysinfo.md) - - [task](kernel-small-debug-shell-cmd-task.md) - - [uname](kernel-small-debug-shell-cmd-uname.md) - - [vmm](kernel-small-debug-shell-cmd-vmm.md) - - [watch](kernel-small-debug-shell-cmd-watch.md) - - [File Commands](kernel-small-debug-shell-file.md) - - [cat](kernel-small-debug-shell-file-cat.md) - - [cd](kernel-small-debug-shell-file-cd.md) - - [chgrp](kernel-small-debug-shell-file-chgrp.md) - - [chmod](kernel-small-debug-shell-file-chmod.md) - - [chown](kernel-small-debug-shell-file-chown.md) - - [cp](kernel-small-debug-shell-file-cp.md) - - [format](kernel-small-debug-shell-file-format.md) - - [ls](kernel-small-debug-shell-file-ls.md) - - [lsfd](kernel-small-debug-shell-file-lsfd.md) - - [mkdir](kernel-small-debug-shell-file-mkdir.md) - - [mount](kernel-small-debug-shell-file-mount.md) - - [partinfo](kernel-small-debug-shell-file-partinfo.md) - - [partition](kernel-small-debug-shell-file-partition.md) - - [pwd](kernel-small-debug-shell-file-pwd.md) - - [rm](kernel-small-debug-shell-file-rm.md) - - [rmdir](kernel-small-debug-shell-file-rmdir.md) - - [statfs](kernel-small-debug-shell-file-statfs.md) - - [sync](kernel-small-debug-shell-file-sync.md) - - [touch](kernel-small-debug-shell-file-touch.md) - - [writeproc](kernel-small-debug-shell-file-write.md) - - [umount](kernel-small-debug-shell-file-umount.md) - - [Network Commands](kernel-small-debug-shell-net.md) - - [arp](kernel-small-debug-shell-net-arp.md) - - [dhclient](kernel-small-debug-shell-net-dhclient.md) - - [ifconfig](kernel-small-debug-shell-net-ifconfig.md) - - [ipdebug](kernel-small-debug-shell-net-ipdebug.md) - - [netstat](kernel-small-debug-shell-net-netstat.md) - - [ntpdate](kernel-small-debug-shell-net-ntpdate.md) - - [ping](kernel-small-debug-shell-net-ping.md) - - [ping6](kernel-small-debug-shell-net-ping6.md) - - [telnet](kernel-small-debug-shell-net-telnet.md) - - [tftp](kernel-small-debug-shell-net-tftp.md) - - [Magic Key](kernel-small-debug-shell-magickey.md) - - [User-Space Exception Information](kernel-small-debug-shell-error.md) - - [Trace](kernel-small-debug-trace.md) - - [perf](kernel-mini-memory-perf.md) - - [LMS](kernel-small-memory-lms.md) - - [Process Commissioning](kernel-small-debug-process.md) - - [CPUP](kernel-small-debug-process-cpu.md) - - [Memory Debugging](kernel-small-debug-memory.md) - - [Memory Information Statistics](kernel-small-debug-memory-info.md) - - [Memory Leak Check](kernel-small-debug-memory-leak.md) - - [Memory Corruption Check](kernel-small-debug-memory-corrupt.md) - - [User-Mode Memory Debugging](kernel-small-debug-user.md) - - [Basic Concepts](kernel-small-debug-user-concept.md) - - [Working Principles](kernel-small-debug-user-function.md) - - [Usage](kernel-small-debug-user-guide.md) - - [API Description](kernel-small-debug-user-guide-api.md) - - [How to Use](kernel-small-debug-user-guide-use.md) - - [Calling APIs](kernel-small-debug-user-guide-use-api.md) - - [Using the CLI](kernel-small-debug-user-guide-use-cli.md) - - [Typical Memory Problems](kernel-small-debug-user-faqs.md) - - [Other Kernel Debugging Methods](kernel-small-debug-other.md) - - [Dying Gasp](kernel-small-debug-trace-other-lastwords.md) - - [Common Fault Locating Methods](kernel-small-debug-trace-other-faqs.md) - - [Appendix](kernel-small-apx.md) - - [Basic Data Structure](kernel-small-apx-structure.md) - - [Doubly Linked List](kernel-small-apx-dll.md) - - [Bitwise Operation](kernel-small-apx-bitwise.md) - - [Standard Library](kernel-small-apx-library.md) - -- [Kernel for Standard Systems](kernel-standard.md) - - [Linux Kernel Overview](kernel-standard-overview.md) - - [Applying Patches on Development Boards](kernel-standard-patch.md) - - [Compiling and Building the Linux Kernel](kernel-standard-build.md) - - [Enhanced Kernel Features](kernel-standard-enhanced-features.md) - - [Enhanced SWAP](kernel-standard-mm-eswap.md) - - [Task Scheduling](kernel-standard-sched.md) - - [Related Thread Group](kernel-standard-sched-rtg.md) - - [Lightweight CPU Isolation](kernel-standard-sched-cpuisolation.md) \ No newline at end of file +- Kernel + - Mini-System Kernel + - [Kernel Overview](kernel-mini-overview.md) + - Basic Kernel + - [Interrupt Management](kernel-mini-basic-interrupt.md) + - [Task Management](kernel-mini-basic-task.md) + - Memory Management + - [Basic Concepts](kernel-mini-basic-memory-basic.md) + - [Static Memory](kernel-mini-basic-memory-static.md) + - [Dynamic Memory](kernel-mini-basic-memory-dynamic.md) + - Kernel Communication Mechanisms + - [Event](kernel-mini-basic-ipc-event.md) + - [Mutex](kernel-mini-basic-ipc-mutex.md) + - [Queue](kernel-mini-basic-ipc-queue.md) + - [Semaphore](kernel-mini-basic-ipc-sem.md) + - [Time Management](kernel-basic-mini-time.md) + - [Software Timer](kernel-mini-basic-soft.md) + - Extended Components + - [C++ Support](kernel-mini-extend-support.md) + - [PUP](kernel-mini-extend-cpup.md) + - [Dynamic Loading](kernel-mini-extend-dynamic-loading.md) + - [File System](kernel-mini-extend-file.md) + - [FAT](kernel-mini-extend-file-fat.md) + - [LittleFS](kernel-mini-extend-file-lit.md) + - Kernel Debugging + - [Memory Debugging](kernel-mini-memory-debug.md) + - [Memory Information Statistics](kernel-mini-memory-debug-mes.md) + - [Memory Leak Check](kernel-mini-imemory-debug-det.md) + - [Memory Corruption Check](kernel-mini-memory-debug-cet.md) + - [Exception Debugging](kernel-mini-memory-exception.md) + - [Trace](kernel-mini-memory-trace.md) + - [LMS](kernel-mini-memory-lms.md) + - Appendix + - [Kernel Coding Specification](kernel-mini-appx-code.md) + - [Doubly Linked List](kernel-mini-appx-data-list.md) + - Standard Libraries + - [CMSIS Support](kernel-mini-appx-lib-cmsis.md) + - [POSIX support](kernel-mini-appx-lib-posix.md) + - Small-System Kernel + - [Kernel Overview](kernel-small-overview.md) + - Kernel Startup + - [Startup in Kernel Space](kernel-small-start-kernel.md) + - [Startup in User Space](kernel-small-start-user.md) + - Basic Kernel + - [Interrupt and Exception Handling](kernel-small-basic-interrupt.md) + - Process Management + - [Process](kernel-small-basic-process-process.md) + - [Task](kernel-small-basic-process-thread.md) + - [Scheduler](kernel-small-basic-process-scheduler.md) + - Memory Management + - [Heap Memory Management](kernel-small-basic-memory-heap.md) + - [Physical Memory Management](kernel-small-basic-memory-physical.md) + - [Virtual Memory Management](kernel-small-basic-memory-virtual.md) + - [Virtual-to-Physical Mapping](kernel-small-basic-inner-reflect.md) + - Kernel Communication Mechanisms + - [Event](kernel-small-basic-trans-event.md) + - [Semaphore](kernel-small-basic-trans-semaphore.md) + - [Mutex](kernel-small-basic-trans-mutex.md) + - [Queue](kernel-small-basic-trans-queue.md) + - [RW Lock](kernel-small-basic-trans-rwlock.md) + - [Futex](kernel-small-basic-trans-user-mutex.md) + - [Signal](kernel-small-basic-trans-user-signal.md) + - [Time Management](kernel-small-basic-time.md) + - [Software Timer](kernel-small-basic-softtimer.md) + - [Atomic Operation](kernel-small-basic-atomic.md) + - Extension Components + - [System Call](kernel-small-bundles-system.md) + - [Dynamic Loading and Linking](kernel-small-bundles-linking.md) + - [Virtual Dynamic Shared Object](kernel-small-bundles-share.md) + - [LiteIPC](kernel-small-bundles-ipc.md) + - [File Systems](kernel-small-bundles-fs.md) + - [Virtual File System](kernel-small-bundles-fs-virtual.md) + - Supported File Systems + - [FAT](kernel-small-bundles-fs-support-fat.md) + - [JFFS2](kernel-small-bundles-fs-support-jffs2.md) + - [NFS](kernel-small-bundles-fs-support-nfs.md) + - [Ramfs](kernel-small-bundles-fs-support-ramfs.md) + - [Procfs](kernel-small-bundles-fs-support-procfs.md) + - [File System Adaptation](kernel-small-bundles-fs-new.md) + - Debugging and Tools + - Shell + - [Introduction to the Shell](kernel-small-debug-shell-overview.md) + - [Shell Command Development Guidelines](kernel-small-debug-shell-guide.md) + - [Shell Command Programming Example](kernel-small-debug-shell-build.md) + - Shell Command Reference + - System Commands + - [cpup](kernel-small-debug-shell-cmd-cpup.md) + - [date](kernel-small-debug-shell-cmd-date.md) + - [dmesg](kernel-small-debug-shell-cmd-dmesg.md) + - [exec](kernel-small-debug-shell-cmd-exec.md) + - [free](kernel-small-debug-shell-cmd-free.md) + - [help](kernel-small-debug-shell-cmd-help.md) + - [hwi](kernel-small-debug-shell-cmd-hwi.md) + - [kill](kernel-small-debug-shell-cmd-kill.md) + - [log](kernel-small-debug-shell-cmd-log.md) + - [memcheck](kernel-small-debug-shell-cmd-memcheck.md) + - [oom](kernel-small-debug-shell-cmd-oom.md) + - [pmm](kernel-small-debug-shell-cmd-pmm.md) + - [reset](kernel-small-debug-shell-cmd-reset.md) + - [sem](kernel-small-debug-shell-cmd-sem.md) + - [stack](kernel-small-debug-shell-cmd-stack.md) + - [su](kernel-small-debug-shell-cmd-su.md) + - [swtmr](kernel-small-debug-shell-cmd-swtmr.md) + - [systeminfo](kernel-small-debug-shell-cmd-sysinfo.md) + - [task](kernel-small-debug-shell-cmd-task.md) + - [uname](kernel-small-debug-shell-cmd-uname.md) + - [vmm](kernel-small-debug-shell-cmd-vmm.md) + - [watch](kernel-small-debug-shell-cmd-watch.md) + - [reboot](kernel-small-debug-shell-cmd-reboot.md) + - [top](kernel-small-debug-shell-cmd-top.md) + - File Commands + - [cat](kernel-small-debug-shell-file-cat.md) + - [cd](kernel-small-debug-shell-file-cd.md) + - [chgrp](kernel-small-debug-shell-file-chgrp.md) + - [chmod](kernel-small-debug-shell-file-chmod.md) + - [chown](kernel-small-debug-shell-file-chown.md) + - [cp](kernel-small-debug-shell-file-cp.md) + - [format](kernel-small-debug-shell-file-format.md) + - [ls](kernel-small-debug-shell-file-ls.md) + - [lsfd](kernel-small-debug-shell-file-lsfd.md) + - [mkdir](kernel-small-debug-shell-file-mkdir.md) + - [mount](kernel-small-debug-shell-file-mount.md) + - [partinfo](kernel-small-debug-shell-file-partinfo.md) + - [partition](kernel-small-debug-shell-file-partition.md) + - [pwd](kernel-small-debug-shell-file-pwd.md) + - [rm](kernel-small-debug-shell-file-rm.md) + - [rmdir](kernel-small-debug-shell-file-rmdir.md) + - [statfs](kernel-small-debug-shell-file-statfs.md) + - [sync](kernel-small-debug-shell-file-sync.md) + - [touch](kernel-small-debug-shell-file-touch.md) + - [writeproc](kernel-small-debug-shell-file-write.md) + - [umount](kernel-small-debug-shell-file-umount.md) + - [du](kernel-small-debug-shell-file-du.md) + - [mv](kernel-small-debug-shell-file-mv.md) + - Network Commands + - [arp](kernel-small-debug-shell-net-arp.md) + - [dhclient](kernel-small-debug-shell-net-dhclient.md) + - [ifconfig](kernel-small-debug-shell-net-ifconfig.md) + - [ipdebug](kernel-small-debug-shell-net-ipdebug.md) + - [netstat](kernel-small-debug-shell-net-netstat.md) + - [ntpdate](kernel-small-debug-shell-net-ntpdate.md) + - [ping](kernel-small-debug-shell-net-ping.md) + - [ping6](kernel-small-debug-shell-net-ping6.md) + - [telnet](kernel-small-debug-shell-net-telnet.md) + - [tftp](kernel-small-debug-shell-net-tftp.md) + - [Magic Key](kernel-small-debug-shell-magickey.md) + - [User-Space Exception Information](kernel-small-debug-shell-error.md) + - [Trace](kernel-small-debug-trace.md) + - [Perf](kernel-mini-memory-perf.md) + - [LMS](kernel-small-memory-lms.md) + - [Process Debugging](kernel-small-debug-process-cpu.md) + - Kernel-Mode Memory Debugging + - [Memory Information Statistics](kernel-small-debug-memory-info.md) + - [Memory Leak Check](kernel-small-debug-memory-leak.md) + - [Memory Corruption Check](kernel-small-debug-memory-corrupt.md) + - User-Mode Memory Debugging + - [Basic Concepts](kernel-small-debug-user-concept.md) + - [Working Principles](kernel-small-debug-user-function.md) + - Usage + - [Available APIs](kernel-small-debug-user-guide-api.md) + - [How to Use](kernel-small-debug-user-guide-use.md) + - [Calling APIs](kernel-small-debug-user-guide-use-api.md) + - [Using the CLI](kernel-small-debug-user-guide-use-cli.md) + - [Typical Memory Problems](kernel-small-debug-user-faqs.md) + - Other Kernel Debugging Methods + - [Dying Gasp](kernel-small-debug-trace-other-lastwords.md) + - [Common Fault Locating Methods](kernel-small-debug-trace-other-faqs.md) + - Appendix + - Basic Data Structure + - [Doubly Linked List](kernel-small-apx-dll.md) + - [Bitwise Operation](kernel-small-apx-bitwise.md) + - [Standard Library](kernel-small-apx-library.md) + - Standard-System Kernel + - [Linux Kernel Overview](kernel-standard-overview.md) + - [Applying Patches on Development Boards](kernel-standard-patch.md) + - [Compiling and Building the Linux Kernel](kernel-standard-build.md) + - [Enhanced Kernel Features](kernel-standard-enhanced-features.md) + - [Enhanced Swap](kernel-standard-mm-eswap.md) + - [Task Scheduling](kernel-standard-sched.md) + - [Related Thread Group](kernel-standard-sched-rtg.md) + - [Lightweight CPU Isolation](kernel-standard-sched-cpuisolation.md) + \ No newline at end of file diff --git a/en/device-dev/kernel/kernel-mini-app.md b/en/device-dev/kernel/kernel-mini-app.md index 024612639051cffe49bceedb36cbbf21993e5c4f..455b4a81e3afce0c3e1ff5879433f88fa4cb0251 100644 --- a/en/device-dev/kernel/kernel-mini-app.md +++ b/en/device-dev/kernel/kernel-mini-app.md @@ -1,9 +1,9 @@ -# Appendix +# Appendix -- **[Kernel Coding Specification](kernel-mini-appx-code.md)** +- **[Kernel Coding Specification](kernel-mini-appx-code.md)** -- **[Basic Data Structure](kernel-mini-appx-data.md)** +- **[Doubly Linked List](kernel-mini-appx-data-list.md)** -- **[Standard Libraries](kernel-mini-appx-lib.md)** +- **[Standard Libraries](kernel-mini-appx-lib.md)** diff --git a/en/device-dev/kernel/kernel-mini-appx-code.md b/en/device-dev/kernel/kernel-mini-appx-code.md index 7892f4823b55a50d68bdeb9cf931ed66b1012de3..715a5dd6f51a7e148341489d8e55f4e176862ca4 100644 --- a/en/device-dev/kernel/kernel-mini-appx-code.md +++ b/en/device-dev/kernel/kernel-mini-appx-code.md @@ -1,20 +1,9 @@ # Kernel Coding Specification -- [Principle](#section9512812145915) -- [Directory Structure](#section1355317267017) -- [Naming](#section1375364815017) -- [Comments](#section1692516179119) -- [Format](#section10888536113) -- [Macros](#section12276501124) -- [Header Files](#section158507231319) -- [Data Types](#section91351731446) -- [Variables](#section575493915417) -- [Assertions](#section13864440410) -- [Functions](#section671919481745) This kernel coding specification is developed based on the general programming specifications in the industry. It defines the programming styles for kernel developers to follow. -## Principle +## Principle Overall principle: @@ -25,13 +14,13 @@ Overall principle: Comply with this specification in most cases. When third-party open-source code needs to modified or a large number of open-source code APIs are used, follow the specifications applied to the third-party open-source code. Flexibly use this specification based on general principles. -## Directory Structure +## Directory Structure You are advised to divide directories by function module and then define the header file directory and source file directory for each module. Unless otherwise specified, use lowercase letters separated by underscores \(\_\) for directory names and file names. -## **Naming** +## **Naming** The CamelCase style is recommended. The rules are as follows: @@ -106,7 +95,7 @@ OsTaskScan OsMuxInit ``` -## Comments +## Comments Generally, clear software architecture and appropriate symbol naming improve code readability. @@ -142,7 +131,7 @@ You are advised to align multiple consecutive comments on the right. For example #define CONST_B 2000 /* Const B */ ``` -## **Format** +## **Format** Indent code of each level with four spaces rather than tabs \('\\t'\) for a better readability. @@ -233,7 +222,7 @@ int Foo(const char * restrict p); // OK: When there is the restrict modifier, a sz = sizeof(int*); // OK: There is no variable on the right, and * follows the data type. ``` -## Macros +## Macros If a function-like macro can be replaced by a function, use a function instead. Use inline functions for performance-critical scenarios. @@ -293,11 +282,11 @@ Do not reference external function APIs or variables in declaration mode. Use th It is recommended that header files be included by stability in the following sequence: header file corresponding to the source code, C standard library, operating system library, platform library, project public library, and other dependencies. -## Data Types +## Data Types You are advised to use the basic data types defined in **los\_compiler.h**. For example, define the 32-bit unsigned integer as **UINT32**. -## Variables +## Variables Avoid large stack allocations, such as large local arrays. @@ -309,7 +298,7 @@ Do not return the address of a local variable outside its scope. A variable that points to a resource handle or descriptor is assigned a new value immediately after the resource is released. If the scope of the variable ends immediately, no new value needs to be assigned. Variables that point to resource handles or descriptors include pointers, file descriptors, socket descriptors, and other variables that point to resources. -## Assertions +## Assertions Assertions must be defined using macros and take effect only in the debugging version. @@ -319,7 +308,7 @@ Do not change the running environment in an assertion. An assertion is used to check only one error. -## Functions +## Functions The validity of data sent from a process to another process and data sent from an application to the kernel must be verified. The verification includes but is not limited to the following: diff --git a/en/device-dev/kernel/kernel-mini-appx-data-list.md b/en/device-dev/kernel/kernel-mini-appx-data-list.md index 88fe04134a98a348be0614b5be9964bf9a4775a4..3a6b52a2e4a7c117d12bdc15787c5a961e8122df 100644 --- a/en/device-dev/kernel/kernel-mini-appx-data-list.md +++ b/en/device-dev/kernel/kernel-mini-appx-data-list.md @@ -1,15 +1,7 @@ -# Doubly Linked List +# Doubly Linked List -- [Basic Concepts](#section1990715203418) -- [Available APIs](#section848334511411) -- [How to Develop](#section01781261552) -- [Development Example](#section67569495514) - - [Example Description](#section48761994551) - - [Sample Code](#section1280202685519) - - [Verification](#section5811249105512) - -## Basic Concepts +## Basic Concepts A doubly linked list is a linked data structure that consists of a set of sequentially linked records called nodes. Each node contains a pointer to the previous node and a pointer to the next node in the sequence of nodes. The pointer head is unique. @@ -109,7 +101,7 @@ The doubly linked list module provides the following APIs. For more details abou
-## How to Develop +## How to Develop The typical development process of the doubly linked list is as follows: @@ -136,7 +128,7 @@ This example implements the following: 3. Delete a node. 4. Check whether the operation is performed successfully. -### Sample Code +### Sample Code The sample code is as follows: @@ -178,7 +170,7 @@ static UINT32 ListSample(VOID) } ``` -### Verification +### Verification The development is successful if the return result is as follows: diff --git a/en/device-dev/kernel/kernel-mini-appx-data.md b/en/device-dev/kernel/kernel-mini-appx-data.md index d58ec79bc4eb24810ae0e36432ae7c33f1c73cad..57ff277cdcd60adfd0577e65160d04f2e5f22f5a 100644 --- a/en/device-dev/kernel/kernel-mini-appx-data.md +++ b/en/device-dev/kernel/kernel-mini-appx-data.md @@ -1,4 +1,4 @@ -# Basic Data Structure +# Basic Data Structure - **[Doubly Linked List](kernel-mini-appx-data-list.md)** diff --git a/en/device-dev/kernel/kernel-mini-appx-lib-cmsis.md b/en/device-dev/kernel/kernel-mini-appx-lib-cmsis.md index e159dee8effd98a834fcdb6d23704fcd8541ce38..8716dea21cdeb77f05b8f6de35a5108cace03959 100644 --- a/en/device-dev/kernel/kernel-mini-appx-lib-cmsis.md +++ b/en/device-dev/kernel/kernel-mini-appx-lib-cmsis.md @@ -1,19 +1,12 @@ -# CMSIS Support +# CMSIS Support -- [Basic Concepts](#section131091144111615) -- [Development Guidelines](#section57653573161) - - [Available APIs](#section1795910417173) - - [How to Develop](#section48301225131720) - - [Development Example](#section524434761713) - - -## Basic Concepts +## Basic Concepts The Cortex Microcontroller Software Interface Standard \([CMSIS](https://developer.arm.com/tools-and-software/embedded/cmsis)\) is a vendor-independent hardware abstraction layer for microcontrollers based on Arm Cortex processors. Of the CMSIS components, the Real Time Operating System \(RTOS\) defines a set of universal and standardized APIs to reduce the dependency of application developers on specific RTOS and facilitate software porting and reuse. The CMSIS provides CMSIS-RTOS v1 and CMSIS-RTOS v2. The OpenHarmony LiteOS-M supports only the implementation of CMSIS-RTOS v2. -## Development Guidelines +## Development Guidelines -### Available APIs +### Available APIs The following table describes CMSIS-RTOS v2 APIs. For more details about the APIs, see the API reference. @@ -102,7 +95,7 @@ The following table describes CMSIS-RTOS v2 APIs. For more details about the API | | osMessageQueuePut | Puts the message into the queue or times out if the queue is full.| | | osMessageQueueReset | Initialized the message queue to the empty state (not implemented yet).| -### How to Develop +### How to Develop The CMSIS-RTOS v2 component can be provided as a library \(shown in the figure\) or source code. By adding the CMSIS-RTOS v2 component \(typically configuration files\), you can implement RTOS capabilities on CMSIS-based applications. You only need to include the **cmsis\_os2.h** header file. RTOS APIs can then be called to process RTOS kernel-related events. You do not need to recompile the source code when the kernel is replaced. @@ -110,7 +103,7 @@ The RTOS object control block definition needs to be called for static object al ![](figures/how-to-develop.png) -### Development Example +### Development Example ``` #include ... diff --git a/en/device-dev/kernel/kernel-mini-appx-lib-posix.md b/en/device-dev/kernel/kernel-mini-appx-lib-posix.md index 2d6bedf2be74393023e87241894bd99decebaa39..206c59d14b56066e26f5692ea9013c89a663084d 100644 --- a/en/device-dev/kernel/kernel-mini-appx-lib-posix.md +++ b/en/device-dev/kernel/kernel-mini-appx-lib-posix.md @@ -1,19 +1,14 @@ -# POSIX Support +# POSIX Support -- [Basic Concepts](#section1757915134139) -- [Development Guidelines](#section1573664211318) - - [Available APIs](#section10429150121317) - - [Important Notes](#section109174418147) - - [Development Example](#section206149278155) -## Basic Concepts +## Basic Concepts The OpenHarmony kernel uses the **musl libc** library and self-developed APIs and supports the Portable Operating System Interface \(POSIX\). You can develop components and applications working on the kernel based on the POSIX. -## Development Guidelines +## Development Guidelines -### Available APIs +### Available APIs **Table 1** Available APIs @@ -191,7 +186,7 @@ The OpenHarmony kernel uses the **musl libc** library and self-developed APIs | | #include | int libc_get_version(void); | Obtains the libc version.| -### Important Notes +### Important Notes Error codes @@ -248,7 +243,7 @@ Error codes | EOVERFLOW | 75 | Value too large for defined data type | | EMSGSIZE | 90 | Message too long | -### Development Example +### Development Example Demo: diff --git a/en/device-dev/kernel/kernel-mini-appx-lib.md b/en/device-dev/kernel/kernel-mini-appx-lib.md index 6c475ca705488930f46a6a80ae82ae05529a0323..c7cd182503b4f0c421b209a24518263dfb7b64a9 100644 --- a/en/device-dev/kernel/kernel-mini-appx-lib.md +++ b/en/device-dev/kernel/kernel-mini-appx-lib.md @@ -1,4 +1,4 @@ -# Standard Libraries +# Standard Libraries - **[CMSIS Support](kernel-mini-appx-lib-cmsis.md)** diff --git a/en/device-dev/kernel/kernel-mini-basic-interrupt.md b/en/device-dev/kernel/kernel-mini-basic-interrupt.md index 9b4f44f7b8bdda88255da9486a31607327e32d38..eed0a1b6cb29bebab54f406e8e5d97fc799dfeee 100644 --- a/en/device-dev/kernel/kernel-mini-basic-interrupt.md +++ b/en/device-dev/kernel/kernel-mini-basic-interrupt.md @@ -1,6 +1,6 @@ -# Interrupt Management +# Interrupt Management -## Basic Concepts +## Basic Concepts An interrupt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention. An interrupt alerts the processor to a high-priority condition requiring the interruption of the current code being executed by the processor. When a hardware interrupt is triggered, the interrupt handler is located based on the interrupt ID and then executed to handle the interrupt. @@ -37,7 +37,7 @@ The following describes the concepts related to interrupts: An area for storing interrupt vectors. It stores the mapping between interrupt vectors and interrupt IDs. -## Available APIs +## Available APIs The following table describes APIs available for the OpenHarmony LiteOS-M interrupt module. For more details about the APIs, see the API reference. @@ -56,19 +56,19 @@ The following table describes APIs available for the OpenHarmony LiteOS-M interr | Triggering an interrupt| LOS_HwiTrigger | Triggers an interrupt (simulate an external interrupt by writing the related register of the interrupt controller).| | Clearing interrupt register status| LOS_HwiClear | Clears the status bit of the interrupt register corresponding to the interrupt ID. The implementation of this API depends on the interrupt controller version. It is optional.| -## How to Develop +## How to Develop 1. Call **LOS_HwiCreate** to create an interrupt. 2. Call **LOS_HwiTrigger** to trigger the interrupt. 3. Call **LOS_HwiDelete** to delete the specified interrupt. Use this API based on actual requirements. ->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](../public_sys-resources/icon-note.gif) **NOTE**
>- Configure the maximum number of interrupts supported and the number of configurable interrupt priorities based on the specific hardware. >- If the interrupt handler takes long time, the CPU cannot respond to interrupt requests in a timely manner. >- Functions that trigger **LOS\_Schedule** cannot be directly or indirectly executed during interrupt response process. >- The input parameter of **LOS\_IntRestore\(\)** must be the return value of **LOS\_IntLock\(\)**, that is, the current program status register \(CPSR\) value before the interrupt is disabled. Interrupts 0 to 15 in the Cortex-M series processors are for internal use. You are advised not to apply for or create interrupts 0 to 15. -## Development Example +## Development Example This example implements the following: @@ -128,7 +128,7 @@ static UINT32 Example_Interrupt(VOID) } ``` -## Verification +## Verification The development is successful if the return result is as follows: diff --git a/en/device-dev/kernel/kernel-mini-basic-ipc-event.md b/en/device-dev/kernel/kernel-mini-basic-ipc-event.md index 25bc83caa13ee9f163c8de4352d05e2a2a585ae7..aa0b7289138b1d1ba1440725960757ba9c243403 100644 --- a/en/device-dev/kernel/kernel-mini-basic-ipc-event.md +++ b/en/device-dev/kernel/kernel-mini-basic-ipc-event.md @@ -1,19 +1,6 @@ -# Event +# Event -- [Basic Concepts](#section11650123134315) -- [Working Principles](#section1735611583011) - - [Event Control Block](#section1161415384467) - - [Working Principles](#section187761153144617) - -- [Available APIs](#section158501652121514) -- [How to Develop](#section783435801510) -- [Development Example](#section460018317164) - - [Example Description](#section896412438910) - - [Sample Code](#section149077554912) - - [Verification](#section4461439172017) - - -## Basic Concepts +## Basic Concepts An event is a mechanism for communication between tasks. It can be used to synchronize tasks. The events have the following features: @@ -23,9 +10,9 @@ An event is a mechanism for communication between tasks. It can be used to synch APIs are provided to initialize, read/write, clear, and destroy events. -## Working Principles +## Working Principles -### Event Control Block +### Event Control Block ``` /** @@ -58,7 +45,7 @@ The input parameters **eventMask** and **mode** determine whether the condit **Figure 1** Event working mechanism for mini systems ![](figures/event-working-mechanism-for-mini-systems.png "event-working-mechanism-for-mini-systems") -## Available APIs +## Available APIs

Function

@@ -119,7 +106,7 @@ The input parameters **eventMask** and **mode** determine whether the condit
-## How to Develop +## How to Develop The typical event development process is as follows: @@ -134,9 +121,9 @@ The typical event development process is as follows: >- When an event is read or written, the 25th bit of the event is reserved and cannot be set. >- Repeated writes of the same event are treated as one write. -## Development Example +## Development Example -### Example Description +### Example Description In this example, run the **Example\_TaskEntry** task to create the **Example\_Event** task. Run the **Example\_Event** task to read an event to trigger task switching. Run the **Example\_TaskEntry** task to write an event. You can understand the task switching during event operations based on the sequence in which logs are recorded. @@ -230,7 +217,7 @@ UINT32 Example_TaskEntry(VOID) } ``` -### Verification +### Verification The development is successful if the return result is as follows: diff --git a/en/device-dev/kernel/kernel-mini-basic-ipc-mutex.md b/en/device-dev/kernel/kernel-mini-basic-ipc-mutex.md index a995b7893092cb77a0e8ba44a9dc17d5551710a2..da657fe36e0bb3f1ea8f20e336f643b85c5609d7 100644 --- a/en/device-dev/kernel/kernel-mini-basic-ipc-mutex.md +++ b/en/device-dev/kernel/kernel-mini-basic-ipc-mutex.md @@ -1,16 +1,6 @@ -# Mutex +# Mutex -- [Basic Concepts](#section1663192064511) -- [Working Principles](#section115161649726) -- [Available APIs](#section158501652121514) -- [How to Develop](#section783435801510) -- [Development Example](#section1426719434114) - - [Example Description](#section896412438910) - - [Sample Code](#section149077554912) - - [Verification](#section2059413981311) - - -## Basic Concepts +## Basic Concepts A mutual exclusion \(mutex\) is a special binary semaphore used for exclusive access to shared resources. @@ -24,10 +14,10 @@ In a multi-task environment, multiple tasks may access the same shared resources When non-shared resources are accessed by a task, the mutex is locked. Other tasks will be blocked until the mutex is released by the task. The mutex allows only one task to access the shared resources at a time, ensuring integrity of operations on the shared resources. -**Figure 1** Mutex working mechanism for mini systems +**Figure 1** Mutex working mechanism for mini systems ![](figures/mutex-working-mechanism-for-mini-systems.png "mutex-working-mechanism-for-mini-systems") -## Available APIs +## Available APIs **Table 1** APIs of the mutex module @@ -67,7 +57,7 @@ When non-shared resources are accessed by a task, the mutex is locked. Other tas -## How to Develop +## How to Develop The typical mutex development process is as follows: @@ -86,15 +76,15 @@ The typical mutex development process is as follows: 4. Call **LOS\_MuxDelete** to delete a mutex. ->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](../public_sys-resources/icon-note.gif) **NOTE**
>- Two tasks cannot lock the same mutex. If a task attempts to lock a mutex held by another task, the task will be blocked until the mutex is unclocked. >- Mutexes cannot be used in the interrupt service program. >- When using the LiteOS-M kernel, OpenHarmony must ensure real-time task scheduling and avoid long-time task blocking. Therefore, a mutex must be released as soon as possible after use. >- When a mutex is held by a task, the task priority cannot be changed by using APIs such as **LOS\_TaskPriSet**. -## Development Example +## Development Example -### Example Description +### Example Description This example implements the following: @@ -103,7 +93,7 @@ This example implements the following: 3. **Example\_MutexTask1** requests a mutex in scheduled block mode, and waits for 10 ticks. Because the mutex is still held by **Example\_MutexTask2**, **Example\_MutexTask1** is suspended. After 10 ticks, **Example\_MutexTask1** is woken up and attempts to request a mutex in permanent block mode. **Example\_MutexTask1** is suspended because the mutex is still held by **Example\_MutexTask2**. 4. After 100 ticks, **Example\_MutexTask2** is woken up and releases the mutex, and then **Example\_MutexTask1** is woken up. **Example\_MutexTask1** acquires the mutex and then releases the mutex. At last, the mutex is deleted. -### Sample Code +### Sample Code The sample code is as follows: @@ -208,7 +198,7 @@ UINT32 Example_TaskEntry(VOID) } ``` -### Verification +### Verification The development is successful if the return result is as follows: diff --git a/en/device-dev/kernel/kernel-mini-basic-ipc-queue.md b/en/device-dev/kernel/kernel-mini-basic-ipc-queue.md index acd6995c267e242844ddb63a5f0cf847a0cb69ce..348807896b8d07c9740a216807ee779ddf1fc4fb 100644 --- a/en/device-dev/kernel/kernel-mini-basic-ipc-queue.md +++ b/en/device-dev/kernel/kernel-mini-basic-ipc-queue.md @@ -1,6 +1,4 @@ -# Queue - - +# Queue ## Basic Concepts @@ -20,9 +18,9 @@ An asynchronous processing mechanism is provided to allow messages in a queue no - Multiple tasks can receive messages from and send messages to the same queue. - When a queue is created, the required dynamic memory space is automatically allocated in the queue API. -## Working Principles +## Working Principles -### Queue Control Block +### Queue Control Block ``` /** @@ -63,7 +61,7 @@ Each queue control block contains information about the queue status. The preceding figure illustrates how to write data to the tail node only. Writing data to the head node is similar. -## Available APIs +## Available APIs

Function

@@ -130,7 +128,7 @@ The preceding figure illustrates how to write data to the tail node only. Writin
-## How to Develop +## How to Develop 1. Call **LOS\_QueueCreate** to create a queue. The queue ID is returned when the queue is created. 2. Call **LOS\_QueueWrite** or **LOS\_QueueWriteCopy** to write messages to the queue. @@ -138,7 +136,7 @@ The preceding figure illustrates how to write data to the tail node only. Writin 4. Call **LOS\_QueueInfoGet** to obtain queue information. 5. Call **LOS\_QueueDelete** to delete the queue. ->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](../public_sys-resources/icon-note.gif) **NOTE**
>- The maximum number of queues supported by the system is the total number of queue resources of the system, not the number of queue resources available to users. For example, if the system software timer occupies one more queue resource, the number of queue resources available to users decreases by one. >- The input parameters queue name and flags passed when a queue is created are reserved for future use. >- The input parameter **timeOut** in the queue interface function is relative time. @@ -147,9 +145,9 @@ The preceding figure illustrates how to write data to the tail node only. Writin >- If the input parameter **bufferSize** in **LOS\_QueueReadCopy** is less than the length of the message, the message will be truncated. >- **LOS\_QueueWrite**, **LOS\_QueueWriteHead**, and **LOS\_QueueRead** are called to manage data addresses, which means that the actual data read or written is pointer data. Therefore, before using these APIs, ensure that the message node size is the pointer length during queue creation, to avoid waste and read failures. -## Development Example +## Development Example -### Example Description +### Example Description Create a queue and two tasks. Enable task 1 to call the queue write API to send messages, and enable task 2 to receive messages by calling the queue read API. @@ -159,7 +157,7 @@ Create a queue and two tasks. Enable task 1 to call the queue write API to send 4. Enable messages to be received in task 2 by calling **RecvEntry**. 5. Call **LOS\_QueueDelete** to delete the queue. -### Sample Code +### Sample Code The sample code is as follows: @@ -243,7 +241,7 @@ UINT32 ExampleQueue(VOID) } ``` -### Verification +### Verification The development is successful if the return result is as follows: diff --git a/en/device-dev/kernel/kernel-mini-basic-ipc-sem.md b/en/device-dev/kernel/kernel-mini-basic-ipc-sem.md index 02da5be605bb886633e07f265c0ea0dd03d52514..cc810659be1db081a7a1710081c90718358b46b3 100644 --- a/en/device-dev/kernel/kernel-mini-basic-ipc-sem.md +++ b/en/device-dev/kernel/kernel-mini-basic-ipc-sem.md @@ -1,19 +1,6 @@ -# Semaphore +# Semaphore -- [Basic Concepts](#section716754913479) -- [Working Principles](#section1794010261861) - - [Semaphore control block](#section11372149164815) - - [Working Principles](#section139726510491) - -- [Available APIs](#section158501652121514) -- [How to Develop](#section783435801510) -- [Development Example](#section460018317164) - - [Example Description](#section22061718111412) - - [Sample Code](#section1775922321416) - - [Verification](#section160404016213) - - -## Basic Concepts +## Basic Concepts Semaphore is a mechanism for implementing communication between tasks. It implements synchronization between tasks or exclusive access to shared resources. @@ -27,9 +14,9 @@ The usage of the counter value varies with the function of the semaphore. - If the semaphore is used as a mutex, the counter value indicates the number of units of the shared resources available and its initial value cannot be **0**. The semaphore must be acquired before the shared resource is used, and released after the resource is used. When all shared resources are used, the semaphore counter is reduced to **0** and the tasks that need to obtain the semaphores will be blocked. This ensures exclusive access to shared resources. In addition, when the number of shared resources is **1**, a binary semaphore \(similar to the mutex mechanism\) is recommended. - If the semaphore is used for synchronization, the initial semaphore counter value is **0**. When a task fails to acquire the semaphore, it will be blocked and enters Ready or Running state only when the semaphore is released. In this way, task synchronization is implemented. -## Working Principles +## Working Principles -### Semaphore control block +### Semaphore control block ``` /** @@ -44,7 +31,7 @@ typedef struct { } LosSemCB; ``` -### Working Principles +### Working Principles Initializing semaphores: Request memory for the semaphores configured \(the number of semaphores can be configured in the **LOSCFG\_BASE\_IPC\_SEM\_LIMIT** macro by users\), set all semaphores to the unused state, and add them to the linked list for unused semaphores. @@ -61,7 +48,7 @@ A semaphore can also be used to limit the number of tasks that can access the sh **Figure 1** Semaphore working mechanism for mini systems ![](figures/semaphore-working-mechanism-for-mini-systems.png "semaphore-working-mechanism-for-mini-systems") -## Available APIs +## Available APIs

Function

@@ -104,7 +91,7 @@ A semaphore can also be used to limit the number of tasks that can access the sh
-## How to Develop +## How to Develop 1. Call **LOS\_SemCreate** to create a semaphore. To create a binary semaphore, call **LOS\_BinarySemCreate**. 2. Call **LOS\_SemPend** to request a semaphore. @@ -114,9 +101,9 @@ A semaphore can also be used to limit the number of tasks that can access the sh >![](../public_sys-resources/icon-note.gif) **NOTE:** >As interrupts cannot be blocked, semaphores cannot be requested in block mode for interrupts. -## Development Example +## Development Example -### Example Description +### Example Description This example implements the following: @@ -126,7 +113,7 @@ This example implements the following: 4. After 20 ticks, **ExampleSemTask2** is woken up and releases the semaphore. **ExampleSemTask1** acquires the semaphore and is scheduled to run. When **ExampleSemTask1** is complete, it releases the semaphore. 5. Task **ExampleSem** is woken up after 400 ticks and deletes the semaphore. -### Sample Code +### Sample Code The sample code is as follows: @@ -243,7 +230,7 @@ UINT32 ExampleSem(VOID) } ``` -### Verification +### Verification The development is successful if the return result is as follows: diff --git a/en/device-dev/kernel/kernel-mini-basic-ipc.md b/en/device-dev/kernel/kernel-mini-basic-ipc.md index f18d6b58f05842f0bb145cf43a0c8c888e3ca119..a5de0eb580068f885a1e94f447de7b92b51422ba 100644 --- a/en/device-dev/kernel/kernel-mini-basic-ipc.md +++ b/en/device-dev/kernel/kernel-mini-basic-ipc.md @@ -1,4 +1,4 @@ -# Kernel Communication Mechanisms +# Kernel Communication Mechanisms - **[Event](kernel-mini-basic-ipc-event.md)** diff --git a/en/device-dev/kernel/kernel-mini-basic-memory-basic.md b/en/device-dev/kernel/kernel-mini-basic-memory-basic.md index 2e48ff75659f96f4e4c7bdd88d82e5baabd2faf1..2708b91cf2f62ceafd3e8f27e57411183db5e13e 100644 --- a/en/device-dev/kernel/kernel-mini-basic-memory-basic.md +++ b/en/device-dev/kernel/kernel-mini-basic-memory-basic.md @@ -1,4 +1,4 @@ -# Basic Concepts +# Basic Concepts Memory management, one of the core modules of the OS, manages the memory resources of the system. Memory management primarily involves initializing, allocating, and releasing memory. diff --git a/en/device-dev/kernel/kernel-mini-basic-memory-dynamic.md b/en/device-dev/kernel/kernel-mini-basic-memory-dynamic.md index 25f5fece5f8b5901f6a80d42dad9c3245c87480f..54d04f222e05feee34b86955208de2221753845f 100644 --- a/en/device-dev/kernel/kernel-mini-basic-memory-dynamic.md +++ b/en/device-dev/kernel/kernel-mini-basic-memory-dynamic.md @@ -1,68 +1,59 @@ -# Dynamic Memory +# Dynamic Memory -- [Working Principles](#section328282013571) -- [Development Guidelines](#section7921151015814) - - [When to Use](#section326917198583) - - [Available APIs](#section1032331584) - - [How to Develop](#section07271773592) - - [Development Example](#section84931234145913) - - [Verification](#section165233233917) - - -## Working Principles +## Working Principles Dynamic memory management allows memory blocks of any size to be allocated from a large contiguous memory \(memory pool or heap memory\) configured in the system based on user demands when memory resources are sufficient. The memory block can be released for further use when not required. Compared with static memory management, dynamic memory management allows memory allocation on demand but causes fragmentation of memory. -The dynamic memory of the OpenHarmony LiteOS-M has optimized the memory space partitioning based on the Two-Level Segregate Fit \(TLSF\) algorithm to achieve higher performance and minimize fragmentation. [Figure 1](#fig1179964042818) shows the core algorithm of the dynamic memory. +The dynamic memory of the OpenHarmony LiteOS-M has optimized the memory space partitioning based on the Two-Level Segregate Fit \(TLSF\) algorithm to achieve higher performance and minimize fragmentation. [Figure 1](#fig1179964042818) shows the core algorithm of the dynamic memory. -**Figure 1** Dynamic memory algorithm for mini systems +**Figure 1** Dynamic memory algorithm for mini systems ![](figures/dynamic-memory-algorithm-for-mini-systems.png "dynamic-memory-algorithm-for-mini-systems") -Multiple free lists are used for management based on the size of the free memory block. The free memory blocks are divided into two parts: \[4, 127\] and \[27, 231\], as indicated by the size class in [Figure 1](#fig1179964042818). +Multiple free lists are used for management based on the size of the free memory block. The free memory blocks are divided into two parts: \[4, 127\] and \[27, 231\], as indicated by the size class in [Figure 1](#fig1179964042818). -1. The memory in the range of \[4, 127\] \(lower part in [Figure 1](#fig1179964042818)\) is divided into 31 parts. The size of the memory block corresponding to each part is a multiple of 4 bytes. Each part corresponds to a free list and a bit that indicates whether the free list is empty. The value **1** indicates that the free list is not empty. There are 31 bits corresponding to the 31 memory parts in the range of \[4, 127\]. -2. The memory greater than 127 bytes is managed in power of two increments. The size of each range is \[2^n, 2^\(n+1\)-1\], where n is an integer in \[7, 30\]. This range is divided into 24 parts, each of which is further divided into 8 second-level \(L2\) ranges, as shown in Size Class and Size SubClass in the upper part of [Figure 1](#fig1179964042818). Each L2 range corresponds to a free list and a bit that indicates whether the free list is empty. There are a total of 192 \(24 x 8\) L2 ranges, corresponding to 192 free lists and 192 bits. +1. The memory in the range of \[4, 127\] \(lower part in [Figure 1](#fig1179964042818)\) is divided into 31 parts. The size of the memory block corresponding to each part is a multiple of 4 bytes. Each part corresponds to a free list and a bit that indicates whether the free list is empty. The value **1** indicates that the free list is not empty. There are 31 bits corresponding to the 31 memory parts in the range of \[4, 127\]. +2. The memory greater than 127 bytes is managed in power of two increments. The size of each range is \[2^n, 2^\(n+1\)-1\], where n is an integer in \[7, 30\]. This range is divided into 24 parts, each of which is further divided into 8 second-level \(L2\) ranges, as shown in Size Class and Size SubClass in the upper part of [Figure 1](#fig1179964042818). Each L2 range corresponds to a free list and a bit that indicates whether the free list is empty. There are a total of 192 \(24 x 8\) L2 ranges, corresponding to 192 free lists and 192 bits. For example, insert 40-byte free memory to a free list. The 40-byte free memory corresponds to the 10th free list in the range of \[40, 43\], and the 10th bit indicates the use of the free list. The system inserts the 40-byte free memory to the 10th free list and determines whether to update the bitmap flag. When 40-byte memory is requested, the system obtains the free list corresponding to the memory block of the requested size based on the bitmap flag, and then obtains a free memory node from the free list. If the size of the allocated node is greater than the memory requested, the system splits the node and inserts the remaining node to the free list. If 580-byte free memory needs to be inserted to a free list, the 580-byte free memory corresponds to the 47th \(31 + 2 x 8\) free list in L2 range \[2^9, 2^9+2^6\], and the 47th bit indicates the use of the free list. The system inserts the 580-byte free memory to the 47th free list and determines whether to update the bitmap flag. When 580-byte memory is requested, the system obtains the free list corresponding to the memory block of the requested size based on the bitmap flag, and then obtains a free memory node from the free list. If the size of the allocated node is greater than the memory requested, the system splits the node and inserts the remaining node to the free list. If the corresponding free list is empty, the system checks for a free list meeting the requirements in a larger memory range. In actual application, the system can locate the free list that meets the requirements at a time. -[Figure 2](#fig10997102213017) shows the memory management structure. +[Figure 2](#fig10997102213017) shows the memory management structure. -**Figure 2** Dynamic memory management structure for mini systems +**Figure 2** Dynamic memory management structure for mini systems ![](figures/dynamic-memory-management-structure-for-mini-systems.png "dynamic-memory-management-structure-for-mini-systems") -- Memory pool header +- Memory pool header - The memory pool header contains the memory pool information, bitmap flag array, and free list array. The memory pool information includes the start address of the memory pool, total size of the heap memory, and attributes of the memory pool. The bitmap flag array consists of seven 32-bit unsigned integers. Each bit indicates whether the free list is inserted with free memory block nodes. The free list contains information about 223 free memory head nodes. The free memory head node information contains a memory node header and information about the previous and next nodes in the free list. + The memory pool header contains the memory pool information, bitmap flag array, and free list array. The memory pool information includes the start address of the memory pool, total size of the heap memory, and attributes of the memory pool. The bitmap flag array consists of seven 32-bit unsigned integers. Each bit indicates whether the free list is inserted with free memory block nodes. The free list contains information about 223 free memory head nodes. The free memory head node information contains a memory node header and information about the previous and next nodes in the free list. -- Memory pool nodes +- Memory pool nodes - There are three types of nodes: free node, used node, and end node. Each memory node maintains the size and use flag of the memory node and a pointer to the previous memory node in the memory pool. The free nodes and used nodes have a data area, but the end node has no data area. + There are three types of nodes: free node, used node, and end node. Each memory node maintains the size and use flag of the memory node and a pointer to the previous memory node in the memory pool. The free nodes and used nodes have a data area, but the end node has no data area. -The off-chip physical memory needs to be used because the on-chip RAMs of some chips cannot meet requirements. The OpenHarmony LiteOS-M kernel can logically combine multiple discontiguous memory regions so that users are unaware of the discontiguous memory regions in the underlying layer. The OpenHarmony LiteOS-M kernel memory module inserts discontiguous memory regions into a free list as free memory nodes and marks the discontiguous parts as virtual memory nodes that have been used. In this way, the discontinuous memory regions are logically combined as a unified memory pool. [Figure 3](#fig18471556115917) shows how the discontiguous memory regions are logically integrated. +The off-chip physical memory needs to be used because the on-chip RAMs of some chips cannot meet requirements. The OpenHarmony LiteOS-M kernel can logically combine multiple discontiguous memory regions so that users are unaware of the discontiguous memory regions in the underlying layer. The OpenHarmony LiteOS-M kernel memory module inserts discontiguous memory regions into a free list as free memory nodes and marks the discontiguous parts as virtual memory nodes that have been used. In this way, the discontinuous memory regions are logically combined as a unified memory pool. [Figure 3](#fig18471556115917) shows how the discontiguous memory regions are logically integrated. -**Figure 3** Integrating discontiguous memory regions +**Figure 3** Integrating discontiguous memory regions ![](figures/integrating-discontiguous-memory-regions.png "integrating-discontiguous-memory-regions") The discontiguous memory regions are integrated into a unified memory pool as follows: -1. Call **LOS\_MemInit** to initialize the first memory region of multiple discontiguous memory regions. -2. Obtain the start address and length of the next memory region, and calculate the **gapSize** between the current memory region and its previous memory region. The **gapSize** is considered as a used virtual node. -3. Set the size of the end node of the previous memory region to the sum of **gapSize** and **OS\_MEM\_NODE\_HEAD\_SIZE**. -4. Divide the current memory region into a free memory node and an end node, insert the free memory node to the free list, and set the link relationship between the nodes. -5. Repeat [2](#li26042441209) to [4](#li10604194419014) to integrate more discontiguous memory regions. +1. Call **LOS\_MemInit** to initialize the first memory region of multiple discontiguous memory regions. +2. Obtain the start address and length of the next memory region, and calculate the **gapSize** between the current memory region and its previous memory region. The **gapSize** is considered as a used virtual node. +3. Set the size of the end node of the previous memory region to the sum of **gapSize** and **OS\_MEM\_NODE\_HEAD\_SIZE**. +4. Divide the current memory region into a free memory node and an end node, insert the free memory node to the free list, and set the link relationship between the nodes. +5. Repeat [2](#li26042441209) to [4](#li10604194419014) to integrate more discontiguous memory regions. -## Development Guidelines +## Development Guidelines -### When to Use +### When to Use Dynamic memory management allocates and manages memory resources requested by users dynamically. It is a good choice when users need memory blocks of different sizes. You can call the dynamic memory allocation function of the OS to request a memory block of the specified size. You can call the dynamic memory release function to release the memory at any time. -### Available APIs +### Available APIs The following table describes APIs available for OpenHarmony LiteOS-M dynamic memory management. For more details about the APIs, see the API reference. -**Table 1** APIs of the dynamic memory module +**Table 1** APIs of the dynamic memory module

Function

@@ -159,38 +150,38 @@ The following table describes APIs available for OpenHarmony LiteOS-M dynamic me
>![](../public_sys-resources/icon-note.gif) **NOTE:** ->- The dynamic memory module manages memory through control block structures, which consume extra memory. Therefore, the actual memory space available to users is less than the value of **OS\_SYS\_MEM\_SIZE**. ->- The **LOS\_MemAllocAlign** and **LOS\_MemMallocAlign** APIs consume extra memory for memory alignment, which may cause memory loss. When the memory used for alignment is freed up, the lost memory will be reclaimed. ->- The discontiguous memory regions passed by the **LosMemRegion** array to the **LOS\_MemRegionsAdd** API must be sorted in ascending order by memory start address in memory regions, and the memory regions cannot overlap. +>- The dynamic memory module manages memory through control block structures, which consume extra memory. Therefore, the actual memory space available to users is less than the value of **OS\_SYS\_MEM\_SIZE**. +>- The **LOS\_MemAllocAlign** and **LOS\_MemMallocAlign** APIs consume extra memory for memory alignment, which may cause memory loss. When the memory used for alignment is freed up, the lost memory will be reclaimed. +>- The discontiguous memory regions passed by the **LosMemRegion** array to the **LOS\_MemRegionsAdd** API must be sorted in ascending order by memory start address in memory regions, and the memory regions cannot overlap. -### How to Develop +### How to Develop The typical development process of dynamic memory is as follows: -1. Call the **LOS\_MemInit** API to initialize a memory pool. +1. Call the **LOS\_MemInit** API to initialize a memory pool. - After a memory pool is initialized, a memory pool control header and end node will be generated, and the remaining memory is marked as free nodes. The end node is the last node in the memory pool, and its size is **0**. + After a memory pool is initialized, a memory pool control header and end node will be generated, and the remaining memory is marked as free nodes. The end node is the last node in the memory pool, and its size is **0**. -1. Call the **LOS\_MemAlloc** API to allocate dynamic memory of any size. +1. Call the **LOS\_MemAlloc** API to allocate dynamic memory of any size. - The system checks whether the dynamic memory pool has free memory blocks greater than the requested size. If yes, the system allocates a memory block and returns the pointer to the memory block. If no, the system returns NULL. If the memory block allocated is greater than the requested size, the system splits the memory block and inserts the remaining memory block to the free list. + The system checks whether the dynamic memory pool has free memory blocks greater than the requested size. If yes, the system allocates a memory block and returns the pointer to the memory block. If no, the system returns NULL. If the memory block allocated is greater than the requested size, the system splits the memory block and inserts the remaining memory block to the free list. -1. Call the **LOS\_MemFree** API to release dynamic memory. +1. Call the **LOS\_MemFree** API to release dynamic memory. - The released memory block can be reused. When **LOS\_MemFree** is called, the memory block will be reclaimed and marked as free nodes. When memory blocks are reclaimed, adjacent free nodes are automatically merged. + The released memory block can be reused. When **LOS\_MemFree** is called, the memory block will be reclaimed and marked as free nodes. When memory blocks are reclaimed, adjacent free nodes are automatically merged. -### Development Example +### Development Example This example implements the following: -1. Initialize a dynamic memory pool. -2. Allocate a memory block from the dynamic memory pool. -3. Store a piece of data in the memory block. -4. Print the data in the memory block. -5. Release the memory block. +1. Initialize a dynamic memory pool. +2. Allocate a memory block from the dynamic memory pool. +3. Store a piece of data in the memory block. +4. Print the data in the memory block. +5. Release the memory block. The sample code is as follows: @@ -236,7 +227,7 @@ VOID Example_DynMem(VOID) } ``` -### Verification +### Verification The output is as follows: diff --git a/en/device-dev/kernel/kernel-mini-basic-memory-static.md b/en/device-dev/kernel/kernel-mini-basic-memory-static.md index d8091d9a25bb4774416c79121d5f46e12fe35457..f29ccce4a2135019bf853d49760a8e5c17b84f20 100644 --- a/en/device-dev/kernel/kernel-mini-basic-memory-static.md +++ b/en/device-dev/kernel/kernel-mini-basic-memory-static.md @@ -1,34 +1,25 @@ -# Static Memory +# Static Memory -- [Working Principles](#section165473517522) -- [Development Guidelines](#section57511620165218) - - [When to Use](#section215474911529) - - [Available APIs](#section79231214539) - - [How to Develop](#section1388511316548) - - [Development Example](#section17801515105519) - - [Verification](#section11818154112319) - - -## Working Principles +## Working Principles The static memory is a static array. The block size in the static memory pool is set during initialization and cannot be changed after initialization. -The static memory pool consists of a control block **LOS\_MEMBOX\_INFO** and several memory blocks **LOS\_MEMBOX\_NODE** of the same size. The control block is located at the head of the memory pool and used for memory block management. It contains the memory block size \(**uwBlkSize**\), number of memory blocks \(**uwBlkNum**\), number of allocated memory blocks \(**uwBlkCnt**\), and free list \(**stFreeList**\). Memory is allocated and released by block size. Each memory block contains the pointer **pstNext** that points to the next memory block. +The static memory pool consists of a control block **LOS\_MEMBOX\_INFO** and several memory blocks **LOS\_MEMBOX\_NODE** of the same size. The control block is located at the head of the memory pool and used for memory block management. It contains the memory block size \(**uwBlkSize**\), number of memory blocks \(**uwBlkNum**\), number of allocated memory blocks \(**uwBlkCnt**\), and free list \(**stFreeList**\). Memory is allocated and released by block size. Each memory block contains the pointer **pstNext** that points to the next memory block. -**Figure 1** Static memory +**Figure 1** Static memory ![](figures/static-memory.png "static-memory") -## Development Guidelines +## Development Guidelines -### When to Use +### When to Use Use static memory allocation to obtain memory blocks of the fixed size. When the memory is no longer required, release the static memory. -### Available APIs +### Available APIs The following table describes APIs available for OpenHarmony LiteOS-M static memory management. For more details about the APIs, see the API reference. -**Table 1** APIs of the static memory module +**Table 1** APIs of the static memory module

Function

@@ -80,32 +71,32 @@ The following table describes APIs available for OpenHarmony LiteOS-M static mem
->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](../public_sys-resources/icon-note.gif) **NOTE**
>The number of memory blocks in the memory pool after initialization is not equal to the total memory size divided by the memory block size. The reason is the control block of the memory pool and the control header of each memory block have memory overheads. When setting the total memory size, you need to consider these factors. -### How to Develop +### How to Develop The typical development process of static memory is as follows: 1. Plan a memory space as the static memory pool. -2. Call the **LOS\_MemboxInit** API to initialize the static memory pool. +2. Call the **LOS\_MemboxInit** API to initialize the static memory pool. During initialization, the memory space specified by the input parameter is divided into multiple blocks \(the number of blocks depends on the total static memory size and the block size\). Insert all memory blocks to the free list, and place the control header at the beginning of the memory. -3. Call the **LOS\_MemboxAlloc** API to allocate static memory. +3. Call the **LOS\_MemboxAlloc** API to allocate static memory. The system allocates the first free memory block from the free list and returns the start address of this memory block. -4. Call the **LOS\_MemboxClr** API. +4. Call the **LOS\_MemboxClr** API. Clear the memory block corresponding to the address contained in the input parameter. -5. Call the **LOS\_MemboxFree** API. +5. Call the **LOS\_MemboxFree** API. Add the memory block to the free list. -### Development Example +### Development Example This example implements the following: @@ -167,7 +158,7 @@ VOID Example_StaticMem(VOID) } ``` -### Verification +### Verification The output is as follows: diff --git a/en/device-dev/kernel/kernel-mini-basic-memory.md b/en/device-dev/kernel/kernel-mini-basic-memory.md index a473de6739f423492580dec911faa48d298aaaea..f5fa73731a77c804e3bfaeee265bb3fb268fd8ad 100644 --- a/en/device-dev/kernel/kernel-mini-basic-memory.md +++ b/en/device-dev/kernel/kernel-mini-basic-memory.md @@ -1,4 +1,4 @@ -# Memory Management +# Memory Management - **[Basic Concepts](kernel-mini-basic-memory-basic.md)** diff --git a/en/device-dev/kernel/kernel-mini-basic-soft.md b/en/device-dev/kernel/kernel-mini-basic-soft.md index 2beb8407c6825d79491a411ad97612117dbc09e8..6efbc1b6e8575391fbac7e6511490be31f081af6 100644 --- a/en/device-dev/kernel/kernel-mini-basic-soft.md +++ b/en/device-dev/kernel/kernel-mini-basic-soft.md @@ -1,19 +1,6 @@ -# Software Timer +# Software Timer -- [Basic Concepts](#section13256164145219) -- [Working Principles](#section070665816719) - - [Timer States](#section115453813506) - - [Timer Modes](#section137521353175010) - -- [Available APIs](#section158501652121514) -- [How to Develop](#section783435801510) -- [Development Example](#section460018317164) - - [Example Description](#section3741753191918) - - [Sample Code](#section20760101182016) - - [Verification](#section11244112818172) - - -## Basic Concepts +## Basic Concepts The software timer is a software-simulated timer based on system tick interrupts. When the preset tick counter value has elapsed, the user-defined callback will be invoked. The timing precision is related to the cycle of the system tick clock. @@ -28,9 +15,9 @@ The software timer supports the following functions: - Deleting a software timer - Obtaining the number of remaining ticks of a software timer -## Working Principles +## Working Principles -The software timer is a system resource. When modules are initialized, a contiguous section of memory is allocated for software timers. The maximum number of timers supported by the system is configured by the **LOSCFG\_BASE\_CORE\_SWTMR\_LIMIT** macro in **los\_config.h**. +The software timer is a system resource. When modules are initialized, a contiguous section of memory is allocated for software timers. The maximum number of timers supported by the system is configured by the **LOSCFG\_BASE\_CORE\_SWTMR\_LIMIT** macro in **los\_config.h**. Software timers use a queue and a task resource of the system. The software timers are triggered based on the First In First Out \(FIFO\) rule. A timer with a shorter value is always closer to the queue head than a timer with a longer value, and is preferentially triggered. @@ -40,7 +27,7 @@ When a tick interrupt occurs, the tick interrupt handler scans the global timing When the tick interrupt handling function is complete, the software timer task \(with the highest priority\) is woken up. In this task, the timeout callback function for the recorded timer is called. -### Timer States +### Timer States - OS\_SWTMR\_STATUS\_UNUSED @@ -49,12 +36,12 @@ When the tick interrupt handling function is complete, the software timer task \ - OS\_SWTMR\_STATUS\_CREATED - The timer is created but not started or the timer is stopped. When **LOS\_SwtmrCreate** is called for a timer that is not in use or **LOS\_SwtmrStop** is called for a newly started timer, the timer changes to this state. + The timer is created but not started or the timer is stopped. When **LOS\_SwtmrCreate** is called for a timer that is not in use or **LOS\_SwtmrStop** is called for a newly started timer, the timer changes to this state. - OS\_SWTMR\_STATUS\_TICKING - The timer is running \(counting\). When **LOS\_SwtmrStart** is called for a newly created timer, the timer enters this state. + The timer is running \(counting\). When **LOS\_SwtmrStart** is called for a newly created timer, the timer enters this state. ### Timer Modes @@ -65,11 +52,11 @@ The OpenHarmony LiteOS-M kernel provides three types of software timers: - Periodic timer: This type of timer periodically triggers timer events until it is manually stopped. - One-shot timer deleted by calling an API -## Available APIs +## Available APIs The following table describes APIs available for the OpenHarmony LiteOS-M software timer module. For more details about the APIs, see the API reference. -**Table 1** Software timer APIs +**Table 1** Software timer APIs

Function

@@ -114,46 +101,46 @@ The following table describes APIs available for the OpenHarmony LiteOS-M softwa
-## How to Develop +## How to Develop The typical development process of software timers is as follows: 1. Configure the software timer. - - Check that **LOSCFG\_BASE\_CORE\_SWTMR** and **LOSCFG\_BASE\_IPC\_QUEUE** are set to **1**. - - Configure **LOSCFG\_BASE\_CORE\_SWTMR\_LIMIT** \(maximum number of software timers supported by the system\). - - Configure **OS\_SWTMR\_HANDLE\_QUEUE\_SIZE** \(maximum length of the software timer queue\). + - Check that **LOSCFG\_BASE\_CORE\_SWTMR** and **LOSCFG\_BASE\_IPC\_QUEUE** are set to **1**. + - Configure **LOSCFG\_BASE\_CORE\_SWTMR\_LIMIT** \(maximum number of software timers supported by the system\). + - Configure **OS\_SWTMR\_HANDLE\_QUEUE\_SIZE** \(maximum length of the software timer queue\). -2. Call **LOS\_SwtmrCreate** to create a software timer. +2. Call **LOS\_SwtmrCreate** to create a software timer. - Create a software timer with the specified timing duration, timeout handling function, and triggering mode. - Return the function execution result \(success or failure\). -3. Call **LOS\_SwtmrStart** to start the software timer. -4. Call **LOS\_SwtmrTimeGet** to obtain the remaining number of ticks of the software timer. -5. Call **LOS\_SwtmrStop** to stop the software timer. -6. Call **LOS\_SwtmrDelete** to delete the software timer. +3. Call **LOS\_SwtmrStart** to start the software timer. +4. Call **LOS\_SwtmrTimeGet** to obtain the remaining number of ticks of the software timer. +5. Call **LOS\_SwtmrStop** to stop the software timer. +6. Call **LOS\_SwtmrDelete** to delete the software timer. ->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](../public_sys-resources/icon-note.gif) **NOTE**
>- Avoid too many operations in the callback function of the software timer. Do not use APIs or perform operations that may cause task suspension or blocking. ->- The software timers use a queue and a task resource of the system. The priority of the software timer tasks is set to **0** and cannot be changed. +>- The software timers use a queue and a task resource of the system. The priority of the software timer tasks is set to **0** and cannot be changed. >- The number of software timer resources that can be configured in the system is the total number of software timer resources available to the entire system, not the number of software timer resources available to users. For example, if the system software timer occupies one more resource, the number of software timer resources available to users decreases by one. >- If a one-shot software timer is created, the system automatically deletes the timer and reclaims resources after the timer times out and the callback function is executed. ->- For a one-shot software timer that will not be automatically deleted after expiration, you need to call **LOS\_SwtmrDelete** to delete it and reclaim the timer resource to prevent resource leakage. +>- For a one-shot software timer that will not be automatically deleted after expiration, you need to call **LOS\_SwtmrDelete** to delete it and reclaim the timer resource to prevent resource leakage. -## Development Example +## Development Example -### Example Description +### Example Description The following programming example demonstrates how to: 1. Create, start, delete, pause, and restart a software timer. 2. Use a one-shot software timer and a periodic software timer -### Sample Code +### Sample Code Prerequisites -- In **los\_config.h**, **LOSCFG\_BASE\_CORE\_SWTMR** is enabled. -- In **los\_config.h**, **LOSCFG\_BASE\_CORE\_SWTMR\_ALIGN** is disabled. The sample code does not involve timer alignment. +- In **los\_config.h**, **LOSCFG\_BASE\_CORE\_SWTMR** is enabled. +- In **los\_config.h**, **LOSCFG\_BASE\_CORE\_SWTMR\_ALIGN** is disabled. The sample code does not involve timer alignment. - The maximum number of software timers supported by the system \(**LOSCFG\_BASE\_CORE\_SWTMR\_LIMIT**\) is configured. - The maximum length of the software timer queue \(OS\_SWTMR\_HANDLE\_QUEUE\_SIZE\) is configured. @@ -250,7 +237,7 @@ UINT32 Example_TaskEntry(VOID) } ``` -### Verification +### Verification The output is as follows: diff --git a/en/device-dev/kernel/kernel-mini-basic-task.md b/en/device-dev/kernel/kernel-mini-basic-task.md index b2a566704c827488e88242ec321b5e26f54efd99..b431d06f674446fe4d0ac7c990eea128d641f7af 100644 --- a/en/device-dev/kernel/kernel-mini-basic-task.md +++ b/en/device-dev/kernel/kernel-mini-basic-task.md @@ -1,16 +1,6 @@ -# Task Management +# Task Management -- [Basic Concepts](#section1524821422111) - - [Task-related Concepts](#section1124425582117) - - [Task Running Mechanism](#section123321315152219) - -- [Available APIs](#section158501652121514) -- [How to Develop](#section783435801510) -- [Development Example](#section460018317164) - - [Verification](#section62921315208) - - -## Basic Concepts +## Basic Concepts From the perspective of the operating system, tasks are the minimum running units that compete for system resources. They can use or wait for CPUs, use system resources such as memory, and run independently. @@ -20,9 +10,9 @@ The task module of the OpenHarmony LiteOS-M provides multiple tasks and supports - A task represents a thread. - The preemptive scheduling mechanism is used for tasks. High-priority tasks can interrupt low-priority tasks. Low-priority tasks can be scheduled only after high-priority tasks are blocked or complete. - Time slice round-robin is used to schedule tasks with the same priority. -- A total of 32 \(**0** to **31**\) priorities are defined. **0** is the highest priority, and **31** is the lowest. +- A total of 32 \(**0** to **31**\) priorities are defined. **0** is the highest priority, and **31** is the lowest. -### Task-related Concepts +### Task-related Concepts **Task States** @@ -37,7 +27,7 @@ A task can be in any of the following states: **Task State Transitions** -**Figure 1** Task state transitions +**Figure 1** Task state transitions ![](figures/task-state-transitions.png "task-state-transitions") The task transition process is as follows: @@ -103,11 +93,11 @@ Task switching involves actions, such as obtaining the task with the highest pri When a task is created, the system initializes the task stack and presets the context. The system places the task entry function in the corresponding position so that the function is executed when the task enters the running state for the first time. -## Available APIs +## Available APIs The following table describes APIs available for the OpenHarmony LiteOS-M task module. For more details about the APIs, see the API reference. -**Table 1** APIs of the task management module +**Table 1** APIs of the task management module | Category| API| Description| | -------- | -------- | -------- | @@ -139,33 +129,33 @@ The following table describes APIs available for the OpenHarmony LiteOS-M task m | Reclaiming task stack resources| LOS_TaskResRecycle | Reclaims all task stack resources.| -## How to Develop +## How to Develop The typical development process of the task module is as follows: -1. Use **LOS\_TaskLock** to lock task scheduling and prevent high-priority tasks from being scheduled. -2. Use **LOS\_TaskCreate** to create a task. -3. Use **LOS\_TaskUnlock** to unlock task scheduling so that tasks can be scheduled by priority. -4. Use **LOS\_TaskDelay** to delay a task. -5. Use **LOS\_TaskSuspend** to suspend a task. -6. Use **LOS\_TaskResume** to resume the suspended task. +1. Use **LOS\_TaskLock** to lock task scheduling and prevent high-priority tasks from being scheduled. +2. Use **LOS\_TaskCreate** to create a task. +3. Use **LOS\_TaskUnlock** to unlock task scheduling so that tasks can be scheduled by priority. +4. Use **LOS\_TaskDelay** to delay a task. +5. Use **LOS\_TaskSuspend** to suspend a task. +6. Use **LOS\_TaskResume** to resume the suspended task. ->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](../public_sys-resources/icon-note.gif) **NOTE**
>- Running idle tasks reclaims the TCBs and stacks in the to-be-recycled linked list. >- The task name is a pointer without memory space allocated. When setting the task name, do not assign the local variable address to the task name pointer. >- The task stack size is 8-byte aligned. Follow the "nothing more and nothing less" principle while determining the task stack size. >- A running task cannot be suspended if task scheduling is locked. >- Idle tasks and software timer tasks cannot be suspended or deleted. ->- In an interrupt handler or when a task is locked, the operation of calling **LOS\_TaskDelay** fails. +>- In an interrupt handler or when a task is locked, the operation of calling **LOS\_TaskDelay** fails. >- Locking task scheduling does not disable interrupts. Tasks can still be interrupted while task scheduling is locked. >- Locking task scheduling must be used together with unlocking task scheduling. >- Task scheduling may occur while a task priority is being set. >- The maximum number of tasks that can be set for the operating system is the total number of tasks of the operating system, not the number of tasks available to users. For example, if the system software timer occupies one more task resource, the number of task resources available to users decreases by one. ->- **LOS\_CurTaskPriSet** and **LOS\_TaskPriSet** cannot be used in interrupts or used to modify the priorities of software timer tasks. ->- If the task corresponding to the task ID sent to **LOS\_TaskPriGet** has not been created or the task ID exceeds the maximum number of tasks, **-1** will be returned. +>- **LOS\_CurTaskPriSet** and **LOS\_TaskPriSet** cannot be used in interrupts or used to modify the priorities of software timer tasks. +>- If the task corresponding to the task ID sent to **LOS\_TaskPriGet** has not been created or the task ID exceeds the maximum number of tasks, **-1** will be returned. >- Resources such as a mutex or a semaphore allocated to a task must have been released before the task is deleted. -## Development Example +## Development Example This example describes the priority-based task scheduling and use of task-related APIs, including creating, delaying, suspending, and resuming two tasks with different priorities, and locking/unlocking task scheduling. The sample code is as follows: @@ -281,7 +271,7 @@ UINT32 Example_TskCaseEntry(VOID) } ``` -### Verification +### Verification The development is successful if the return result is as follows: diff --git a/en/device-dev/kernel/kernel-mini-basic.md b/en/device-dev/kernel/kernel-mini-basic.md index 87b28cd0549130ab2e0d32bfb54c7d7a30911a8a..ac46aa82314e75d5634de902f2cf3f3b87f34c4d 100644 --- a/en/device-dev/kernel/kernel-mini-basic.md +++ b/en/device-dev/kernel/kernel-mini-basic.md @@ -1,4 +1,4 @@ -# Basic Kernel +# Basic Kernel - **[Interrupt Management](kernel-mini-basic-interrupt.md)** diff --git a/en/device-dev/kernel/kernel-mini-debug.md b/en/device-dev/kernel/kernel-mini-debug.md index 8142a264fa7bcdbd64eb15d3df6971eda7b956f0..d69433e3a0a64aca0566249fe08a702572364cd4 100644 --- a/en/device-dev/kernel/kernel-mini-debug.md +++ b/en/device-dev/kernel/kernel-mini-debug.md @@ -1,4 +1,4 @@ -# Kernel Debugging +# Kernel Debugging - **[Memory Debugging](kernel-mini-memory-debug.md)** diff --git a/en/device-dev/kernel/kernel-mini-extend-cpup.md b/en/device-dev/kernel/kernel-mini-extend-cpup.md index 72d4acaac8c4b5c9423b6b954e8692ea8e05ab1a..a5d10352b390a3610804eaf10e70b3d021193322 100644 --- a/en/device-dev/kernel/kernel-mini-extend-cpup.md +++ b/en/device-dev/kernel/kernel-mini-extend-cpup.md @@ -1,32 +1,22 @@ -# CPUP +# CPUP -- [Basic Concepts](#section1275484221216) -- [Working Principles](#section96644177124) -- [Available APIs](#section158501652121514) -- [How to Develop](#section783435801510) -- [Development Example](#section460018317164) - - [Example Description](#section51413507517) - - [Sample Code](#section17617965523) - - [Verification](#section1968771515188) - - -## Basic Concepts +## Basic Concepts The central processing unit percent \(CPUP\) includes the system CPUP and task CPUP. -The system CPUP is the CPU usage of the system within a period of time. It reflects the CPU load and the system running status \(idle or busy\) in the given period of time. The valid range of the system CPUP is 0 to 100 in percentage. The precision can be adjusted through configuration. The value **100** indicates that the system runs with full load. +The system CPUP is the CPU usage of the system within a period of time. It reflects the CPU load and the system running status \(idle or busy\) in the given period of time. The valid range of the system CPUP is 0 to 100 in percentage. The precision can be adjusted through configuration. The value **100** indicates that the system runs with full load. -Task CPUP refers to the CPU usage of a single task. It reflects the task status, busy or idle, in a period of time. The valid range of task CPUP is 0 to 100 in percentage. The precision can be adjusted through configuration. The value **100** indicates that the task is being executed for the given period of time. +Task CPUP refers to the CPU usage of a single task. It reflects the task status, busy or idle, in a period of time. The valid range of task CPUP is 0 to 100 in percentage. The precision can be adjusted through configuration. The value **100** indicates that the task is being executed for the given period of time. With the system CPUP, you can determine whether the current system load exceeds the designed specifications. With the CPUP of each task, you can determine whether the CPU usage of each task meets expectations of the design. -## Working Principles +## Working Principles The OpenHarmony LiteOS-M CPUP records the system CPU usage on a task basis. When task switching occurs, the task start time and task switch-out or exit time are recorded. Each time when a task exits, the system accumulates the CPU time used by the task. -You can configure this function in **target\_config.h**. +You can configure this function in **target\_config.h**. The OpenHarmony LiteOS-M provides the following types of CPUP information: @@ -41,7 +31,7 @@ Task CPUP = Total running time of the task/Total running time of the system ## Available APIs -**Table 1** Functions +**Table 1** Functions

Function

@@ -91,28 +81,28 @@ Task CPUP = Total running time of the task/Total running time of the system
-## How to Develop +## How to Develop The typical CPUP development process is as follows: -1. Call **LOS\_SysCpuUsage** to obtain the system CPUP. -2. Call **LOS\_HistorySysCpuUsage** to obtain the historical CPUP of the system. -3. Call **LOS\_TaskCpuUsage** to obtain the CPUP of a specified task. +1. Call **LOS\_SysCpuUsage** to obtain the system CPUP. +2. Call **LOS\_HistorySysCpuUsage** to obtain the historical CPUP of the system. +3. Call **LOS\_TaskCpuUsage** to obtain the CPUP of a specified task. - If the task has been created, disable interrupt, obtain the CPUP, and then enable interrupt. - If the task is not created, return an error code. -4. Call **LOS\_HistoryTaskCpuUsage** to obtain the historical CPUP of a specified task. +4. Call **LOS\_HistoryTaskCpuUsage** to obtain the historical CPUP of a specified task. - If the task has been created, disable interrupt, obtain the CPUP in different modes, and then enable interrupt. - If the task is not created, return an error code. -5. Call **LOS\_AllCpuUsage** to obtain the CPUP of all tasks. +5. Call **LOS\_AllCpuUsage** to obtain the CPUP of all tasks. - If the CPUP is initialized, disable interrupt, obtain the CPUP in different modes, and then enable interrupt. - If CPUP is not initialized or has invalid input parameters, return an error code. -## Development Example +## Development Example -### Example Description +### Example Description This example implements the following: @@ -122,11 +112,11 @@ This example implements the following: 4. Obtain the CPUP of the created test task. 5. Obtain the CPUP of the created test task in different modes. -### Sample Code +### Sample Code Prerequisites -In **target\_config.h**, the **LOSCFG\_BASE\_CORE\_CPUP** parameter is enabled. +In **target\_config.h**, the **LOSCFG\_BASE\_CORE\_CPUP** parameter is enabled. The sample code is as follows: @@ -180,7 +170,7 @@ UINT32 ItCpupTest(VOID) } ``` -### Verification +### Verification The development is successful if the return result is as follows: diff --git a/en/device-dev/kernel/kernel-mini-extend-dynamic-loading.md b/en/device-dev/kernel/kernel-mini-extend-dynamic-loading.md index df9c13c881c39b8fd4f4a03f8ae91a55dc7f4412..1bf198e1fa337518d06a4062c74a2cf290630b4c 100644 --- a/en/device-dev/kernel/kernel-mini-extend-dynamic-loading.md +++ b/en/device-dev/kernel/kernel-mini-extend-dynamic-loading.md @@ -1,28 +1,17 @@ -# Dynamic Loading +# Dynamic Loading -- [Basic Concepts](#section4330230191314) -- [Working Principles](#section139861939219) - - [Exporting the Symbol Table](#section15414650102716) - - [Loading an ELF File](#section5221181562810) - - [ELF File Link](#section68441639182817) +## Basic Concepts -- [ELF Specifications](#section187315541916) - - [ELF Type](#section1701552268) - - [Options for Linking](#section17292133274) +In small devices with limited hardware resources, dynamic algorithm deployment capability is required to solve the problem that multiple algorithms cannot be deployed at the same time. The LiteOS-M kernel uses the Executable and Linkable Format \(ELF\) loading because it is easy to use and compatible with a wide variety of platforms. The LiteOS-M provides APIs similar to **dlopen** and **dlsym**. Apps can load and unload required algorithm libraries by using the APIs provided by the dynamic loading module. As shown in the following figure, the app obtains the corresponding information output through the API required by the third-party algorithm library. The third-party algorithm library depends on the basic APIs provided by the kernel, such as **malloc**. After the app loads the API and relocates undefined symbols, it can call the API to complete the function. The dynamic loading component supports only the Arm architecture. In addition, the signature and source of the shared library to be loaded must be verified to ensure system security. - -## Basic Concepts - -In small devices with limited hardware resources, dynamic algorithm deployment capability is required to solve the problem that multiple algorithms cannot be deployed at the same time. The LiteOS-M kernel uses the Executable and Linkable Format \(ELF\) loading because it is easy to use and compatible with a wide variety of platforms. The LiteOS-M provides APIs similar to **dlopen** and **dlsym**. Apps can load and unload required algorithm libraries by using the APIs provided by the dynamic loading module. As shown in the following figure, the app obtains the corresponding information output through the API required by the third-party algorithm library. The third-party algorithm library depends on the basic APIs provided by the kernel, such as **malloc**. After the app loads the API and relocates undefined symbols, it can call the API to complete the function. The dynamic loading component supports only the Arm architecture. In addition, the signature and source of the shared library to be loaded must be verified to ensure system security. - -**Figure 1** LiteOS-M kernel dynamic loading architecture +**Figure 1** LiteOS-M kernel dynamic loading architecture ![](figures/liteos-m-kernel-dynamic-loading-architecture.png "liteos-m-kernel-dynamic-loading-architecture") -## Working Principles +## Working Principles -### Exporting the Symbol Table +### Exporting the Symbol Table -The kernel needs to proactively expose the API required by the dynamic library when the shared library calls a kernel API, as shown in the following figure. This mechanism compiles the symbol information to the specified section and calls the **SYM\_EXPORT** macro to export information of the specified symbol. The symbol information is described in the structure **SymInfo**. Its members include the symbol name and symbol address information. The macro **SYM\_EXPORT** imports the symbol information to the **.sym.\*** section by using the **\_\_attribute\_\_** compilation attribute. +The kernel needs to proactively expose the API required by the dynamic library when the shared library calls a kernel API, as shown in the following figure. This mechanism compiles the symbol information to the specified section and calls the **SYM\_EXPORT** macro to export information of the specified symbol. The symbol information is described in the structure **SymInfo**. Its members include the symbol name and symbol address information. The macro **SYM\_EXPORT** imports the symbol information to the **.sym.\*** section by using the **\_\_attribute\_\_** compilation attribute. ``` typedef struct { @@ -37,12 +26,12 @@ const SymInfo sym_##func __attribute__((section(".sym."#func))) = { \ }; ``` -**Figure 2** Exported symbol table information +**Figure 2** Exported symbol table information ![](figures/exported-symbol-table-information.png "exported-symbol-table-information") -### Loading an ELF File +### Loading an ELF File -During the loading process, the LOAD section to be loaded to the memory is obtained based on the ELF file handle and the section offset of the program header table. Generally, there are two sections: read-only section and read-write section. You can run the **readelf -l** command to view the LOAD section information of the ELF file. The physical memory is requested according to the related alignment attributes. Then, a code section or a data segment is written into the memory based on the loading base address and an offset of each section. +During the loading process, the LOAD section to be loaded to the memory is obtained based on the ELF file handle and the section offset of the program header table. Generally, there are two sections: read-only section and read-write section. You can run the **readelf -l** command to view the LOAD section information of the ELF file. The physical memory is requested according to the related alignment attributes. Then, a code section or a data segment is written into the memory based on the loading base address and an offset of each section. ``` $ readelf -l lib.so @@ -66,29 +55,29 @@ Program Headers: 03 .dynamic ``` -**Figure 3** Process of loading an ELF file +**Figure 3** Process of loading an ELF file ![](figures/process-of-loading-an-elf-file.png "process-of-loading-an-elf-file") -### ELF File Link +### ELF File Link -A relocation table is obtained by using a **.dynamic** section of the ELF file. Each entry that needs to be relocated in the table is traversed. Then, the symbol is searched, based on the symbol name that needs to be relocated, in the shared library and the exported symbol table provided by the kernel. The relocation information is updated based on the symbol found. +A relocation table is obtained by using a **.dynamic** section of the ELF file. Each entry that needs to be relocated in the table is traversed. Then, the symbol is searched, based on the symbol name that needs to be relocated, in the shared library and the exported symbol table provided by the kernel. The relocation information is updated based on the symbol found. -**Figure 4** ELF file linking process +**Figure 4** ELF file linking process ![](figures/elf-file-linking-process.png "elf-file-linking-process") -## ELF Specifications +## ELF Specifications -### ELF Type +### ELF Type -When compiling a shared library, you can add **-fPIC** \(a compilation option\) to compile location-independent code. The shared library file type is **ET\_DYN**, which can be loaded to any valid address range. +When compiling a shared library, you can add **-fPIC** \(a compilation option\) to compile location-independent code. The shared library file type is **ET\_DYN**, which can be loaded to any valid address range. -Example: **arm-none-eabi-gcc -fPIC –shared –o lib.so lib.c** +Example: **arm-none-eabi-gcc -fPIC –shared –o lib.so lib.c** -### Options for Linking +### Options for Linking 1. **-nostdlib**: Do not use the lib library in the compiler when linking. 2. **-nostartfiles**: Do not use the startup files in the compiler when linking. 3. **-fPIC**: compiles location-independent shared libraries. -4. **-z max-page-size=4**: sets the number of alignment bytes of the loadable sections in the binary file to **4**. This setting saves memory and can be used for a dynamic library. -5. **-mcpu=** specifies the CPU architecture. +4. **-z max-page-size=4**: sets the number of alignment bytes of the loadable sections in the binary file to **4**. This setting saves memory and can be used for a dynamic library. +5. **-mcpu=** specifies the CPU architecture. diff --git a/en/device-dev/kernel/kernel-mini-extend-file-fat.md b/en/device-dev/kernel/kernel-mini-extend-file-fat.md index 1daa2c5ba187e2109ec000ec4b3653a4859e85f2..5f191076a6e75743b254e0b8611698de701bb8e0 100644 --- a/en/device-dev/kernel/kernel-mini-extend-file-fat.md +++ b/en/device-dev/kernel/kernel-mini-extend-file-fat.md @@ -1,31 +1,20 @@ -# FAT +# FAT -- [Basic Concepts](#section1772629121418) -- [Development Guidelines](#section1149072811148) - - [Adaptation of Drivers](#section19174939191414) - - [How to Develop](#section131211626151513) - -- [Development Example](#section1133718619459) - - [Example Description](#section45337345313) - - [Sample Code](#section119813171539) - - [Verification](#section7987101232311) - - -## Basic Concepts +## Basic Concepts File Allocation Table \(FAT\) is a file system developed for personal computers. It consists of the DOS Boot Record \(DBR\) region, FAT region, and Data region. Each entry in the FAT region records information about the corresponding cluster in the storage device. The cluster information includes whether the cluster is used, number of the next cluster of the file, whether the file ends with the cluster. The FAT file system supports multiple formats, such as FAT12, FAT16, and FAT32. The numbers 12, 16, and 32 indicate the number of bits per cluster within the FAT, respectively. The FAT file system supports multiple media, especially removable media \(such as USB flash drives, SD cards, and removable hard drives\). The FAT file system ensures good compatibility between embedded devices and desktop systems \(such as Windows and Linux\) and facilitates file management. The OpenHarmony kernel supports FAT12, FAT16, and FAT32 file systems. These file systems require a tiny amount of code to implement, use less resources, support a variety of physical media, and are tailorable and compatible with Windows and Linux systems. They also support identification of multiple devices and partitions. The kernel supports multiple partitions on hard drives and allows creation of the FAT file system on the primary partition and logical partition. -## Development Guidelines +## Development Guidelines -### Adaptation of Drivers +### Adaptation of Drivers The use of the FAT file system requires support from the underlying MultiMediaCard \(MMC\) drivers. To run FatFS on a board with an MMC storage device, you must: -1. Implement the **disk\_status**, **disk\_initialize**, **disk\_read**, **disk\_write**, and **disk\_ioctl** APIs to adapt to the embedded MMC \(eMMC\) drivers on the board. +1. Implement the **disk\_status**, **disk\_initialize**, **disk\_read**, **disk\_write**, and **disk\_ioctl** APIs to adapt to the embedded MMC \(eMMC\) drivers on the board. -2. Add the **fs\_config.h** file with information such as **FS\_MAX\_SS** \(maximum sector size of the storage device\) and **FF\_VOLUME\_STRS** \(partition names\) configured. The following is an example: +2. Add the **fs\_config.h** file with information such as **FS\_MAX\_SS** \(maximum sector size of the storage device\) and **FF\_VOLUME\_STRS** \(partition names\) configured. The following is an example: ``` #define FF_VOLUME_STRS "system", "inner", "update", "user" @@ -33,35 +22,35 @@ The use of the FAT file system requires support from the underlying MultiMediaCa #define FAT_MAX_OPEN_FILES 50 ``` -### How to Develop +### How to Develop ->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](../public_sys-resources/icon-note.gif) **NOTE**
>- Note the following when managing FatFS files and directories: > - A file cannot exceed 4 GB. -> - **FAT\_MAX\_OPEN\_FILES** specifies the maximum number files you can open at a time, and **FAT\_MAX\_OPEN\_DIRS** specifies the maximum number of folders you can open at a time. -> - Root directory management is not supported. File and directory names start with the partition name. For example, **user/testfile** indicates the file or directory **testfile** in the **user** partition. -> - To open a file multiple times, use **O\_RDONLY** \(read-only mode\). **O\_RDWR** or **O\_WRONLY** \(writable mode\) can open a file only once. -> - The read and write pointers are not separated. If a file is open in **O\_APPEND** mode, the read pointer is also at the end of the file. If you want to read the file from the beginning, you must manually set the position of the read pointer. +> - **FAT\_MAX\_OPEN\_FILES** specifies the maximum number files you can open at a time, and **FAT\_MAX\_OPEN\_DIRS** specifies the maximum number of folders you can open at a time. +> - Root directory management is not supported. File and directory names start with the partition name. For example, **user/testfile** indicates the file or directory **testfile** in the **user** partition. +> - To open a file multiple times, use **O\_RDONLY** \(read-only mode\). **O\_RDWR** or **O\_WRONLY** \(writable mode\) can open a file only once. +> - The read and write pointers are not separated. If a file is open in **O\_APPEND** mode, the read pointer is also at the end of the file. If you want to read the file from the beginning, you must manually set the position of the read pointer. > - File and directory permission management is not supported. -> - The **stat** and **fstat** APIs do not support query of the modification time, creation time, and last access time. The Microsoft FAT protocol does not support time before A.D. 1980. +> - The **stat** and **fstat** APIs do not support query of the modification time, creation time, and last access time. The Microsoft FAT protocol does not support time before A.D. 1980. >- Note the following when mounting and unmounting FatFS partitions: -> - Partitions can be mounted with the read-only attribute. When the input parameter of the **mount** function is **MS\_RDONLY**, all APIs with the write attribute, such as **write**, **mkdir**, **unlink**, and **open** with **non-O\_RDONLY** attributes, will be rejected. -> - You can use the **MS\_REMOUNT** flag with **mount** to modify the permission for a mounted partition. +> - Partitions can be mounted with the read-only attribute. When the input parameter of the **mount** function is **MS\_RDONLY**, all APIs with the write attribute, such as **write**, **mkdir**, **unlink**, and **open** with **non-O\_RDONLY** attributes, will be rejected. +> - You can use the **MS\_REMOUNT** flag with **mount** to modify the permission for a mounted partition. > - Before unmounting a partition, ensure that all directories and files in the partition are closed. -> - You can use **umount2** with the **MNT\_FORCE** parameter to forcibly close all files and folders and unmount the partition. However, this may cause data loss. Therefore, exercise caution when running **umount2**. ->- The FAT file system supports re-partitioning and formatting of storage devices using **fatfs\_fdisk** and **fatfs\_format**. -> - If a partition is mounted before being formatted using **fatfs\_format**, you must close all directories and files in the partition and unmount the partition first. -> - Before calling **fatfs\_fdisk**, ensure that all partitions in the device are unmounted. -> - Using **fatfs\_fdisk** and **fatfs\_format** may cause data loss. Exercise caution when using them. +> - You can use **umount2** with the **MNT\_FORCE** parameter to forcibly close all files and folders and unmount the partition. However, this may cause data loss. Therefore, exercise caution when running **umount2**. +>- The FAT file system supports re-partitioning and formatting of storage devices using **fatfs\_fdisk** and **fatfs\_format**. +> - If a partition is mounted before being formatted using **fatfs\_format**, you must close all directories and files in the partition and unmount the partition first. +> - Before calling **fatfs\_fdisk**, ensure that all partitions in the device are unmounted. +> - Using **fatfs\_fdisk** and **fatfs\_format** may cause data loss. Exercise caution when using them. -## Development Example +## Development Example -### Example Description +### Example Description This example implements the following: -1. Create the **user/test** directory. -2. Create the **file.txt** file in the **user/test** directory. +1. Create the **user/test** directory. +2. Create the **file.txt** file in the **user/test** directory. 3. Write "Hello OpenHarmony!" at the beginning of the file. 4. Save the update of the file to the device. 5. Set the offset to the beginning of the file. @@ -70,11 +59,11 @@ This example implements the following: 8. Delete the file. 9. Delete the directory. -### Sample Code +### Sample Code Prerequisites -- The MMC device partition is mounted to the **user** directory. +- The MMC device partition is mounted to the **user** directory. The sample code is as follows: @@ -167,7 +156,7 @@ int FatfsTest(void) } ``` -### Verification +### Verification The development is successful if the return result is as follows: diff --git a/en/device-dev/kernel/kernel-mini-extend-file-lit.md b/en/device-dev/kernel/kernel-mini-extend-file-lit.md index 5a75459596425f37a359fcc37ec5d89532e02065..7d51b76ab3167951eeaa72d839481a4630ec2390 100644 --- a/en/device-dev/kernel/kernel-mini-extend-file-lit.md +++ b/en/device-dev/kernel/kernel-mini-extend-file-lit.md @@ -1,18 +1,12 @@ -# LittleFS +# LittleFS -- [Basic Concepts](#section1553253111412) -- [Development Guidelines](#section1496101821515) -- [Sample Code](#section1034515054620) - - [Verification](#section176167422148) - - -## Basic Concepts +## Basic Concepts LittleFS is a small file system designed for flash. By combining the log-structured file system and the copy-on-write \(COW\) file system, LittleFS stores metadata in log structure and data in the COW structure. This special storage empowers LittleFS high power-loss resilience. LittleFS uses the statistical wear leveling algorithm when allocating COW data blocks, effectively prolonging the service life of flash devices. LittleFS is designed for small-sized devices with limited resources, such as ROM and RAM. All RAM resources are allocated through a buffer with the fixed size \(configurable\). That is, the RAM usage does not grow with the file system. LittleFS is a good choice when you look for a flash file system that is power-cut resilient and has wear leveling support on a small device with limited resources. -## Development Guidelines +## Development Guidelines When porting LittleFS to a new hardware device, you need to declare **lfs\_config**: @@ -45,7 +39,7 @@ const struct lfs_config cfg = { **block\_count** indicates the number of blocks that can be erased, which depends on the capacity of the block device and the size of the block to be erased \(**block\_size**\). -## Sample Code +## Sample Code The sample code is as follows: @@ -95,7 +89,7 @@ int main(void) { } ``` -### Verification +### Verification The development is successful if the return result is as follows: diff --git a/en/device-dev/kernel/kernel-mini-extend-file.md b/en/device-dev/kernel/kernel-mini-extend-file.md index dea568471833c3ca7aecd7fb1cdd5db1cbb0cd9f..11f6ec908e2622a9cc11ffaa304e2834b1d04321 100644 --- a/en/device-dev/kernel/kernel-mini-extend-file.md +++ b/en/device-dev/kernel/kernel-mini-extend-file.md @@ -1,8 +1,8 @@ -# File System +# File System The OpenHarmony LiteOS-M kernel supports File Allocation Table file system \(FATFS\) and LittleFS file systems. Like the OpenHarmony LiteOS-A kernel, the OpenHarmony LiteOS-M kernel provides POSIX over the virtual file system \(VFS\) to ensure interface consistency. However, the VFS of the LiteOS-M kernel is light due to insufficient resources and does not provide advanced functions \(such as pagecache\). Therefore, the VFS of the LiteOS-M kernel implements only API standardization and adaptation. The file systems handle specific transactions. The following table lists the functions supported by the file systems. -**Table 1** Function list +**Table 1** Function list

Function

diff --git a/en/device-dev/kernel/kernel-mini-extend-support.md b/en/device-dev/kernel/kernel-mini-extend-support.md index e8cbd42d8c5d78cd423129b1a981d9572ab6588b..6b35ac452b7d0f01ba42d06836b4d02031447eb7 100644 --- a/en/device-dev/kernel/kernel-mini-extend-support.md +++ b/en/device-dev/kernel/kernel-mini-extend-support.md @@ -1,24 +1,16 @@ -# C++ Support +# C++ Support -- [Basic Concepts](#section11374125415814) -- [Working Principles](#section189351319134418) -- [Development Guidelines](#section166302407911) - - [Available APIs](#section1881825119919) - - [How to Develop](#section76371145108) - - [Development Example](#section994427141111) - - -## Basic Concepts +## Basic Concepts As one of the most widely used programming languages, C++ supports features, such as classes, encapsulation, and overloading. It is an object-oriented programming language developed based on the C language. -## Working Principles +## Working Principles The compiler supports C++ code identification. The system calls the constructors of global objects to perform initialization operations. -## Development Guidelines +## Development Guidelines -### Available APIs +### Available APIs **Table 1** APIs supported by C++ @@ -41,7 +33,7 @@ The compiler supports C++ code identification. The system calls the constructors
-### How to Develop +### How to Develop Before using C++ features, you need to call **LOS\_CppSystemInit** to initialize C++ constructors. The initialized constructors are stored in the **init\_array** section, and the section range is passed by the variables **\_\_init\_array\_start\_\_** and **\_\_init\_array\_end\_\_**. @@ -70,7 +62,7 @@ Before using C++ features, you need to call **LOS\_CppSystemInit** to initiali >![](../public_sys-resources/icon-note.gif) **NOTE:** >The **LOS\_CppSystemInit** function must be called before a C++ service. When the C library used by the third-party compiler is not musl libc, some classes or APIs \(such as **std::thread** and **std::mutex**\) that are closely related to system resources have compatibility issues and are not recommended to use. -### Development Example +### Development Example ``` void app_init(void) diff --git a/en/device-dev/kernel/kernel-mini-extend.md b/en/device-dev/kernel/kernel-mini-extend.md index 96e3fe5ea4dabb1bf3891a04feb36f1602fe2b01..c59d1ca62675a1e7f36b2b94af272253ffd36d44 100644 --- a/en/device-dev/kernel/kernel-mini-extend.md +++ b/en/device-dev/kernel/kernel-mini-extend.md @@ -1,4 +1,4 @@ -# Extended Components +# Extended Components - **[C++ Support](kernel-mini-extend-support.md)** diff --git a/en/device-dev/kernel/kernel-mini-memory-debug-cet.md b/en/device-dev/kernel/kernel-mini-memory-debug-cet.md index ead21236f35840fa2ed6fa1d1517be4b9d14b853..3327c4a4eff7944024d7fe8b7eceb6158dd56eda 100644 --- a/en/device-dev/kernel/kernel-mini-memory-debug-cet.md +++ b/en/device-dev/kernel/kernel-mini-memory-debug-cet.md @@ -1,19 +1,13 @@ -# Memory Corruption Check +# Memory Corruption Check -- [Basic Concepts](#section17368154517335) -- [Function Configuration](#section4696190123420) -- [Development Guidelines](#section672362973417) - - [How to Develop](#section026014863416) - - [Development Example](#section186311302356) - - [Sample Code](#section12709533354) - - [Verification](#section81214126369) -## Basic Concepts + +## Basic Concepts As an optional function of the kernel, memory corruption check is used to check the integrity of a dynamic memory pool. This mechanism can detect memory corruption errors in the memory pool in a timely manner and provide alerts. It helps reduce problem locating costs and increase troubleshooting efficiency. -## Function Configuration +## Function Configuration **LOSCFG\_BASE\_MEM\_NODE\_INTEGRITY\_CHECK**: specifies the setting of the memory corruption check. This function is disabled by default. To enable the function, set this macro to **1** in **target\_config.h**. @@ -25,13 +19,13 @@ This check only detects the corrupted memory node and provides information about >![](../public_sys-resources/icon-caution.gif) **CAUTION:** >If memory corruption check is enabled, a magic number is added to the node header, which increases the size of the node header. The real-time integrity check has a great impact on the performance. In performance-sensitive scenarios, you are advised to disable this function and use **LOS\_MemIntegrityCheck** to check the memory pool integrity. -## Development Guidelines +## Development Guidelines -### How to Develop +### How to Develop Check for memory corruption by calling **LOS\_MemIntegrityCheck**. If no memory corruption occurs, **0** is returned and no log is output. If memory corruption occurs, related log is output. For details, see the output of the following example. -### Development Example +### Development Example This example implements the following: @@ -39,7 +33,7 @@ This example implements the following: 2. Call **memset** to construct an out-of-bounds access and overwrites the first four bytes of the next node. 3. Call **LOS\_MemIntegrityCheck** to check whether memory corruption occurs. -### Sample Code +### Sample Code The sample code is as follows: @@ -60,7 +54,7 @@ void MemIntegrityTest(void) } ``` -### Verification +### Verification The log is as follows: diff --git a/en/device-dev/kernel/kernel-mini-imemory-debug-det.md b/en/device-dev/kernel/kernel-mini-memory-debug-det.md similarity index 86% rename from en/device-dev/kernel/kernel-mini-imemory-debug-det.md rename to en/device-dev/kernel/kernel-mini-memory-debug-det.md index c3fc32bd9e156b1c8c7dcd495e97306914c7ef5d..c37ab8f1cc79a886064cb53e213abce8a858ea0e 100644 --- a/en/device-dev/kernel/kernel-mini-imemory-debug-det.md +++ b/en/device-dev/kernel/kernel-mini-memory-debug-det.md @@ -1,19 +1,10 @@ -# Memory Leak Check +# Memory Leak Check -- [Basic Concepts](#section1026719436293) -- [Function Configuration](#section13991354162914) -- [Development Guidelines](#section95828159308) - - [How to Develop](#section369844416304) - - [Development Example](#section460801313313) - - [Sample Code](#section96539275311) - - [Verification](#section20527343183119) - - -## Basic Concepts +## Basic Concepts As an optional function of the kernel, memory leak check is used to locate dynamic memory leak problems. After this function is enabled, the dynamic memory automatically records the link registers \(LRs\) used when memory is allocated. If a memory leak occurs, the recorded information helps locate the memory allocated for further analysis. -## Function Configuration +## Function Configuration 1. **LOSCFG\_MEM\_LEAKCHECK**: specifies the setting of the memory leak check. This function is disabled by default. To enable the function, set this macro to **1** in **target\_config.h**. 2. **LOSCFG\_MEM\_RECORD\_LR\_CNT**: number of LRs recorded. The default value is **3**. Each LR consumes the memory of **sizeof\(void \*\)** bytes. @@ -25,9 +16,9 @@ As an optional function of the kernel, memory leak check is used to locate dynam Correctly setting this macro can ignore invalid LRs and reduce memory consumption. -## Development Guidelines +## Development Guidelines -### How to Develop +### How to Develop Memory leak check provides a method to check for memory leak in key code logic. If this function is enabled, LR information is recorded each time when memory is allocated. When **LOS\_MemUsedNodeShow** is called before and after the code snippet is checked, information about all nodes that have been used in the specified memory pool is printed. You can compare the node information. The newly added node information indicates the node where the memory leak may occur. You can locate the code based on the LR and further check whether a memory leak occurs. @@ -43,10 +34,10 @@ node size LR[0] LR[1] LR[2] 0x100179cc: 0x5c 0x9b02c24e 0x9b02c246 0x9b008ef0 ``` ->![](../public_sys-resources/icon-caution.gif) **CAUTION:** +>![](../public_sys-resources/icon-caution.gif) **CAUTION**
>Enabling memory leak check affects memory application performance. LR addresses will be recorded for each memory node, increasing memory overhead. -### Development Example +### Development Example This example implements the following: @@ -56,7 +47,7 @@ This example implements the following: 4. Compare the logs to obtain information about the node where a memory leak occurred. 5. Locate the code based on the LR address. -### Sample Code +### Sample Code The sample code is as follows: @@ -75,7 +66,7 @@ void MemLeakTest(void) } ``` -### Verification +### Verification The log is as follows: diff --git a/en/device-dev/kernel/kernel-mini-memory-debug-mes.md b/en/device-dev/kernel/kernel-mini-memory-debug-mes.md index b0bcda96d99bca497c4fafc3a2e5930209ee17ac..ac38e0e6b12a385de47e0ef10b62d848aa701e13 100644 --- a/en/device-dev/kernel/kernel-mini-memory-debug-mes.md +++ b/en/device-dev/kernel/kernel-mini-memory-debug-mes.md @@ -1,15 +1,6 @@ -# Memory Information Statistics +# Memory Information Statistics -- [Basic Concepts](#section52691565235) -- [Function Configuration](#section470611682411) -- [Development Guidelines](#section9368374243) - - [How to Develop](#section679912407257) - - [Development Example](#section1025453412611) - - [Sample Code](#section165277971315) - - [Verification](#section3460102414271) - - -## Basic Concepts +## Basic Concepts Memory information includes the memory pool size, memory usage, remaining memory size, maximum free memory, memory waterline, number of memory nodes, and fragmentation rate. @@ -22,13 +13,13 @@ Memory information includes the memory pool size, memory usage, remaining memory - Other parameters: You can call APIs \(described in [Memory Management](kernel-mini-basic-memory-basic.md)\) to scan node information in the memory pool and collect statistics. -## Function Configuration +## Function Configuration **LOSCFG\_MEM\_WATERLINE**: specifies the setting of the memory information statistics function. This function is enabled by default. To disable the function, set this macro to **0** in **target\_config.h**. If you want to obtain the memory waterline, you must enable this macro. -## Development Guidelines +## Development Guidelines -### How to Develop +### How to Develop Key structure: @@ -52,7 +43,7 @@ typedef struct { Fragmentation rate = 100 – 100 x Maximum free memory block size/Remaining memory size -### Development Example +### Development Example This example implements the following: @@ -62,7 +53,7 @@ This example implements the following: 3. Calculate the memory usage and fragmentation rate. -### Sample Code +### Sample Code The sample code is as follows: @@ -107,7 +98,7 @@ int MemTest(void) } ``` -### Verification +### Verification The result is as follows: diff --git a/en/device-dev/kernel/kernel-mini-memory-debug.md b/en/device-dev/kernel/kernel-mini-memory-debug.md index 23495e1b92221cc3e8dd0565a6a001455acbed5c..623b9f36ff3183ce5dd1afad8cb18a46c97c115a 100644 --- a/en/device-dev/kernel/kernel-mini-memory-debug.md +++ b/en/device-dev/kernel/kernel-mini-memory-debug.md @@ -1,10 +1,10 @@ -# Memory Debugging +# Memory Debugging The purpose of memory debugging is to locate problems related to dynamic memory. The kernel provides a variety of memory debugging methods. Dynamic memory pool statistics helps you learn the memory pool waterline and fragmentation rate. Memory leak check helps you accurately locate the code where memory leak occurs and analyze the memory usage of each module. Memory corruption check helps you locate memory corruptions. - **[Memory Information Statistics](kernel-mini-memory-debug-mes.md)** -- **[Memory Leak Check](kernel-mini-imemory-debug-det.md)** +- **[Memory Leak Check](kernel-mini-memory-debug-det.md)** - **[Memory Corruption Check](kernel-mini-memory-debug-cet.md)** diff --git a/en/device-dev/kernel/kernel-mini-memory-exception.md b/en/device-dev/kernel/kernel-mini-memory-exception.md index bdbb43b4b1f9637a7167525c912f57c85dccbff9..a5fa385993177947d5884643fd3186cb65d2bfa8 100644 --- a/en/device-dev/kernel/kernel-mini-memory-exception.md +++ b/en/device-dev/kernel/kernel-mini-memory-exception.md @@ -1,18 +1,10 @@ -# Exception Debugging +# Exception Debugging -- [Basic Concepts](#section2741911123412) -- [Working Principles](#section16618124317346) -- [Available APIs](#section16111931351) -- [Usage Guidelines](#section16317163520350) - - [How to Develop](#section13457839133618) - - [How to Locate Exceptions](#section197332323815) - - -## Basic Concepts +## Basic Concepts The OpenHarmony LiteOS-M provides exception handling and debugging measures to help locate and analyze problems. Exception handling involves a series of actions taken by the OS to respond to exceptions occurred during the OS running, for example, printing the exception type, system status, call stack information of the current function, CPU information, and call stack information of tasks. -## Working Principles +## Working Principles A stack frame contains information such as function parameters, variables, and return value in a function call process. When a function is called, a stack frame of the subfunction is created, and the input parameters, local variables, and registers of the function are stored into the stack. Stack frames grow towards lower addresses. The ARM32 CPU architecture is used as an example. Each stack frame stores the historical values of the program counter \(PC\), LR \(link register\), stack pointer \(SP\), and frame pointer \(FP\) registers. The LR points to the return address of a function, and the FP points to the start address of the stack frame of the function's parent function. The FP helps locate the parent function's stack frame, which further helps locate the parent function's FP. The parent function's FP helps locate the grandparent function's stack frame and FP... In this way, the call stack of the program can be traced to obtain the relationship between the functions called. @@ -20,12 +12,12 @@ When an exception occurs in the system, the system prints the register informati The following figure illustrates the stack analysis mechanism for your reference. The actual stack information varies depending on the CPU architecture. -**Figure 1** Stack analysis mechanism +**Figure 1** Stack analysis mechanism ![](figures/stack-analysis-mechanism.png "stack-analysis-mechanism") In the figure, the registers in different colors indicate different functions. The registers save related data when functions are called. The FP register helps track the stack to the parent function of the abnormal function and further presents the relationships between the functions called. -## Available APIs +## Available APIs The following table describes APIs available for the OpenHarmony LiteOS-M stack trace module. For more details about the APIs, see the API reference. @@ -55,9 +47,9 @@ The following table describes APIs available for the OpenHarmony LiteOS-M stack -## Usage Guidelines +## Usage Guidelines -### How to Develop +### How to Develop The typical process for enabling exception debugging is as follows: @@ -262,7 +254,7 @@ The typical process for enabling exception debugging is as follows: ``` -### How to Locate Exceptions +### How to Locate Exceptions The procedure for locating the exception is as follows: diff --git a/en/device-dev/kernel/kernel-mini-memory-lms.md b/en/device-dev/kernel/kernel-mini-memory-lms.md index 1508f028691103ef327dcfa6afdb987195aab0f5..afce67ceeabce8acadfd993eebd32f7e968280b9 100644 --- a/en/device-dev/kernel/kernel-mini-memory-lms.md +++ b/en/device-dev/kernel/kernel-mini-memory-lms.md @@ -1,16 +1,6 @@ -# LMS +# LMS -- [Basic Concepts](#section7605453104815) -- [Working Principles](#section8495832174910) -- [Available APIs](#section05501853194918) -- [Development Guidelines](#section177357243510) - - [How to Develop](#section125863345112) - - [Development Example](#section812115715313) - - [Sample Code](#section614842310538) - - [Verification](#section980212293548) - - -## Basic Concepts +## Basic Concepts Lite Memory Sanitizer \(LMS\) is a tool used to detect memory errors on a real-time basis. LMS can detect buffer overflow, Use-After-Free \(UAF\), and double free errors in real time, and notify the operating system immediately. Together with locating methods such as Backtrace, LMS can locate the code line that causes the memory error. It greatly improves the efficiency of locating memory errors. @@ -21,7 +11,7 @@ The LMS module of the OpenHarmony LiteOS-M kernel provides the following functio - Checks the memory when bounds-checking functions are called \(enabled by default\). - Checks the memory when libc frequently accessed functions, including **memset**, **memcpy**, **memmove**, **strcat**, **strcpy**, **strncat** and **strncpy**, are called. -## Working Principles +## Working Principles LMS uses shadow memory mapping to mark the system memory state. There are three states: **Accessible**, **RedZone**, and **Freed**. The shadow memory is located in the tail of the memory pool. @@ -30,7 +20,7 @@ LMS uses shadow memory mapping to mark the system memory state. There are three - During code compilation, a function is inserted before the read/write instructions in the code to check the address validity. The tool checks the state value of the shadow memory that accesses the memory. If the shadow memory is in the **RedZone** statue, an overflow error will be reported. If the shadow memory is in the **Freed** state, a UAF error will be reported. - When memory is released, the tool checks the state value of the shadow memory at the released address. If the shadow memory is in the **RedZone** state, a double free error will be reported. -## Available APIs +## Available APIs The LMS module of the OpenHarmony LiteOS-M kernel provides the following APIs. For more details about the APIs, see the [API](https://gitee.com/openharmony/kernel_liteos_m/blob/master/components/lms/los_lms.h) reference. @@ -76,9 +66,9 @@ The LMS module of the OpenHarmony LiteOS-M kernel provides the following APIs. F -## Development Guidelines +## Development Guidelines -### How to Develop +### How to Develop The typical process for enabling LMS is as follows: @@ -173,7 +163,7 @@ The typical process for enabling LMS is as follows: 3. Recompile the code and check the serial port output. The memory problem detected will be displayed. -### Development Example +### Development Example This example implements the following: @@ -181,7 +171,7 @@ This example implements the following: 2. Construct a buffer overflow error and a UAF error. 3. Add "-fsanitize=kernel-address", execute the compilation, and check the output. -### Sample Code +### Sample Code The code is as follows: @@ -240,7 +230,7 @@ UINT32 Example_Lms_test(VOID){ } ``` -### Verification +### Verification The output is as follows: diff --git a/en/device-dev/kernel/kernel-mini-memory-perf.md b/en/device-dev/kernel/kernel-mini-memory-perf.md index 5d20af7b12d138286132a2c1b726197229c62b04..3da1dd5dc276a844ed393af9b7d73bed23a4b767 100644 --- a/en/device-dev/kernel/kernel-mini-memory-perf.md +++ b/en/device-dev/kernel/kernel-mini-memory-perf.md @@ -1,28 +1,11 @@ -# perf +# perf -- [Basic Concepts](#section531482192018) -- [Working Principles](#section5125124532010) -- [Available APIs](#section17747184017458) - - [Kernel Mode](#section104473014465) - - [User Mode](#section1996920294531) -- [Development Guidelines](#section10302175017543) - - [Kernel-mode Development Process](#section04021008552) - -- [Kernel-mode Development Example](#section112034213583) -- [Kernel-mode Sample Code](#section10348549155812) - - [Kernel-mode Verification](#section61719481795) - - [User-mode Development Process](#section1425821711114) - - [User-mode Development Example](#section3470546163) - - [User-Mode Sample Code](#section183253286161) - - [User-mode Verification](#section5665123516214) - - -## Basic Concepts +## Basic Concepts perf is a performance analysis tool. It uses the performance monitoring unit \(PMU\) to count sampling events and collect context information and provides hot spot distribution and hot paths. -## Working Principles +## Working Principles When a performance event occurs, the corresponding event counter overflows and triggers an interrupt. The interrupt handler records the event information, including the current PC, task ID, and call stack. @@ -30,9 +13,9 @@ perf provides two working modes: counting mode and sampling mode. In counting mode, perf collects only the number of event occurrences and duration. In sampling mode, perf also collects context data and stores the data in a circular buffer. The IDE then analyzes the data and provides information about hotspot functions and paths. -## Available APIs +## Available APIs -### Kernel Mode +### Kernel Mode The perf module of the OpenHarmony LiteOS-A kernel provides the following APIs. For more details about the APIs, see the [API](https://gitee.com/openharmony/kernel_liteos_a/blob/master/kernel/include/los_perf.h) reference. @@ -117,7 +100,7 @@ The perf module of the OpenHarmony LiteOS-A kernel provides the following APIs. The API for flushing the cache is configured based on the platform. -### User Mode +### User Mode The perf character device is located in **/dev/perf**. You can read, write, and control the user-mode perf by running the following commands on the device node: @@ -134,11 +117,11 @@ The perf character device is located in **/dev/perf**. You can read, write, and The operations correspond to **LOS\_PerfStart** and **LOS\_PerfStop**. -For more details, see [User-mode Development Example](#section3470546163). +For more details, see [User-mode Development Example](#user-mode-development-example). -## Development Guidelines +## Development Guidelines -### Kernel-mode Development Process +### Kernel-mode Development Process The typical process of enabling perf is as follows: @@ -235,7 +218,7 @@ The typical process of enabling perf is as follows: 4. Call **LOS\_PerfStop** at the end of the code to be sampled. 5. Call **LOS\_PerfDataRead** to read the sampling data and use IDE to analyze the collected data. -## Kernel-mode Development Example +## Kernel-mode Development Example This example implements the following: @@ -246,7 +229,7 @@ This example implements the following: 5. Stop perf. 6. Export the result. -## Kernel-mode Sample Code +## Kernel-mode Sample Code Prerequisites: The perf module configuration is complete in **menuconfig**. @@ -333,7 +316,7 @@ UINT32 Example_Perf_test(VOID){ LOS_MODULE_INIT(perfTestHwEvent, LOS_INIT_LEVEL_KMOD_EXTENDED); ``` -### Kernel-mode Verification +### Kernel-mode Verification The output is as follows: @@ -362,7 +345,7 @@ hex: 00 ef ef ef 00 00 00 00 14 00 00 00 60 00 00 00 00 00 00 00 70 88 36 40 08 You can also call **LOS\_PerfDataRead** to read data to a specified address for further analysis. In the example, **OsPrintBuff** is a test API, which prints the sampled data by byte. **num** indicates the sequence number of the byte, and **hex** indicates the value in the byte. -### User-mode Development Process +### User-mode Development Process Choose **Driver** \> **Enable PERF DRIVER** in **menuconfig** to enable the perf driver. This option is available in **Driver** only after **Enable Perf Feature** is selected in the kernel. @@ -440,10 +423,10 @@ time used: 0.059000(s) save perf data success at /storage/data/perf.data ``` ->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](../public_sys-resources/icon-note.gif) **NOTE**
>After running the **./perf stat/record** command, you can run the **./perf start** and **./perf stop** commands multiple times. The sampling event configuration is as per the parameters set in the latest **./perfstat/record** command. -### User-mode Development Example +### User-mode Development Example This example implements the following: @@ -453,7 +436,7 @@ This example implements the following: 4. Stop perf. 5. Read the perf sampling data. -### User-Mode Sample Code +### User-Mode Sample Code The code is as follows: @@ -523,7 +506,7 @@ int main(int argc, char **argv) } ``` -### User-mode Verification +### User-mode Verification The output is as follows: diff --git a/en/device-dev/kernel/kernel-mini-memory-trace.md b/en/device-dev/kernel/kernel-mini-memory-trace.md index bd9b0553e9fe8efa2c220f95666deef2708604c2..1417442602eee705b8541acd9547f3dd55267d23 100644 --- a/en/device-dev/kernel/kernel-mini-memory-trace.md +++ b/en/device-dev/kernel/kernel-mini-memory-trace.md @@ -1,20 +1,10 @@ -# Trace +# Trace -- [Basic Concepts](#section44851752123712) -- [Working Principles](#section5282148123813) -- [Available APIs](#section16304193215387) -- [Development Guidelines](#section498695853819) - - [How to Develop](#section1875652316393) - - [Development Example](#section0403134913395) - - [Sample Code](#section1492711418400) - - [Verification](#section869613984012) - - -## Basic Concepts +## Basic Concepts Trace helps you learn about the kernel running process and the execution sequence of modules and tasks. With the information, you can better understand the code running process of the kernel and locate time sequence problems. -## Working Principles +## Working Principles The kernel provides a hook framework to embed hooks in the main process of each module. In the initial startup phase of the kernel, the trace function is initialized and the trace handlers are registered with the hooks. @@ -28,7 +18,7 @@ In offline mode, trace frames are stored in a circular buffer. If too many frame The online mode must be used with the integrated development environment \(IDE\). Trace frames are sent to the IDE in real time. The IDE parses the records and displays them in a visualized manner. -## Available APIs +## Available APIs The trace module of the OpenHarmony LiteOS-M kernel provides the following functions. For more details about the APIs, see the API reference. @@ -178,9 +168,9 @@ The trace module of the OpenHarmony LiteOS-M kernel provides the following funct The interrupt events with interrupt ID of **TIMER\_INT** or **DMA\_INT** are not traced. -## Development Guidelines +## Development Guidelines -### How to Develop +### How to Develop The typical trace process is as follows: @@ -271,7 +261,7 @@ The methods in steps 3 to 7 are encapsulated with shell commands. After the shel - LOS\_TraceStop —— trace\_stop - LOS\_TraceRecordDump —— trace\_dump -### Development Example +### Development Example This example implements the following: @@ -281,7 +271,7 @@ This example implements the following: 4. Stop trace. 5. Output trace data in the specified format. -### Sample Code +### Sample Code The sample code is as follows: @@ -330,7 +320,7 @@ UINT32 Example_Trace_test(VOID){ } ``` -### Verification +### Verification The output is as follows: diff --git a/en/device-dev/kernel/kernel-mini-overview.md b/en/device-dev/kernel/kernel-mini-overview.md index c960444afb9c9596cf6689637701228e34e303ac..3ff627c00e0d0569b018b1a15a4113632cc2e7b7 100644 --- a/en/device-dev/kernel/kernel-mini-overview.md +++ b/en/device-dev/kernel/kernel-mini-overview.md @@ -1,20 +1,15 @@ -# Kernel Overview +# Kernel Overview -- [Overview](#section1429342661510) - - [CPU Architecture Support](#section48891456112819) - - [Working Principles](#section4599142312817) - - -## Overview +## Overview The OpenHarmony LiteOS-M kernel is a lightweight operating system \(OS\) kernel designed for the IoT field. It features small size, low power consumption, and high performance. The LiteOS-M kernel has simple code structure, including the minimum function set, kernel abstraction layer \(KAL\), optional components, and project directory. It supports the Hardware Driver Foundation \(HDF\), which provides unified driver standards and access mode for device vendors to simplify porting of drivers and allow one-time development for multi-device deployment. The OpenHarmony LiteOS-M kernel architecture consists of the hardware layer and hardware-irrelevant layers, as shown in [Figure 1](#fig1287712172318). The hardware layer is classified based on the compiler toolchain and chip architecture, and provides a unified Hardware Abstraction Layer \(HAL\) interface to improve hardware adaptation and facilitate the expansion of various types of AIoT hardware and compilation toolchains. The other modules are irrelevant to the hardware. The basic kernel module provides basic kernel capabilities. The extended modules provide capabilities of components, such as the network and file systems, as well as exception handling and debug tools. The KAL provides unified standard APIs. -**Figure 1** Kernel architecture +**Figure 1** Kernel architecture ![](figures/kernel-architecture.png "kernel-architecture") -### CPU Architecture Support +### CPU Architecture Support The CPU architecture includes two layers: general architecture definition layer and specific architecture definition layer. The former provides interfaces supported and implemented by all architectures. The latter is specific to an architecture. For a new architecture to be added, the general architecture definition layer must be implemented first and the architecture-specific functions can be implemented at the specific architecture definition layer. @@ -55,10 +50,10 @@ The CPU architecture includes two layers: general architecture definition layer LiteOS-M supports mainstream architectures, such as ARM Cortex-M3, ARM Cortex-M4, ARM Cortex-M7, ARM Cortex-M33, and RISC-V. If you need to expand the CPU architecture, see [Chip Architecture Adaptation](../porting/porting-chip-kernel-overview.md#section137431650339). -### Working Principles +### Working Principles Configure the system clock and number of ticks per second in the **target\_config.h** file of the development board. Configure the task, memory, inter-process communication \(IPC\), and exception handling modules based on service requirements. When the system boots, the modules are initialized based on the configuration. The kernel startup process includes peripheral initialization, system clock configuration, kernel initialization, and OS boot. For details, see [Figure 2](#fig74259220441). -**Figure 2** Kernel startup process +**Figure 2** Kernel startup process ![](figures/kernel-startup-process.png "kernel-startup-process") diff --git a/en/device-dev/kernel/kernel-mini.md b/en/device-dev/kernel/kernel-mini.md index 8239d9975cfac2e4085380f1ddf2670f567578d2..16f0e597cd0e2d2ba5e928657545d62ae243c22b 100644 --- a/en/device-dev/kernel/kernel-mini.md +++ b/en/device-dev/kernel/kernel-mini.md @@ -1,4 +1,4 @@ -# Kernel for the Mini System +# Mini-System Kernel - **[Kernel Overview](kernel-mini-overview.md)** @@ -10,4 +10,3 @@ - **[Appendix](kernel-mini-app.md)** - diff --git a/en/device-dev/kernel/kernel-small-apx-bitwise.md b/en/device-dev/kernel/kernel-small-apx-bitwise.md index ffeae41515eac857df100180c8c002633d747971..a3760fc0c586a410de798654e2d4c3f75c2c39ce 100644 --- a/en/device-dev/kernel/kernel-small-apx-bitwise.md +++ b/en/device-dev/kernel/kernel-small-apx-bitwise.md @@ -1,13 +1,8 @@ -# Bitwise Operation +# Bitwise Operation -- [Basic Concepts](#section1990715203418) -- [Available APIs](#section848334511411) -- [Development Example](#section67569495514) - - [Example Description](#section33551554391) - - [Verification](#section8931859194) -## Basic Concepts +## Basic Concepts A bitwise operation operates on a binary number at the level of its individual bits. For example, a variable can be set as a program status word \(PSW\), and each bit \(flag bit\) in the PSW can have a self-defined meaning. @@ -110,7 +105,7 @@ static UINT32 BitSample(VOID) } ``` -### Verification +### Verification The development is successful if the return result is as follows: diff --git a/en/device-dev/kernel/kernel-small-apx-dll.md b/en/device-dev/kernel/kernel-small-apx-dll.md index 7862c000c87443d6ecf927fd4432166801a033a1..2e7bb0d0fadcf92e14ea957b89728e240542c18a 100644 --- a/en/device-dev/kernel/kernel-small-apx-dll.md +++ b/en/device-dev/kernel/kernel-small-apx-dll.md @@ -1,16 +1,12 @@ -# Doubly Linked List +# Doubly Linked List -- [Basic Concepts](#section1990715203418) -- [Available APIs](#section848334511411) -- [How to Develop](#section01781261552) - - [Development Example](#section8354175218128) -## Basic Concepts +## Basic Concepts A doubly linked list is a linked data structure that consists of a set of sequentially linked records called nodes. Each node contains a pointer to the previous node and a pointer to the next node in the sequence of nodes. The pointer head is unique. A doubly linked list allows access from a list node to its next node and also the previous node on the list. This data structure facilitates data search, especially traversal of a large amount of data. The symmetry of the doubly linked list also makes operations, such as insertion and deletion, easy. However, pay attention to the pointer direction when performing operations. -## Available APIs +## Available APIs The following table describes APIs available for the doubly linked list. For more details about the APIs, see the API reference. diff --git a/en/device-dev/kernel/kernel-small-apx-library.md b/en/device-dev/kernel/kernel-small-apx-library.md index ffba0b91f7385c047d5d51b9e5b6072b69e94c01..c99d339880983a28403409a2caf157a20875c47b 100644 --- a/en/device-dev/kernel/kernel-small-apx-library.md +++ b/en/device-dev/kernel/kernel-small-apx-library.md @@ -1,18 +1,9 @@ -# Standard Library - -- [Standard Library API Framework](#section149319478561) -- [Development Example](#section20874620185915) -- [Differences from the Linux Standard Library](#section6555642165713) - - [Process](#section11299104511409) - - [Memory](#section175754484116) - - [File System](#section118191113134220) - - [Signal](#section195939264421) - - [Time](#section20825124304213) +# Standard Library The OpenHarmony kernel uses the musl libc library that supports the Portable Operating System Interface \(POSIX\). You can develop components and applications working on the kernel based on the POSIX. -## Standard Library API Framework +## Standard Library API Framework **Figure 1** POSIX framework ![](figures/posix-framework.png "posix-framework") @@ -21,7 +12,7 @@ The musl libc library supports POSIX standards. The OpenHarmony kernel adapts th For details about the APIs supported by the standard library, see the API document of the C library, which also covers the differences between the standard library and the POSIX standard library. -## Development Example +## Development Example In this example, the main thread creates **THREAD\_NUM** child threads. Once a child thread is started, it enters the standby state. After the main thread successfully wakes up all child threads, they continue to execute until the lifecycle ends. The main thread uses the **pthread\_join** method to wait until all child threads are executed. @@ -197,17 +188,17 @@ int main(int argc, char *argv[]) #endif /* __cplusplus */ ``` -## Differences from the Linux Standard Library +## Differences from the Linux Standard Library This section describes the key differences between the standard library carried by the OpenHarmony kernel and the Linux standard library. For more differences, see the API document of the C library. -### Process +### Process 1. The OpenHarmony user-mode processes support only static priorities, which range from 10 \(highest\) to 31 \(lowest\). 2. The OpenHarmony user-mode threads support only static priorities, which range from 0 \(highest\) to 31 \(lowest\). 3. The OpenHarmony process scheduling supports **SCHED\_RR** only, and thread scheduling supports **SCHED\_RR** or **SCHED\_FIFO**. -### Memory +### Memory **h2****Difference with Linux mmap** @@ -266,7 +257,7 @@ int main(int argc, char *argv[]) } ``` -### File System +### File System **System directories**: You cannot modify system directories and device mount directories, which include **/dev**, **/proc**, **/app**, **/bin**, **/data**, **/etc**, **/lib**, **/system** and **/usr**. @@ -274,14 +265,14 @@ int main(int argc, char *argv[]) Except in the system and user directories, you can create directories and mount devices. Note that nested mount is not allowed, that is, a mounted folder and its subfolders cannot be mounted repeatedly. A non-empty folder cannot be mounted. -### Signal +### Signal - The default behavior for signals does not include **STOP**, **CONTINUE**, or **COREDUMP**. - A sleeping process \(for example, a process enters the sleeping status by calling the sleep function\) cannot be woken up by a signal. The signal mechanism does not support the wakeup function. The behavior for a signal can be processed only when the process is scheduled by the CPU. - After a process exits, **SIGCHLD** is sent to the parent process. The sending action cannot be canceled. - Only signals 1 to 30 are supported. The callback is executed only once even if the same signal is received multiple times. -### Time +### Time The OpenHarmony time precision is based on tick. The default value is 10 ms/tick. The time error of the **sleep** and **timeout** functions is less than or equal to 20 ms. diff --git a/en/device-dev/kernel/kernel-small-apx-structure.md b/en/device-dev/kernel/kernel-small-apx-structure.md index 7e27b4cea1df8c36fdfc218b8d5fc9919dde5e44..79d704c39b2d73f29bf804b24464c35aa8b18a6c 100644 --- a/en/device-dev/kernel/kernel-small-apx-structure.md +++ b/en/device-dev/kernel/kernel-small-apx-structure.md @@ -1,4 +1,4 @@ -# Basic Data Structure +# Basic Data Structure - **[Doubly Linked List](kernel-small-apx-dll.md)** diff --git a/en/device-dev/kernel/kernel-small-apx.md b/en/device-dev/kernel/kernel-small-apx.md index 4855425ba469d0f00f1c7e9539d3622ba16e6fa6..1f6a972e95f1dbe1cb18c612b4f813fc3c90517b 100644 --- a/en/device-dev/kernel/kernel-small-apx.md +++ b/en/device-dev/kernel/kernel-small-apx.md @@ -1,4 +1,4 @@ -# Appendix +# Appendix - **[Basic Data Structure](kernel-small-apx-structure.md)** diff --git a/en/device-dev/kernel/kernel-small-basic-atomic.md b/en/device-dev/kernel/kernel-small-basic-atomic.md index 6ab30f5b86ec8e8d8c2b9f034b5592cfd800fd26..12045b51bfb493d204ddde26a55c9f8bc29a28d7 100644 --- a/en/device-dev/kernel/kernel-small-basic-atomic.md +++ b/en/device-dev/kernel/kernel-small-basic-atomic.md @@ -1,14 +1,7 @@ -# Atomic Operation +# Atomic Operation -- [Basic Concepts](#section1792118384594) -- [Working Principles](#section1786635117596) -- [Development Guidelines](#section2911115308) - - [Available APIs](#section335914201010) - - [How to Develop](#section12207371304) - - [Development Example](#section8538651511) - -## Basic Concepts +## Basic Concepts In an OS that supports multiple tasks, modifying data in a memory area requires three steps: read data, modify data, and write data. However, data in a memory area may be simultaneously accessed by multiple tasks. If the data modification is interrupted by another task, the execution result of the operation is unpredictable. @@ -16,7 +9,7 @@ Although you can enable or disable interrupts to ensure that the multi-task exec The ARMv6 architecture has introduced the **LDREX** and **STREX** instructions to support more discreet non-blocking synchronization of the shared memory. The atomic operations implemented thereby can ensure that the "read-modify-write" operations on the same data will not be interrupted, that is, the operation atomicity is ensured. -## Working Principles +## Working Principles The OpenHarmony system has encapsulated the **LDREX** and **STREX** in the ARMv6 architecture to provide a set of atomic operation APIs. @@ -45,9 +38,9 @@ The OpenHarmony system has encapsulated the **LDREX** and **STREX** in the A - If the flag register is **1**, the system continues the loop and performs the atomic operation again. -## Development Guidelines +## Development Guidelines -### Available APIs +### Available APIs The following table describes the APIs available for the OpenHarmony LiteOS-A kernel atomic operation module. For more details about the APIs, see the API reference. @@ -197,11 +190,11 @@ The following table describes the APIs available for the OpenHarmony LiteOS-A ke -### How to Develop +### How to Develop When multiple tasks perform addition, subtraction, and swap operations on the same memory data, use atomic operations to ensure predictability of results. ->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](../public_sys-resources/icon-note.gif) **NOTE**
>Atomic operation APIs support only integer data. ### Development Example diff --git a/en/device-dev/kernel/kernel-small-basic-inner-reflect.md b/en/device-dev/kernel/kernel-small-basic-inner-reflect.md index e98b00d36193ce7a80f1ccb1cfc27671207e7c89..a90d63bcfb05ea1e78e3620fbd8fc0cd5334defe 100644 --- a/en/device-dev/kernel/kernel-small-basic-inner-reflect.md +++ b/en/device-dev/kernel/kernel-small-basic-inner-reflect.md @@ -1,20 +1,14 @@ -# Virtual-to-Physical Mapping +# Virtual-to-Physical Mapping -- [Basic Concepts](#section9108144913615) -- [Working Principles](#section12392621871) -- [Development Guidelines](#section10264102013713) - - [Available APIs](#section195320251578) - - [How to Develop](#section152774210712) - -## Basic Concepts +## Basic Concepts The Memory Management Unit \(MMU\) is used to map the virtual addresses in the process space and the actual physical addresses and specify corresponding access permissions and cache attributes. When a program is executed, the CPU accesses the virtual memory, locates the corresponding physical memory based on the MMU page table entry, and executes the code or performs data read/write operations. The page tables of the MMU store the mappings between virtual and physical addresses and the access permission. A page table is created when each process is created. The page table contains page table entries \(PTEs\), and each PTE describes a mapping between a virtual address region and a physical address region. The MMU has a Translation Lookaside Buffer \(TLB\) for address translation. During address translation, the MMU first searches the TLB for the corresponding PTE. If a match is found, the address can be returned directly. The following figure illustrates how the CPU accesses the memory or peripherals. -**Figure 1** CPU accessing the memory or peripheral +**Figure 1** CPU accessing the memory or peripheral ![](figures/cpu-accessing-the-memory-or-peripheral.png "cpu-accessing-the-memory-or-peripheral") -## Working Principles +## Working Principles Virtual-to-physical address mapping is a process of establishing page tables. The MMU supports multi-level page tables. The LiteOS-A kernel uses the level-2 page tables to describe the process space. Each level-1 PTE descriptor occupies 4 bytes, which indicate a mapping record of 1 MiB memory space. The 1 GiB user space of the LiteOS-A kernel has 1024 level-1 PTEs. When a user process is created, a 4 KiB memory block is requested from the memory as the storage area of the level-1 page table. Memory is dynamically allocated for the level-2 page table based on requirements of the process. @@ -22,12 +16,12 @@ Virtual-to-physical address mapping is a process of establishing page tables. Th - When the program is executed, as shown by the bold arrow in the following figure, the CPU accesses the virtual address and checks for the corresponding physical memory in the MMU. If the virtual address does not have the corresponding physical address, a page missing fault is triggered. The kernel requests the physical memory, writes the virtual-physical address mapping and the related attributes to the page table, and caches the PTE in the TLB. Then, the CPU can directly access the actual physical memory. - If the PTE already exists in the TLB, the CPU can access the physical memory without accessing the page table stored in the memory. -**Figure 2** CPU accessing the memory +**Figure 2** CPU accessing the memory ![](figures/cpu-accessing-the-memory.png "cpu-accessing-the-memory") -## Development Guidelines +## Development Guidelines -### Available APIs +### Available APIs **Table 1** APIs of the virtual-to-physical address mapping module @@ -70,7 +64,7 @@ Virtual-to-physical address mapping is a process of establishing page tables. Th -### How to Develop +### How to Develop To use virtual-to-physical address mapping APIs: @@ -83,6 +77,6 @@ To use virtual-to-physical address mapping APIs: 3. Call **LOS\_ArchMmuUnmap** to remove the mapping. ->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](../public_sys-resources/icon-note.gif) **NOTE**
>The preceding APIs can be used after the MMU initialization is complete and the page tables of the related process are created. The MMU initialization is complete during system startup, and page tables are created when the processes are created. You do not need to perform any operation. diff --git a/en/device-dev/kernel/kernel-small-basic-interrupt.md b/en/device-dev/kernel/kernel-small-basic-interrupt.md index d7e0c6a695d5737427c6c8c331e84d4b9585fe13..b84a71b17ddd6c99f9278514a7c514bfc4bc5781 100644 --- a/en/device-dev/kernel/kernel-small-basic-interrupt.md +++ b/en/device-dev/kernel/kernel-small-basic-interrupt.md @@ -1,12 +1,4 @@ -# Interrupt and Exception Handling - -- [Basic Concepts](#section439816296117) -- [Working Principles](#section2792838318) -- [Development Guidelines](#section15415165510110) - - [Available APIs](#section57441612024) - - [How to Develop](#section64332181221) - - [Development Example](#section204698276478) - - [Verification](#section1466144215476) +# Interrupt and Exception Handling ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-basic-memory-heap.md b/en/device-dev/kernel/kernel-small-basic-memory-heap.md index cb1745a27b45cc85968922293683f05a1274dff5..07750dbbc3ec0d3768f675149b050dccd02274f3 100644 --- a/en/device-dev/kernel/kernel-small-basic-memory-heap.md +++ b/en/device-dev/kernel/kernel-small-basic-memory-heap.md @@ -1,13 +1,4 @@ -# Heap Memory Management - -- [Basic Concepts](#section449414395916) -- [Working Principles](#section465085575911) -- [Development Guidelines](#section577019272015) - - [When to Use](#section326917198583) - - [Available APIs](#section1032331584) - - [How to Develop](#section07271773592) - - [Development Example](#section84931234145913) - - [Verification](#section165233233917) +# Heap Memory Management ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-basic-memory-physical.md b/en/device-dev/kernel/kernel-small-basic-memory-physical.md index cb47d9ba6408e3a9cca816949e162a5676192af1..8369ea50799c91e9a07c154a0c7e5d0afe454cc6 100644 --- a/en/device-dev/kernel/kernel-small-basic-memory-physical.md +++ b/en/device-dev/kernel/kernel-small-basic-memory-physical.md @@ -1,12 +1,4 @@ -# Physical Memory Management - -- [Basic Concepts](#section210891719217) -- [Working Principles](#section111355315213) -- [Development Guidelines](#section393116496217) - - [Available APIs](#section13210155619214) - - [How to Develop](#section178441091231) - - [Development Example](#section1258174015319) - - [Verification](#section515091342819) +# Physical Memory Management ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-basic-memory-virtual.md b/en/device-dev/kernel/kernel-small-basic-memory-virtual.md index f5fa060ecb1bfa877c6b74f8fe069dc3b3be58f7..1c3b440fd5ecc5741b2cad1a49ef59b90d9082aa 100644 --- a/en/device-dev/kernel/kernel-small-basic-memory-virtual.md +++ b/en/device-dev/kernel/kernel-small-basic-memory-virtual.md @@ -1,10 +1,4 @@ -# Virtual Memory Management - -- [Basic Concepts](#section650193717411) -- [Working Principles](#section072885512412) -- [Development Guidelines](#section20956116050) - - [Available APIs](#section166137221657) - - [How to Develop](#section8752103914513) +# Virtual Memory Management ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-basic-memory.md b/en/device-dev/kernel/kernel-small-basic-memory.md index ebe667d5bc9b8b81b1d916ab03ce151a9bac4c94..b023754cfe8ae8a219693e6cdbfc66dc5ef595a6 100644 --- a/en/device-dev/kernel/kernel-small-basic-memory.md +++ b/en/device-dev/kernel/kernel-small-basic-memory.md @@ -1,4 +1,4 @@ -# Memory Management +# Memory Management - **[Heap Memory Management](kernel-small-basic-memory-heap.md)** diff --git a/en/device-dev/kernel/kernel-small-basic-process-process.md b/en/device-dev/kernel/kernel-small-basic-process-process.md index bc06994143d0e0376d64f25a3274bbf74138aa64..413951926be6282146304660a198bc0546014067 100644 --- a/en/device-dev/kernel/kernel-small-basic-process-process.md +++ b/en/device-dev/kernel/kernel-small-basic-process-process.md @@ -1,10 +1,4 @@ -# Process - -- [Basic Concepts](#section89346055119) -- [Working Principles](#section174514474512) -- [Development Guidelines](#section159637182521) - - [Available APIs](#section1153124135212) - - [How to Develop](#section1533674618526) +# Process ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-basic-process-scheduler.md b/en/device-dev/kernel/kernel-small-basic-process-scheduler.md index 32892cb91e9a795325fdc9da2db0f44796a3c9a9..fdd199036e7bcb51cbdd57e52bdce0b273fec998 100644 --- a/en/device-dev/kernel/kernel-small-basic-process-scheduler.md +++ b/en/device-dev/kernel/kernel-small-basic-process-scheduler.md @@ -1,10 +1,4 @@ -# Scheduler - -- [Basic Concepts](#section123882355719) -- [Working Principles](#section143015396572) -- [Development Guidelines](#section10604192145816) - - [Available APIs](#section207985910582) - - [How to Develop](#section1015110331584) +# Scheduler ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-basic-process-thread.md b/en/device-dev/kernel/kernel-small-basic-process-thread.md index 9a2b06d76b5b7d13932ef55439f1408aee0d7f0c..5631cf62fb43f48d26b5016ac96534e24bdd7f37 100644 --- a/en/device-dev/kernel/kernel-small-basic-process-thread.md +++ b/en/device-dev/kernel/kernel-small-basic-process-thread.md @@ -1,12 +1,4 @@ -# Task - -- [Basic Concepts](#section138411646175417) -- [Working Principles](#section1381918945512) -- [Development Guidelines](#section10649727135519) - - [Available APIs](#section78333315555) - - [How to Develop](#section16229657115514) - - [Development Example](#section2809723165612) - +# Task ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-basic-process.md b/en/device-dev/kernel/kernel-small-basic-process.md index 86a31d5ac93bbcbb5bf71dd0e1b2b93c7c69ab94..e7fb2b6210780c3efaf4efdf680595852dc8e751 100644 --- a/en/device-dev/kernel/kernel-small-basic-process.md +++ b/en/device-dev/kernel/kernel-small-basic-process.md @@ -1,4 +1,4 @@ -# Process Management +# Process Management - **[Process](kernel-small-basic-process-process.md)** diff --git a/en/device-dev/kernel/kernel-small-basic-softtimer.md b/en/device-dev/kernel/kernel-small-basic-softtimer.md index 2616bbe0bbc78216b07ee2923bedfe6697e75ba5..daa7ca000027e5723cb9e905b55aa9449ce537c9 100644 --- a/en/device-dev/kernel/kernel-small-basic-softtimer.md +++ b/en/device-dev/kernel/kernel-small-basic-softtimer.md @@ -1,11 +1,4 @@ -# Software Timer - -- [Basic Concepts](#section4118241563) -- [Working Principles](#section31079397569) -- [Development Guidelines](#section18576131520577) - - [Available APIs](#section3138019145719) - - [How to Develop](#section1344817403575) - - [Development Example](#section114416313585) +# Software Timer ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-basic-time.md b/en/device-dev/kernel/kernel-small-basic-time.md index e6d49f70128ca2eec1eb89aa764dd255b04e6004..2918e7f62039e98d996290e3a845487dec14ccba 100644 --- a/en/device-dev/kernel/kernel-small-basic-time.md +++ b/en/device-dev/kernel/kernel-small-basic-time.md @@ -1,10 +1,4 @@ -# Time Management - -- [Basic Concepts](#section12903185785119) -- [Development Guidelines](#section430981720522) - - [Available APIs](#section1040142705214) - - [How to Develop](#section1381224710522) - - [Development Example](#section1344610245416) +# Time Management ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-basic-trans-event.md b/en/device-dev/kernel/kernel-small-basic-trans-event.md index 33d824f7e8c6a14d8d4720e0b5708e64bfa2c38b..2aba10352fbf9691cb4ab825f00ec28564d14c44 100644 --- a/en/device-dev/kernel/kernel-small-basic-trans-event.md +++ b/en/device-dev/kernel/kernel-small-basic-trans-event.md @@ -1,19 +1,4 @@ -# Event - -- [Basic Concepts](#section122115620816) -- [Working Principles](#section94611116593) - - [Event Control Block](#section1161415384467) - - [Working Principles](#section187761153144617) - -- [Development Guidelines](#section44744471891) - - [Available APIs](#section172373513919) - - [How to Develop](#section1118215161013) - -- [Development Example](#section5837165132911) - - [Example Description](#section128221510145718) - - [Sample Code](#section71507479577) - - [Verification](#section16570171645813) - +# Event ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-basic-trans-mutex.md b/en/device-dev/kernel/kernel-small-basic-trans-mutex.md index 1d9c5c1a1435e490376606a47d04c5ba9394ce5b..a911f97e1f894004b5cf48fea296982fe1d4d9b5 100644 --- a/en/device-dev/kernel/kernel-small-basic-trans-mutex.md +++ b/en/device-dev/kernel/kernel-small-basic-trans-mutex.md @@ -1,11 +1,5 @@ -# Mutex - -- [Basic Concepts](#section85865329185) -- [Working Principles](#section8547454201819) -- [Development Guidelines](#section2038861117194) - - [Available APIs](#section11168318131917) - - [How to Develop](#section4201191122116) - - [Development Example](#section10679328202117) +# Mutex + ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-basic-trans-queue.md b/en/device-dev/kernel/kernel-small-basic-trans-queue.md index f266c92e27c7768a53610842f8fc0d3e2ba2699d..5e2cbc062c4b9c3ba2066e37594d01d0fd871a7e 100644 --- a/en/device-dev/kernel/kernel-small-basic-trans-queue.md +++ b/en/device-dev/kernel/kernel-small-basic-trans-queue.md @@ -1,4 +1,4 @@ -# Queue +# Queue ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-basic-trans-rwlock.md b/en/device-dev/kernel/kernel-small-basic-trans-rwlock.md index 389a713074904ba1261871915ca1bf3f4c35a19b..97f8b77622ee03c6701df1e0b426778c8a956ddd 100644 --- a/en/device-dev/kernel/kernel-small-basic-trans-rwlock.md +++ b/en/device-dev/kernel/kernel-small-basic-trans-rwlock.md @@ -1,10 +1,4 @@ -# RW Lock - -- [Basic Concepts](#section4692105214260) -- [Working Principles](#section1239111562720) -- [Development Guidelines](#section11643194275) - - [Available APIs](#section15335332122717) - - [How to Develop](#section14774114882714) +# RW Lock ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-basic-trans-semaphore.md b/en/device-dev/kernel/kernel-small-basic-trans-semaphore.md index b701c8d2fb999a5c278b33284b89d97aa912ad47..31cf7a943e55c174be94905d70ad7c5a6d102dcb 100644 --- a/en/device-dev/kernel/kernel-small-basic-trans-semaphore.md +++ b/en/device-dev/kernel/kernel-small-basic-trans-semaphore.md @@ -1,14 +1,4 @@ -# Semaphore - -- [Basic Concepts](#section1577111168131) -- [Working Principles](#section118423019134) -- [Development Guidelines](#section01419503131) - - [Available APIs](#section1232345431312) - - [How to Develop](#section154261711141419) - - [Development Example](#section658135571417) - - [Example Description](#section125244411653) - - [Sample Code](#section1742105514512) - - [Verification](#section11297301617) +# Semaphore ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-basic-trans-user-mutex.md b/en/device-dev/kernel/kernel-small-basic-trans-user-mutex.md index 1d6064c08d48f6c5170a8859b588dc3fd1db9ac5..423e46492a8944ddacf62b5d332de1f3ed9a219b 100644 --- a/en/device-dev/kernel/kernel-small-basic-trans-user-mutex.md +++ b/en/device-dev/kernel/kernel-small-basic-trans-user-mutex.md @@ -1,7 +1,5 @@ -# Futex +# Futex -- [Basic Concepts](#section643519912920) -- [Working Principles](#section16834132502910) ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-basic-trans-user-signal.md b/en/device-dev/kernel/kernel-small-basic-trans-user-signal.md index f559f6ea2773e28b32963459241fcdb8f5933081..39fc0bc11507f9d70c5af1d8db203ed50b2866bd 100644 --- a/en/device-dev/kernel/kernel-small-basic-trans-user-signal.md +++ b/en/device-dev/kernel/kernel-small-basic-trans-user-signal.md @@ -1,7 +1,5 @@ -# Signal +# Signal -- [Basic Concepts](#section172788254307) -- [Working Principles](#section1249693812301) ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-basic-trans.md b/en/device-dev/kernel/kernel-small-basic-trans.md index bc7fe50a1f4e337820e456823ba9ceb698276b3f..90a34f413bf49d690e619528bf261b7dc2d643c7 100644 --- a/en/device-dev/kernel/kernel-small-basic-trans.md +++ b/en/device-dev/kernel/kernel-small-basic-trans.md @@ -1,4 +1,4 @@ -# Kernel Communication Mechanisms +# Kernel Communication Mechanisms - **[Event](kernel-small-basic-trans-event.md)** diff --git a/en/device-dev/kernel/kernel-small-basics.md b/en/device-dev/kernel/kernel-small-basics.md index 68ba677548dbfa2ad8f60f841663fe02cd158ede..4bf850db238b8a12c498633723c90183783da0a1 100644 --- a/en/device-dev/kernel/kernel-small-basics.md +++ b/en/device-dev/kernel/kernel-small-basics.md @@ -1,4 +1,4 @@ -# Basic Kernel +# Basic Kernel - **[Interrupt and Exception Handling](kernel-small-basic-interrupt.md)** diff --git a/en/device-dev/kernel/kernel-small-bundles-fs-new.md b/en/device-dev/kernel/kernel-small-bundles-fs-new.md index 749d7441a85792b447a419df2347d8ac8979acef..e62877e605dce84f471280191ca42ca47a0e7a2d 100644 --- a/en/device-dev/kernel/kernel-small-bundles-fs-new.md +++ b/en/device-dev/kernel/kernel-small-bundles-fs-new.md @@ -1,9 +1,5 @@ -# File System Adaptation +# File System Adaptation -- [Basic Concepts](#section19480121811422) -- [Adapting the Mount API](#section147051940104212) -- [Adapting the Lookup API](#section11930181394317) -- [Summary and Precautions](#section5617183014319) ## Basic Concepts @@ -28,7 +24,7 @@ struct VnodeOps g_yourFsVnodeOps = { FSMAP_ENTRY(yourfs_fsmap, "your fs name", g_yourFsMountOps, TRUE, TRUE); // Register the file system. ``` ->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](../public_sys-resources/icon-note.gif) **NOTE**
>1. The **open** and **close** APIs are not necessarily implemented because they are used to operate files and are imperceptible to the underlying file system. You need to implement them only when special operations need to be performed during the open and close operations on the file system. >2. Basic file system knowledge is required for file system adaptation. You need to have a deep understanding of the principles and implementation of the target file system. This section does not include the file system basics in detail. If you have any questions during the adaptation process, refer to the code in the **kernel/liteos\_a/fs** directory. @@ -215,7 +211,7 @@ The general adaptation procedure is as follows: The core logic is how to use the private data to implement API functions. These APIs implement common functions of the file systems and are generally implemented before the files systems are ported. Therefore, the key is to determine the private data required by the file system and store the data in the Vnode for later use. Generally, the private data is information that can uniquely locate a file on a storage medium. Most file systems have similar data structures, for example, the inode data structure in JFFS2. ->![](../public_sys-resources/icon-caution.gif) **CAUTION:** +>![](../public_sys-resources/icon-caution.gif) **CAUTION:**
>1. When a file is accessed, the **Lookup** API of the file system is not necessarily called. The **Lookup** API is called only when the PathCache is invalid. >2. Do not directly return the Vnode located by using **VfsHashGet** as the result. The information stored in the Vnode may be invalid. Update the fields and return it. >3. Vnodes are automatically released in the background based on memory usage. If data needs to be stored persistently, do not save it only in Vnodes. diff --git a/en/device-dev/kernel/kernel-small-bundles-fs-support-fat.md b/en/device-dev/kernel/kernel-small-bundles-fs-support-fat.md index fc4e7dc85a15f36c303d37af8f642b800c63d355..d82858014b528de1c82b4313cfc3a0e0312a9540 100644 --- a/en/device-dev/kernel/kernel-small-bundles-fs-support-fat.md +++ b/en/device-dev/kernel/kernel-small-bundles-fs-support-fat.md @@ -1,9 +1,4 @@ -# FAT - -- [Basic Concepts](#section621393911385) -- [Working Principles](#section10796155213381) -- [Development Guidelines](#section144094483919) - - [How to Develop](#section139086116394) +# FAT ## Basic Concepts @@ -32,7 +27,7 @@ Example: mount("/dev/mmcblk0p0", "/mnt", "vfat", 0, NULL); ``` ->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](../public_sys-resources/icon-note.gif) **NOTE**
>- The size of a single FAT file cannot be greater than 4 GiB. >- When there are two SD card slots, the first card inserted is card 0, and that inserted later is card 1. >- When multi-partition is enabled and there are multiple partitions, the device node **/dev/mmcblk0** \(primary device\) registered by card 0 and **/dev/mmcblk0p0** \(secondary device\) are the same device. In this case, you cannot perform operations on the primary device. diff --git a/en/device-dev/kernel/kernel-small-bundles-fs-support-jffs2.md b/en/device-dev/kernel/kernel-small-bundles-fs-support-jffs2.md index e266e552caf20803a0bc5188f8e05d41a8e115bb..7fc87805f3521f62e36421a9d5db6ba35e5c0020 100644 --- a/en/device-dev/kernel/kernel-small-bundles-fs-support-jffs2.md +++ b/en/device-dev/kernel/kernel-small-bundles-fs-support-jffs2.md @@ -1,9 +1,4 @@ -# JFFS2 - -- [Basic Concepts](#section11411110155919) -- [Working Principles](#section23911025195913) -- [Development Guidelines](#section179711119014) - +# JFFS2 ## Basic Concepts Journalling Flash File System Version 2 \(JFFS2\) is a log-structured file system designed for Memory Technology Devices \(MTDs\). diff --git a/en/device-dev/kernel/kernel-small-bundles-fs-support-nfs.md b/en/device-dev/kernel/kernel-small-bundles-fs-support-nfs.md index fc24e1bcb1771e43fd73efaf266ba2f2667fc5ad..d205531eb3d7ac83645ce872669a645d0d4d5aa5 100644 --- a/en/device-dev/kernel/kernel-small-bundles-fs-support-nfs.md +++ b/en/device-dev/kernel/kernel-small-bundles-fs-support-nfs.md @@ -1,8 +1,5 @@ -# NFS +# NFS -- [Basic Concepts](#section195414101464) -- [Working Principles](#section165621321194618) -- [Development Guidelines](#section7454935184611) ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-bundles-fs-support-procfs.md b/en/device-dev/kernel/kernel-small-bundles-fs-support-procfs.md index 75902b5ea9669b102346d3cb559537d42d4986a9..a9b031e9f72b535f22f3083491c5b76c08459e3f 100644 --- a/en/device-dev/kernel/kernel-small-bundles-fs-support-procfs.md +++ b/en/device-dev/kernel/kernel-small-bundles-fs-support-procfs.md @@ -1,9 +1,4 @@ -# procfs - -- [Basic Concepts](#section146801917174017) -- [Working Principles](#section479762916408) -- [Development Guidelines](#section1221174524014) - - [Development Example](#section52016575401) +# procfs ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-bundles-fs-support-ramfs.md b/en/device-dev/kernel/kernel-small-bundles-fs-support-ramfs.md index 854086afd3536905c9a2b5172b09fc559a24d0cb..975baff8c25166e4e9afa703c4208aa03af5d066 100644 --- a/en/device-dev/kernel/kernel-small-bundles-fs-support-ramfs.md +++ b/en/device-dev/kernel/kernel-small-bundles-fs-support-ramfs.md @@ -1,8 +1,4 @@ -# Ramfs - -- [Basic Concepts](#section9507151014420) -- [Working Principles](#section1859711263447) -- [Development Guidelines](#section163554380448) +# Ramfs ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-bundles-fs-support.md b/en/device-dev/kernel/kernel-small-bundles-fs-support.md index ee0741ca974b0fa21236abeb956f48adf43ebd38..036673f74ca1e7f0a62eadbaaa629c33dcf4a74c 100644 --- a/en/device-dev/kernel/kernel-small-bundles-fs-support.md +++ b/en/device-dev/kernel/kernel-small-bundles-fs-support.md @@ -1,4 +1,4 @@ -# Supported File Systems +# Supported File Systems - **[FAT](kernel-small-bundles-fs-support-fat.md)** diff --git a/en/device-dev/kernel/kernel-small-bundles-fs-virtual.md b/en/device-dev/kernel/kernel-small-bundles-fs-virtual.md index a98ff3cd6c6ad292523ab9353856854adcc4c879..2d90df4720aafd107b21196ecd589878f3b191ff 100644 --- a/en/device-dev/kernel/kernel-small-bundles-fs-virtual.md +++ b/en/device-dev/kernel/kernel-small-bundles-fs-virtual.md @@ -1,11 +1,4 @@ -# Virtual File System - -- [Basic Concepts](#section1253851143520) -- [Working Principles](#section14915913123510) -- [Development Guidelines](#section1759563620358) - - [Available APIs](#section17865142133511) - - [How to Develop](#section64113023616) - - [Development Example](#section236041883618) +# Virtual File System ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-bundles-fs.md b/en/device-dev/kernel/kernel-small-bundles-fs.md index 5ad3391eef2850f5ebee600a333f991cb9b29765..9a80b886e7af11385f8350d26c539de9764d1136 100644 --- a/en/device-dev/kernel/kernel-small-bundles-fs.md +++ b/en/device-dev/kernel/kernel-small-bundles-fs.md @@ -1,10 +1,10 @@ -# File Systems +# File Systems A file system \(often abbreviated to FS\) provides an input and output manner for an OS. It implements the interaction with internal and external storage devices. The file system provides standard POSIX operation APIs for the upper-layer system through the C library. For details, see the API reference of the C library. The Virtual File System \(VFS\) layer in kernel mode shields the differences between file systems. The basic architecture is as follows: -**Figure 1** Overall file system architecture +**Figure 1** Overall file system architecture ![](figures/overall-file-system-architecture.png "overall-file-system-architecture") - **[Virtual File System](kernel-small-bundles-fs-virtual.md)** diff --git a/en/device-dev/kernel/kernel-small-bundles-ipc.md b/en/device-dev/kernel/kernel-small-bundles-ipc.md index 1d906c36d8eb658ea5b97ba0f60c68b745b84d2f..cdde2e4e602dfe73c76158b2fd9119fcfc4d347b 100644 --- a/en/device-dev/kernel/kernel-small-bundles-ipc.md +++ b/en/device-dev/kernel/kernel-small-bundles-ipc.md @@ -1,9 +1,4 @@ -# LiteIPC - -- [Basic Concepts](#section1980994712918) -- [Working Principles](#section849811592918) -- [Development Guidelines](#section17571315171017) - - [Available APIs](#section725022011103) +# LiteIPC ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-bundles-linking.md b/en/device-dev/kernel/kernel-small-bundles-linking.md index 1d7956e2af1c4255abb745c1f47226a84b8eca16..78a6076a0239d6fa922c470425dccdf96990117a 100644 --- a/en/device-dev/kernel/kernel-small-bundles-linking.md +++ b/en/device-dev/kernel/kernel-small-bundles-linking.md @@ -1,11 +1,4 @@ -# Dynamic Loading and Linking - -- [Basic Concepts](#section208951139453) -- [Working Principles](#section14140155320511) -- [Development Guidelines](#section133501496612) - - [Available APIs](#section874113201669) - - [How to Develop](#section196712561563) - +# Dynamic Loading and Linking ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-bundles-share.md b/en/device-dev/kernel/kernel-small-bundles-share.md index 90410e8ab61eef7630bb03b876eb3d53cdf1893d..23f6b68a3e4601e0dc4d10783f15bb4616caee88 100644 --- a/en/device-dev/kernel/kernel-small-bundles-share.md +++ b/en/device-dev/kernel/kernel-small-bundles-share.md @@ -1,7 +1,4 @@ -# Virtual Dynamic Shared Object - -- [Basic Concepts](#section174577181688) -- [Working Principles](#section546363114810) +# Virtual Dynamic Shared Object ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-bundles-system.md b/en/device-dev/kernel/kernel-small-bundles-system.md index ddca52646afbc930e3d2b60aab25471c11dc86e9..9b3bf1c07d19ec36af8ffdd4a3975ad204ed705f 100644 --- a/en/device-dev/kernel/kernel-small-bundles-system.md +++ b/en/device-dev/kernel/kernel-small-bundles-system.md @@ -1,10 +1,4 @@ -# System Call - -- [Basic Concepts](#section889710401734) -- [Working Principles](#section195177541314) -- [Development Guidelines](#section193492047135419) - - [How to Develop](#section7165741122210) - - [Development Example](#section107131418224) +# System Call ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-bundles.md b/en/device-dev/kernel/kernel-small-bundles.md index 755e2693bd7fd674e2cdef257ff3ede8aaeddf61..9e98cbcd4e18dc47d154b75919d7523de699ccd2 100644 --- a/en/device-dev/kernel/kernel-small-bundles.md +++ b/en/device-dev/kernel/kernel-small-bundles.md @@ -1,4 +1,4 @@ -# Extended Components +# Extended Components - **[System Call](kernel-small-bundles-system.md)** diff --git a/en/device-dev/kernel/kernel-small-debug-memory-corrupt.md b/en/device-dev/kernel/kernel-small-debug-memory-corrupt.md index 32b0c74cf507c03a7778366505a423e10a3b1e15..86e96a509e36d8b451fadb2b17543c82c7fe8d70 100644 --- a/en/device-dev/kernel/kernel-small-debug-memory-corrupt.md +++ b/en/device-dev/kernel/kernel-small-debug-memory-corrupt.md @@ -1,10 +1,4 @@ -# Memory Corruption Check - -- [Basic Concepts](#section17368154517335) -- [Function Configuration](#section4696190123420) -- [Development Guidelines](#section672362973417) - - [How to Develop](#section026014863416) - - [Development Example](#section186311302356) +# Memory Corruption Check ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-debug-memory-info.md b/en/device-dev/kernel/kernel-small-debug-memory-info.md index d87652c782de7f205d4cd5d9eda743b396656daf..7e49011370211aab32ba94e1a578b99f77e857b7 100644 --- a/en/device-dev/kernel/kernel-small-debug-memory-info.md +++ b/en/device-dev/kernel/kernel-small-debug-memory-info.md @@ -1,11 +1,4 @@ -# Memory Information Statistics - -- [Basic Concepts](#section52691565235) -- [Function Configuration](#section470611682411) -- [Development Guidelines](#section9368374243) - - [How to Develop](#section679912407257) - - [Development Example](#section1025453412611) - +# Memory Information Statistics ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-debug-memory-leak.md b/en/device-dev/kernel/kernel-small-debug-memory-leak.md index 4934e5eab7679f6a28806b96f5ff063680b1a2d1..d67b32bff12085d5f85c831aef31cae9a5f76491 100644 --- a/en/device-dev/kernel/kernel-small-debug-memory-leak.md +++ b/en/device-dev/kernel/kernel-small-debug-memory-leak.md @@ -1,10 +1,4 @@ -# Memory Leak Check - -- [Basic Concepts](#section1026719436293) -- [Function Configuration](#section13991354162914) -- [Development Guidelines](#section95828159308) - - [How to Develop](#section369844416304) - - [Development Example](#section460801313313) +# Memory Leak Check ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-debug-memory.md b/en/device-dev/kernel/kernel-small-debug-memory.md index cc8bc8d2c5bd2d84682608ef8ee168b5f63e3d7a..ecd2a8013ec8d1f11a8c044cd27685b1fe609cc7 100644 --- a/en/device-dev/kernel/kernel-small-debug-memory.md +++ b/en/device-dev/kernel/kernel-small-debug-memory.md @@ -1,4 +1,4 @@ -# Kernel-Mode Memory Debugging +# Kernel-Mode Memory Debugging - **[Memory Information Statistics](kernel-small-debug-memory-info.md)** diff --git a/en/device-dev/kernel/kernel-small-debug-other.md b/en/device-dev/kernel/kernel-small-debug-other.md index b4a19694532ce220b4db5de55169d3c225a9d50a..904dc139c01e9c6524b3461e476080f8bfb4d1db 100644 --- a/en/device-dev/kernel/kernel-small-debug-other.md +++ b/en/device-dev/kernel/kernel-small-debug-other.md @@ -1,4 +1,4 @@ -# Other Kernel Debugging Methods +# Other Kernel Debugging Methods - **[Dying Gasp](kernel-small-debug-trace-other-lastwords.md)** diff --git a/en/device-dev/kernel/kernel-small-debug-process-cpu.md b/en/device-dev/kernel/kernel-small-debug-process-cpu.md index 54507fed19ae0d7f731b44b69335af5b52b6434c..5801bb007bc9edc1b075363a34ba57eb67e3c498 100644 --- a/en/device-dev/kernel/kernel-small-debug-process-cpu.md +++ b/en/device-dev/kernel/kernel-small-debug-process-cpu.md @@ -1,14 +1,7 @@ -# CPUP +# Process Debugging -- [Basic Concepts](#section17683419227) -- [Working Principles](#section593718536227) -- [Development Guidelines](#section11284210152311) - - [Available APIs](#section3745151592312) - - [How to Develop](#section122901429182316) - - [Development Example](#section1765785212310) - -## Basic Concepts +## Basic Concepts The central processing unit percent \(CPUP\) includes the system CPUP, process CPUP, task CPUP, and interrupt CPUP. With the system CPUP, you can determine whether the current system load exceeds the designed specifications. With the CPUP of each task/process/interrupt, you can determine whether their CPU usage meets expectations of the design. diff --git a/en/device-dev/kernel/kernel-small-debug-process.md b/en/device-dev/kernel/kernel-small-debug-process.md index a57488bf665341f048fc60b512596660bd1cb951..6464dfadcc406ffd8febaf3e7d07c7e17e056564 100644 --- a/en/device-dev/kernel/kernel-small-debug-process.md +++ b/en/device-dev/kernel/kernel-small-debug-process.md @@ -1,4 +1,4 @@ -# Process Commissioning +# Process Debugging - **[CPUP](kernel-small-debug-process-cpu.md)** diff --git a/en/device-dev/kernel/kernel-small-debug-shell-build.md b/en/device-dev/kernel/kernel-small-debug-shell-build.md index c6758e46cf32a7a6c63feb9116b57223b9a7fdb2..df3f598e9245da67c047327ccb61fbb95701b4a5 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-build.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-build.md @@ -1,10 +1,4 @@ -# Shell Command Programming Example - -- [Example Description](#section87143612316) -- [Static Registration](#section1660495712314) -- [Static Registration Programming Example](#section1233411684113) -- [Dynamic Registration](#section6804126192412) -- [Dynamic Registration Programming Example](#section2335121613418) +# Shell Command Programming Example ## Example Description diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-cpup.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-cpup.md index bb52c6ead06f5015d2d48118f7eb37b6dd0ebaac..746b920933106047cb22d223404e4b090425fe9f 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-cpup.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-cpup.md @@ -1,11 +1,5 @@ -# cpup - -- [Command Function](#section1842161614217) -- [Syntax](#section5629527427) -- [Parameters](#section133651361023) -- [Usage](#section156611948521) -- [Example](#section68501605319) -- [Output](#section19871522144219) +# cpup + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-date.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-date.md index 247af2bf57820176806cb88db46ab51d1fec1ed1..b232540382d344f2a18fb8424665e759f6301013 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-date.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-date.md @@ -1,11 +1,4 @@ -# date - -- [Command Function](#section56472016338) -- [Syntax](#section16635112512316) -- [Parameters](#section15896030039) -- [Usage](#section116361036636) -- [Example](#section021711411237) -- [Output](#section17950184414312) +# date ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-dmesg.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-dmesg.md index 7d97c159890f022c8220162b611020e6b89a9cd0..71950cfa70ab6e746e2f958a9d59bc5612698a3c 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-dmesg.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-dmesg.md @@ -1,11 +1,4 @@ -# dmesg - -- [Command Function](#section4643204919313) -- [Syntax](#section6553153635) -- [Parameters](#section208971157532) -- [Usage](#section213115219413) -- [Example](#section13736564418) -- [Output](#section194005101413) +# dmesg ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-exec.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-exec.md index dcfa9e2fd5802a80efce3d0381facfcedf03ceaf..d928f722e2a0dd97883b1305b601d4198d345bf6 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-exec.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-exec.md @@ -1,11 +1,5 @@ -# exec - -- [Command Function](#section4643204919313) -- [Syntax](#section6553153635) -- [Parameters](#section208971157532) -- [Usage](#section213115219413) -- [Example](#section13736564418) -- [Output](#section194005101413) +# exec + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-free.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-free.md index ad01ce8a0b79b86ee86a217b0f471ca3586ac856..7922bd0a47ef4172d90aacdea2061f45eac7f9c9 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-free.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-free.md @@ -1,11 +1,4 @@ -# free - -- [Command Function](#section175151514841) -- [Syntax](#section8488721749) -- [Parameters](#section27272181949) -- [Usage](#section148661259410) -- [Example](#section68081530242) -- [Output](#section171235517543) +# free ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-help.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-help.md index 34789511faf83b45c40f78d6a5005f17c261b412..afdf6852c2381d5d2ba09920016a197611c85fcc 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-help.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-help.md @@ -1,11 +1,4 @@ -# help - -- [Command Function](#section991211345413) -- [Syntax](#section19103204016410) -- [Parameters](#section1533416233432) -- [Usage](#section4156445417) -- [Example](#section12776124712417) -- [Output](#section092662412544) +# help ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-hwi.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-hwi.md index 7c6bf50c2d60cef6b7a6b437fb4094ea93a0cc43..52854b1cfa54f3aa3607f9ca2e43ac506d2edfce 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-hwi.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-hwi.md @@ -1,11 +1,4 @@ -# hwi - -- [Command Function](#section445335110416) -- [Syntax](#section1795712553416) -- [Parameters](#section92544592410) -- [Usage](#section104151141252) -- [Example](#section11545171957) -- [Output](#section075617368542) +# hwi ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-kill.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-kill.md index 0dd40f285677989a859a6b49b132aa74cf4cfa06..841bcc90ac36ced0dc75a32e52defdcb89d51aff 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-kill.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-kill.md @@ -1,11 +1,4 @@ -# kill - -- [Command Function](#section366714216619) -- [Syntax](#section8833164614615) -- [Parameters](#section12809111019453) -- [Usage](#section15935131220717) -- [Example](#section79281818476) -- [Output](#section12742311179) +# kill ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-log.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-log.md index 66ae0755beab755907997673c43f044dec89b9c8..9809d169a35146e4a886a8706dbb30fb56162322 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-log.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-log.md @@ -1,11 +1,4 @@ -# log - -- [Command Function](#section128219131856) -- [Syntax](#section3894181710519) -- [Parameters](#section7693122310515) -- [Usage](#section1982111281512) -- [Example](#section176301333259) -- [Output](#section14354765415) +# log ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-memcheck.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-memcheck.md index 2436cc1ae331bfc904cd5dff3090efcbf9b124ec..673393acbf78cce8379196dc0b8436565c4a9c2d 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-memcheck.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-memcheck.md @@ -1,11 +1,4 @@ -# memcheck - -- [Command Function](#section191633812516) -- [Syntax](#section428816435510) -- [Parameters](#section1939943304411) -- [Usage](#section228914491951) -- [Example](#section17373205314515) -- [Output](#section13406205385413) +# memcheck ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-oom.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-oom.md index b3800327facc82e7f3ade1936f9197c0a9c91419..9372b8ae18ee255fba9f5abd8c9ca7c1a3a3946b 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-oom.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-oom.md @@ -1,11 +1,4 @@ -# oom - -- [Command Function](#section366714216619) -- [Syntax](#section8833164614615) -- [Parameters](#section12809111019453) -- [Usage](#section15935131220717) -- [Example](#section387104374416) -- [Output](#section12742311179) +# oom ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-pmm.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-pmm.md index 1ccae97356712321962498ac9f1ab416879615c4..ffa823db63ab1ff65a94f364c5f461e158b20096 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-pmm.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-pmm.md @@ -1,11 +1,4 @@ -# pmm - -- [Command Function](#section445335110416) -- [Syntax](#section1795712553416) -- [Parameters](#section92544592410) -- [Usage](#section104151141252) -- [Example](#section11545171957) -- [Output](#section075617368542) +# pmm ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-reboot.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-reboot.md index 46769ef3e32863534b5a438ea1c689a7dfa53952..000cc3873b7069ad2711a73b818a5330ebb775c3 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-reboot.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-reboot.md @@ -1,11 +1,4 @@ -# reboot - -- [Command Function](#section20643141481314) -- [Syntax](#section1075441721316) -- [Parameters](#section1472810220135) -- [Usage](#section186772414131) -- [Example](#section4764192791314) -- [Output](#section5791253155517) +# reboot ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-reset.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-reset.md index 601e31f1b6a0bd4ac6d3d12d25318ee7a2aa3567..7fca8b04a7cebdd6fb998c3f8472c7b1950faa3e 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-reset.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-reset.md @@ -1,11 +1,4 @@ -# reset - -- [Command Function](#section366714216619) -- [Syntax](#section8833164614615) -- [Parameters](#section12809111019453) -- [Usage](#section15935131220717) -- [Example](#section79281818476) -- [Output](#section12742311179) +# reset ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-sem.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-sem.md index bc05dc4b3ef377764d392579d2d4075c036cbb02..97d64d282623b79259c004dd96bf7bc69339cdb5 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-sem.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-sem.md @@ -1,11 +1,4 @@ -# sem - -- [Command Function](#section366714216619) -- [Syntax](#section8833164614615) -- [Parameters](#section12809111019453) -- [Usage](#section15935131220717) -- [Example](#section79281818476) -- [Output](#section1975118519456) +# sem ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-stack.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-stack.md index 161fd252a77805676e2c236693b93ba666e0049f..da1aad64eac9f0e54ce8fe75f41a8da78ef344ef 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-stack.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-stack.md @@ -1,11 +1,5 @@ -# stack - -- [Command Function](#section445335110416) -- [Syntax](#section1795712553416) -- [Parameters](#section92544592410) -- [Usage](#section104151141252) -- [Example](#section11545171957) -- [Output](#section075617368542) +# stack + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-su.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-su.md index 68360718dec7491cca25430b56b70524072aa670..7e23b3b60dcd0ee80701d5d42b0f4ac267e444d2 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-su.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-su.md @@ -1,11 +1,4 @@ -# su - -- [Command Function](#section297810431676) -- [Syntax](#section157131147876) -- [Parameters](#section04145521671) -- [Usage](#section14615155610719) -- [Example](#section13338150985) -- [Output](#section125021924194613) +# su ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-swtmr.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-swtmr.md index 73676a220aa541367eb746f104344b5a07341242..a764d66fc83e1d7d8b2e2eabacfbefc3a61462f7 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-swtmr.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-swtmr.md @@ -1,11 +1,5 @@ -# swtmr - -- [Command Function](#section166171064814) -- [Syntax](#section424011111682) -- [Parameters](#section1268410459465) -- [Usage](#section169806213815) -- [Example](#section16676026389) -- [Output](#section1541991614710) +# swtmr + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-sysinfo.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-sysinfo.md index d28355447b0b8d10bd647a996e437d0c6c579ac4..c1a81444f8b4af508906bd02a7ca500a36e7c0ad 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-sysinfo.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-sysinfo.md @@ -1,11 +1,4 @@ -# systeminfo - -- [Command Function](#section863016434820) -- [Syntax](#section139791817795) -- [Parameters](#section19472339164813) -- [Usage](#section285522592) -- [Example](#section9471171015105) -- [Output](#section1657011114915) +# systeminfo ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-task.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-task.md index 3eceba9af02fe37ab24ee34fe8282092a8e5a199..2510d417ccf6bc7e9d398daadf9941bd87e0cb1c 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-task.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-task.md @@ -1,11 +1,4 @@ -# task - -- [Command Function](#section0533181714106) -- [Syntax](#section1014412308101) -- [Parameters](#section116057158506) -- [Usage](#section2053502951112) -- [Example](#section12629113381116) -- [Output](#section19299103465015) +# task ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-top.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-top.md index 3f605a6d21a6e44ccaa8a3ab8d567313e381f2b7..4fa4959b1b082d0394b78ef271ac9b89a4f29901 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-top.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-top.md @@ -1,11 +1,4 @@ -# top - -- [Command Function](#section20643141481314) -- [Syntax](#section1075441721316) -- [Parameters](#section1472810220135) -- [Usage](#section186772414131) -- [Example](#section4764192791314) -- [Output](#section5791253155517) +# top ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-uname.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-uname.md index 781a427e634db8e478120f7ab6cb2ca1fde324e2..770a11ceb5171ba3ab3f33c7dd58f96984a02399 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-uname.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-uname.md @@ -1,10 +1,4 @@ -# uname - -- [Command Function](#section107697383115) -- [Syntax](#section162824341116) -- [Usage](#section2652124861114) -- [Example](#section0107995132) -- [Output](#section1215113245511) +# uname ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-vmm.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-vmm.md index 3a207165b81d1ad47dcb37bd7a51026f86829d8a..cce14dd6bbca807f007073d792efcfb8e3577823 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-vmm.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-vmm.md @@ -1,11 +1,4 @@ -# vmm - -- [Command Function](#section445335110416) -- [Syntax](#section1795712553416) -- [Parameters](#section92544592410) -- [Usage](#section104151141252) -- [Example](#section11545171957) -- [Output](#section075617368542) +# vmm ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd-watch.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd-watch.md index df743e04bb4b8628338bedf864b9616374a11a96..343634d384010dd73dc69708e9d000a92925900e 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd-watch.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd-watch.md @@ -1,11 +1,4 @@ -# watch - -- [Command Function](#section20643141481314) -- [Syntax](#section1075441721316) -- [Parameters](#section1472810220135) -- [Usage](#section186772414131) -- [Example](#section4764192791314) -- [Output](#section5791253155517) +# watch ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-cmd.md b/en/device-dev/kernel/kernel-small-debug-shell-cmd.md index 7d486f835fb2e3793ea4e5f1e7190fef26001f90..25e4f66d922ed4a9b0dc07abc0d7465e96d34724 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-cmd.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-cmd.md @@ -1,4 +1,4 @@ -# System Commands +# System Commands - **[cpup](kernel-small-debug-shell-cmd-cpup.md)** diff --git a/en/device-dev/kernel/kernel-small-debug-shell-details.md b/en/device-dev/kernel/kernel-small-debug-shell-details.md index 177f26cb93d388705c5fa93911b377f248451cb5..8a119b8cc16f378ba4877ec6622768ca11fa73eb 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-details.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-details.md @@ -1,4 +1,4 @@ -# Shell Command Reference +# Shell Command Reference This chapter describes the functions, syntax, parameter ranges, usage, and examples of key system commands. diff --git a/en/device-dev/kernel/kernel-small-debug-shell-error.md b/en/device-dev/kernel/kernel-small-debug-shell-error.md index 7dd0c56ef7625d085029512d109b0fd1efe07e9b..7ada09e5653cd9d2174405071efa43c53b85c228 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-error.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-error.md @@ -1,4 +1,4 @@ -# User-Mode Exception Information +# User-Mode Exception Information During the running of the user mode, the following system exception may occur: diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-cat.md b/en/device-dev/kernel/kernel-small-debug-shell-file-cat.md index b3c4600aae569992fa8accbb47d71d9610e24e06..7a4fd54ccea998e7a1621eeb2a7d082f1ab5865d 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-cat.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-cat.md @@ -1,11 +1,4 @@ -# cat - -- [Command Function](#section16710153391315) -- [Syntax](#section1699392313158) -- [Parameters](#section1677217374136) -- [Usage](#section186772414131) -- [Example](#section12158131814561) -- [Output](#section183926225561) +# cat ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-cd.md b/en/device-dev/kernel/kernel-small-debug-shell-file-cd.md index 8730d3dfc6a0df0d5af604e3713e03bb08b8eee8..187e454a2ad69814abdd8f15adab12cb39370872 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-cd.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-cd.md @@ -1,11 +1,5 @@ -# cd - -- [Command Function](#section11690184921316) -- [Syntax](#section75695409569) -- [Parameters](#section71961353181311) -- [Usage](#section3629759111317) -- [Example](#section211620301412) -- [Output](#section1968117214577) +# cd + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-chgrp.md b/en/device-dev/kernel/kernel-small-debug-shell-file-chgrp.md index e80f1ee4cc3fd61330659ebbf84ea9a5dee50af7..af1df3355499e935a6df4931e722282d5826c268 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-chgrp.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-chgrp.md @@ -1,11 +1,4 @@ -# chgrp - -- [Command Function](#section6103119161418) -- [Syntax](#section186958132141) -- [Parameters](#section81796174141) -- [Usage](#section14330152417140) -- [Example](#section951823119149) -- [Output](#section14271133125715) +# chgrp ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-chmod.md b/en/device-dev/kernel/kernel-small-debug-shell-file-chmod.md index ebf41f5105b8cc6d98ea76116f704ff412f96845..200131874538c91c07404b94982ec77e30dcb7d4 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-chmod.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-chmod.md @@ -1,11 +1,4 @@ -# chmod - -- [Command Function](#section13992936121418) -- [Syntax](#section63342439147) -- [Parameter Description](#section894414671411) -- [Usage](#section182415221419) -- [Example](#section8518195718147) -- [Output](#section127391818158) +# chmod ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-chown.md b/en/device-dev/kernel/kernel-small-debug-shell-file-chown.md index 87588554ccf7b1e2e12f6e273e15495bad29b466..3a4006df874d5723184968c92472a6aeefed8f1e 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-chown.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-chown.md @@ -1,11 +1,4 @@ -# chown - -- [Command Function](#section247414691513) -- [Syntax](#section14773151018159) -- [Parameters](#section598731391517) -- [Usage](#section16524152071510) -- [Example](#section17901152561510) -- [Output](#section15513163115816) +# chown ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-cp.md b/en/device-dev/kernel/kernel-small-debug-shell-file-cp.md index 93119d0a803fb36f6123c789f0cb1183c8501af7..b191a7fb5260b869905b47bad385db78c273afe4 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-cp.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-cp.md @@ -1,11 +1,4 @@ -# cp - -- [Command Function](#section6841203041513) -- [Syntax](#section24286359150) -- [Parameters](#section558617385152) -- [Usage](#section16128156162) -- [Example](#section19354171211618) -- [Output](#section16754183195914) +# cp ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-du.md b/en/device-dev/kernel/kernel-small-debug-shell-file-du.md index 9a53aaa3568229d099729e7f45da73580cc90d74..8dd89bfaa3a1f573d8ec82be44b0b54704d5f309 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-du.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-du.md @@ -1,11 +1,4 @@ -# du - -- [Command Function](#section201149459368) -- [Syntax](#section579813484364) -- [Parameters](#section168065311366) -- [Usage](#section19190125723612) -- [Example](#section10383416372) -- [Output](#section16633113552815) +# du ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-format.md b/en/device-dev/kernel/kernel-small-debug-shell-file-format.md index b2a5c18f5551d1e65d2631f17cb8cd3fb335396b..7801ff31c3b49d0318f49b2957ec6e9eda3049f0 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-format.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-format.md @@ -1,11 +1,5 @@ -# format - -- [Command Function](#section1922331919169) -- [Syntax](#section249226169) -- [Parameters](#section985173416177) -- [Usage](#section1510162714162) -- [Example](#section25691431161611) -- [Output](#section17368112365920) +# format + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-ls.md b/en/device-dev/kernel/kernel-small-debug-shell-file-ls.md index d171d10e013f51a320be240212b93049241a88ff..0c8f1abbe920bd74558301b4e2dc61a3882d8a42 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-ls.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-ls.md @@ -1,11 +1,4 @@ -# ls - -- [Command Function](#section6538163771614) -- [Syntax](#section45881743111616) -- [Parameters](#section17528148171617) -- [Usage](#section041212533166) -- [Example](#section986105716167) -- [Output](#section2036124918592) +# ls ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-lsfd.md b/en/device-dev/kernel/kernel-small-debug-shell-file-lsfd.md index 2b03724a71684980c53afb57f1414f5f836c0273..fe035b1c141dfcda3223df3c99335f1cc7901376 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-lsfd.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-lsfd.md @@ -1,10 +1,5 @@ -# lsfd +# lsfd -- [Command Function](#section2053406181716) -- [Syntax](#section523771017172) -- [Usage](#section27241213201719) -- [Example](#section442617197173) -- [Output](#section42491639151813) ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-mkdir.md b/en/device-dev/kernel/kernel-small-debug-shell-file-mkdir.md index 124ef5042df0f7fdc61b2d8c5e934918afee0957..09b1935ecc8727ff43d148059c12afca27342ef9 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-mkdir.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-mkdir.md @@ -1,11 +1,5 @@ -# mkdir - -- [Command Function](#section1083613274175) -- [Syntax](#section820913118178) -- [Parameters](#section1256834121718) -- [Usage](#section1294234115172) -- [Example](#section1113345211713) -- [Output](#section10142201012) +# mkdir + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-mount.md b/en/device-dev/kernel/kernel-small-debug-shell-file-mount.md index 60b96c53e120ec626fd58850e840455dd492a15f..9fccd3e4eaf981e0b072ea03cd9d71c4a41e1aac 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-mount.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-mount.md @@ -1,11 +1,5 @@ -# mount - -- [Command Function](#section11631837182) -- [Syntax](#section1697638111820) -- [Parameters](#section1650151221819) -- [Usage](#section124541520171912) -- [Example](#section7424625171917) -- [Output](#section14757018116) +# mount + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-mv.md b/en/device-dev/kernel/kernel-small-debug-shell-file-mv.md index 72bd8fef129ab86db4723c9a4c8d799d97331ed9..880b14485c22069f023f256961485e33f6afb82c 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-mv.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-mv.md @@ -1,11 +1,5 @@ -# mv - -- [Command Function](#section201149459368) -- [Syntax](#section579813484364) -- [Parameters](#section168065311366) -- [Usage](#section19190125723612) -- [Example](#section10383416372) -- [Output](#section131601649114511) +# mv + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-partinfo.md b/en/device-dev/kernel/kernel-small-debug-shell-file-partinfo.md index 74139c87118d09a58ea9ec7e4bad2bc717667651..6f0ed999752060343314708afe218e1488cf0128 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-partinfo.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-partinfo.md @@ -1,11 +1,5 @@ -# partinfo - -- [Command Function](#section1777503617199) -- [Syntax](#section185501447132114) -- [Parameters](#section1304151212252) -- [Usage](#section4566131982520) -- [Example](#section4351134942514) -- [Output](#section66689331412) +# partinfo + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-partition.md b/en/device-dev/kernel/kernel-small-debug-shell-file-partition.md index 03f51089facff978a5ff5ab5941565edc1351490..48e98ea48d0073d82658803bc28f37f1403aae9d 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-partition.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-partition.md @@ -1,11 +1,5 @@ -# partition - -- [Command Function](#section255095212257) -- [Syntax](#section10258056122515) -- [Parameters](#section177200581256) -- [Usage](#section17866411262) -- [Example](#section1927174202610) -- [Output](#section11321011223) +# partition + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-pwd.md b/en/device-dev/kernel/kernel-small-debug-shell-file-pwd.md index be084dd5a2f194bc35b314917f196b45c1afdd90..87513f7f67fe226d6b87c8281f0a31f6444b42e7 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-pwd.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-pwd.md @@ -1,11 +1,5 @@ -# pwd - -- [Command Function](#section197737712267) -- [Syntax](#section1544061016267) -- [Parameters](#section599112120262) -- [Usage](#section66901116152615) -- [Example](#section7427181922612) -- [Output](#section116313389418) +# pwd + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-rm.md b/en/device-dev/kernel/kernel-small-debug-shell-file-rm.md index 6d095508abc27c84bb77a8c8f803582b33f57381..b535c90a4feab46cedd8f82d8398ef75da4b0777 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-rm.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-rm.md @@ -1,11 +1,5 @@ -# rm - -- [Command Function](#section181141523142613) -- [Syntax](#section8800926132619) -- [Parameters](#section15476229152617) -- [Usage](#section10578163215262) -- [Example](#section18548133511263) -- [Output](#section1565323814265) +# rm + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-rmdir.md b/en/device-dev/kernel/kernel-small-debug-shell-file-rmdir.md index faf656c5e40bc30e7157bac4ef140c0456863913..70cf25e12419964077362426fb5f15d58092ba50 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-rmdir.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-rmdir.md @@ -1,11 +1,5 @@ -# rmdir - -- [Command Function](#section1839611420266) -- [Syntax](#section329574512266) -- [Parameters](#section15865747102620) -- [Usage](#section107857508261) -- [Example](#section11196165315262) -- [Output](#section1073811415613) +# rmdir + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-statfs.md b/en/device-dev/kernel/kernel-small-debug-shell-file-statfs.md index 06d2354bc35b838710b948b9816f1fc6174f68d8..c38afd907c2de80ad20cf76d6af622462d398a9e 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-statfs.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-statfs.md @@ -1,10 +1,5 @@ -# statfs +# statfs -- [Command Function](#section153921657152613) -- [Syntax](#section135391102717) -- [Parameters](#section074312314279) -- [Usage](#section133816772712) -- [Example](#section526149182717) ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-sync.md b/en/device-dev/kernel/kernel-small-debug-shell-file-sync.md index 6e8c72e2860cedbf488af181519fdaebe5f653b6..33670c9ca1cf5026325f11b933ab7335e46a6539 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-sync.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-sync.md @@ -1,11 +1,5 @@ -# sync - -- [Command Function](#section1285017122274) -- [Syntax](#section4731516162712) -- [Parameters](#section9352418122714) -- [Usage](#section10725192142717) -- [Example](#section414434814354) -- [Output](#section19618121710317) +# sync + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-touch.md b/en/device-dev/kernel/kernel-small-debug-shell-file-touch.md index 8120954beaf52a99c11fdd53697db62f720889dd..e2ef6986f051af559c6af8c77f26309b53123371 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-touch.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-touch.md @@ -1,11 +1,5 @@ -# touch - -- [Command Function](#section17541924112716) -- [Syntax](#section866182711274) -- [Parameters](#section268912296270) -- [Usage](#section412093332714) -- [Example](#section414434814354) -- [Output](#section1028419515711) +# touch + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-umount.md b/en/device-dev/kernel/kernel-small-debug-shell-file-umount.md index 59740a697048884ef6adeec2ffab1003caa90211..a3b41c10707376fc70af957aeb20adcd0fdbb797 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-umount.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-umount.md @@ -1,11 +1,5 @@ -# umount - -- [Command Function](#section365125133520) -- [Syntax](#section9615254123512) -- [Parameters](#section63446577355) -- [Usage](#section92931509368) -- [Example](#section144311323616) -- [Output](#section360525113611) +# umount + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file-write.md b/en/device-dev/kernel/kernel-small-debug-shell-file-write.md index 1957be6872d73e92c9e4d424ddea02072a1bf62f..f48ee11f17a53f04a3e1a197942e43dc6e167af1 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file-write.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file-write.md @@ -1,11 +1,5 @@ -# writeproc - -- [Command Function](#section366714216619) -- [Syntax](#section8833164614615) -- [Parameters](#section12809111019453) -- [Usage](#section15935131220717) -- [Example](#section79281818476) -- [Output](#section12742311179) +# writeproc + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-file.md b/en/device-dev/kernel/kernel-small-debug-shell-file.md index 52a4812f6c0ed497253ef8d3a1cb7d622d933ef2..c9e90ebd48e2a61e0016fabee741ae227b42da99 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-file.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-file.md @@ -1,4 +1,4 @@ -# File Commands +# File Commands - **[cat](kernel-small-debug-shell-file-cat.md)** diff --git a/en/device-dev/kernel/kernel-small-debug-shell-guide.md b/en/device-dev/kernel/kernel-small-debug-shell-guide.md index 588af244e9bdf0bf2a306b9cde20ad577c4bdb1d..d20dd2abf4420eb5f115171aafaa697108f38ed7 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-guide.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-guide.md @@ -1,6 +1,5 @@ -# Shell Command Development Guidelines +# Shell Command Development Guidelines -- [Development Guidelines](#section13408945163812) ## Development Guidelines diff --git a/en/device-dev/kernel/kernel-small-debug-shell-magickey.md b/en/device-dev/kernel/kernel-small-debug-shell-magickey.md index 55133e1e74fb1d191ef14a2d53a534a52fccce26..95dd7f69f0160ae301c51a210ddb51c3c357728b 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-magickey.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-magickey.md @@ -1,7 +1,5 @@ -# Magic Key +# Magic Key -- [When to Use](#section2350114718546) -- [How to Use](#section3305151511559) ## When to Use diff --git a/en/device-dev/kernel/kernel-small-debug-shell-net-arp.md b/en/device-dev/kernel/kernel-small-debug-shell-net-arp.md index c34a87ecc68ac9f41d46278fcb3a9a7fe3b29d70..87b2afa6260a345d8e47c09398acf62b08c2ada0 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-net-arp.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-net-arp.md @@ -1,10 +1,5 @@ -# arp +# arp -- [Command Function](#section201149459368) -- [Syntax](#section579813484364) -- [Parameters](#section168065311366) -- [Usage](#section19190125723612) -- [Example](#section10383416372) ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-net-dhclient.md b/en/device-dev/kernel/kernel-small-debug-shell-net-dhclient.md index 78249ea694a3c76e83c04e03360c51dcd59b0df5..afb2a55f32fe6475e94f19765a822036c28fb4e1 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-net-dhclient.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-net-dhclient.md @@ -1,10 +1,5 @@ -# dhclient +# dhclient -- [Command Function](#section366714216619) -- [Syntax](#section8833164614615) -- [Parameters](#section12809111019453) -- [Usage](#section15935131220717) -- [Example](#section79281818476) ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-net-ifconfig.md b/en/device-dev/kernel/kernel-small-debug-shell-net-ifconfig.md index aa2b178e1bd86e40a0bf24a6716bc2cdecd61e66..be7d8a835a2944e3303cf6a4a182f8bebf42da94 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-net-ifconfig.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-net-ifconfig.md @@ -1,11 +1,5 @@ -# ifconfig - -- [Command Function](#section174940284379) -- [Syntax](#section136073203715) -- [Parameters](#section6493235203710) -- [Usage](#section05763403371) -- [Example](#section168802042123717) -- [Output](#section124638211109) +# ifconfig + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-net-ipdebug.md b/en/device-dev/kernel/kernel-small-debug-shell-net-ipdebug.md index a60ad4db5e88f9580e412caa7601d7ed79f17a13..e3dcce0bd9ac649fa5fb5ad82b8f77d714afae9c 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-net-ipdebug.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-net-ipdebug.md @@ -1,9 +1,5 @@ -# ipdebug +# ipdebug -- [Command Function](#section10191115553720) -- [Syntax](#section124061758123713) -- [Example](#section171837113810) -- [Output](#section561416467104) ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-net-netstat.md b/en/device-dev/kernel/kernel-small-debug-shell-net-netstat.md index c99cd1a796df69b7dfa92f1cd6412008fec96313..a383b945766d96178bdf52cd532a315bed2ed6b2 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-net-netstat.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-net-netstat.md @@ -1,11 +1,5 @@ -# netstat - -- [Command Function](#section13469162113816) -- [Syntax](#section795712373812) -- [Parameters](#section17629431193817) -- [Usage](#section5277153519380) -- [Example](#section108141437163820) -- [Output](#section1357015107117) +# netstat + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-net-ntpdate.md b/en/device-dev/kernel/kernel-small-debug-shell-net-ntpdate.md index b2ad34fa981fec5863e88f049cef48fdf6916e8c..f3fa527279212dab09ad895b48872ca143a67926 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-net-ntpdate.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-net-ntpdate.md @@ -1,11 +1,5 @@ -# ntpdate - -- [Command Function](#section38494293815) -- [Syntax](#section5503114413387) -- [Parameters](#section136934472383) -- [Usage](#section121401651173816) -- [Example](#section3431554203811) -- [Output](#section18638194610115) +# ntpdate + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-net-ping.md b/en/device-dev/kernel/kernel-small-debug-shell-net-ping.md index f9252678e13010aaa6d6c306af87c7d7907c900c..5c709aaaf0bae7a78dda6e8cc5060c6832d176fb 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-net-ping.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-net-ping.md @@ -1,11 +1,5 @@ -# ping - -- [Command Function](#section119672573385) -- [Syntax](#section869419010390) -- [Parameters](#section9877183173918) -- [Usage](#section1097046193914) -- [Example](#section14564129113911) -- [Output](#section1621732891215) +# ping + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-net-ping6.md b/en/device-dev/kernel/kernel-small-debug-shell-net-ping6.md index 4c91d848aafb7606eec15903923744764d4b8b42..e1ec3b85298b9e1a10a048518f13339cf1f111a7 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-net-ping6.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-net-ping6.md @@ -1,11 +1,5 @@ -# ping6 - -- [Command Function](#section1057291313393) -- [Syntax](#section199901315123919) -- [Parameters](#section4679319113919) -- [Usage](#section1127917226399) -- [Example](#section7211192553917) -- [Output](#section4846145221215) +# ping6 + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-net-telnet.md b/en/device-dev/kernel/kernel-small-debug-shell-net-telnet.md index 5ab95a89bcc3dd596a46a1b08d45d43a5377fd20..8f20d27c6d8f9f31ea7f77f27145e6aea87586c0 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-net-telnet.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-net-telnet.md @@ -1,11 +1,5 @@ -# telnet - -- [Command Function](#section3551830123913) -- [Syntax](#section14897133233918) -- [Parameters](#section977718353392) -- [Usage](#section134991538183916) -- [Example](#section1097414426398) -- [Output](#section11846624191310) +# telnet + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-net-tftp.md b/en/device-dev/kernel/kernel-small-debug-shell-net-tftp.md index 21983306a479c883a6da6914cb80bbd9007cf0cf..d5fd3fb26a5f92d87861acac6ac609c95d241ff0 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-net-tftp.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-net-tftp.md @@ -1,11 +1,5 @@ -# tftp - -- [Command Function](#section15142134573911) -- [Syntax](#section20958174917394) -- [Parameters](#section576613532395) -- [Usage](#section149795134408) -- [Example](#section148921918114015) -- [Output](#section7872155631313) +# tftp + ## Command Function diff --git a/en/device-dev/kernel/kernel-small-debug-shell-net.md b/en/device-dev/kernel/kernel-small-debug-shell-net.md index aa54200f3349d62c1c385aa732efba529d3a7b04..98a9d138de82a5d2d49bed1142d18c859b9deffa 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-net.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-net.md @@ -1,4 +1,4 @@ -# Network Commands +# Network Commands - **[arp](kernel-small-debug-shell-net-arp.md)** diff --git a/en/device-dev/kernel/kernel-small-debug-shell-overview.md b/en/device-dev/kernel/kernel-small-debug-shell-overview.md index a69788187bca2ce07c451898409cd3e6cd26e13f..5ac89f7eb900197534dca3a3d73846a9bdde0b6f 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell-overview.md +++ b/en/device-dev/kernel/kernel-small-debug-shell-overview.md @@ -1,6 +1,5 @@ -# Introduction to the Shell +# Introduction to the Shell -- [Important Notes](#section12298165312328) The shell provided by the OpenHarmony kernel supports commonly used debugging commands. You can also add and customize commands to the shell of the OpenHarmony kernel to address your service needs. The common debugging commands include the following: @@ -13,7 +12,7 @@ The shell provided by the OpenHarmony kernel supports commonly used debugging co For details about how to add a command, see [Shell Command Development Guidelines](kernel-small-debug-shell-guide.md) and [Shell Command Programming Example](kernel-small-debug-shell-build.md). -## Important Notes +## Important Notes Note the following when using the shell: @@ -30,7 +29,7 @@ Note the following when using the shell: - The shell functions do not comply with the POSIX standards and are used only for debugging. - >![](../public_sys-resources/icon-notice.gif) **NOTICE:** + >![](../public_sys-resources/icon-notice.gif) **NOTICE**
>The shell functions are used for debugging only and can be enabled only in the Debug version \(by enabling the **LOSCFG\_DEBUG\_VERSION** configuration item using **menuconfig**\). diff --git a/en/device-dev/kernel/kernel-small-debug-shell.md b/en/device-dev/kernel/kernel-small-debug-shell.md index 20453c471554d67b97c034cb4e728b50ae763666..6ba06142032d708877003a8e31c2e0e977697b24 100644 --- a/en/device-dev/kernel/kernel-small-debug-shell.md +++ b/en/device-dev/kernel/kernel-small-debug-shell.md @@ -1,4 +1,4 @@ -# Shell +# Shell - **[Introduction to the Shell](kernel-small-debug-shell-overview.md)** diff --git a/en/device-dev/kernel/kernel-small-debug-trace-other-faqs.md b/en/device-dev/kernel/kernel-small-debug-trace-other-faqs.md index 23ec4cbd34c981cb8d95125ebf15aaa4eec3f0d6..8cbc55530c9bfe3e7dc9069e8b810cbcf466b5f4 100644 --- a/en/device-dev/kernel/kernel-small-debug-trace-other-faqs.md +++ b/en/device-dev/kernel/kernel-small-debug-trace-other-faqs.md @@ -1,14 +1,10 @@ -# Common Fault Locating Methods - -- [Locating the Fault Based on Exception Information](#section695838161711) -- [Checking Memory Pool Integrity](#section362917569179) -- [Locating Memory Overwriting for a Global Variable](#section18971311121816) +# Common Fault Locating Methods ## Locating the Fault Based on Exception Information When the system is suspended unexpectedly, information about key registers is displayed on the serial port, as shown in the following figure. The information can be used to locate the function where the exception occurs and the related call stack. -**Figure 1** Exception information +**Figure 1** Exception information ![](figures/exception-information.png "exception-information") The exception information in the preceding figure is described as follows: @@ -23,13 +19,13 @@ The exception information in the preceding figure is described as follows: You also need to check the **OHOS\_Image.asm** file \(assembly file corresponding to the burnt system image **OHOS\_Image.bin**\) in the **out** directory to determine the locations of the instructions corresponding to **pc** and **lr**. Based on the locations of the instructions, determine the functions using the instructions and the functions where **lr**s are located in sequence. In this way, you can obtain the function call relationships when the exception occurs. -## Checking Memory Pool Integrity +## Checking Memory Pool Integrity You may not directly locate the fault only with the exception information. Sometimes, the fault cannot be located due to incorrect register values. If you suspect that the fault is caused by heap memory overwriting, you can call **LOS\_MemIntegrityCheck** to check the memory pool integrity. The **LOS\_MemIntegrityCheck** function traverses all nodes in the dynamic memory pool of the system. If all nodes are normal, the function returns **0** and no information is printed. Otherwise, error information is printed. This function uses **\(VOID \*\)OS\_SYS\_MEM\_ADDR** as the input parameter. Generally, **LOS\_MemIntegrityCheck** is called before and after the suspected service logic code to locate the heap memory overwriting. If the service code is correct, **LOS\_MemIntegrityCheck** can be called successfully. By doing this, you can improve the troubleshooting efficiency. -## Locating Memory Overwriting for a Global Variable +## Locating Memory Overwriting for a Global Variable If the memory of a global variable is illegally accessed, locate the address of the global variable in the **OHOS\_Image.map** file and pay special attention to the variables recently used before the address. There is a high probability that memory overwriting occurs when the preceding variables \(especially variables of the array type or variables that are forcibly converted to other types\) are used. diff --git a/en/device-dev/kernel/kernel-small-debug-trace-other-lastwords.md b/en/device-dev/kernel/kernel-small-debug-trace-other-lastwords.md index 30a55b45f4f77ae692f101d9e15cfb63735a1e71..094a0d208bd8541951f5f9095efee92aaf534564 100644 --- a/en/device-dev/kernel/kernel-small-debug-trace-other-lastwords.md +++ b/en/device-dev/kernel/kernel-small-debug-trace-other-lastwords.md @@ -1,9 +1,4 @@ -# Dying Gasp - -- [When to Use](#section158501652121514) -- [Available APIs](#section1186411122215) -- [Parameters](#section1083765723015) -- [How to Develop](#section783435801510) +# Dying Gasp ## When to Use diff --git a/en/device-dev/kernel/kernel-small-debug-trace.md b/en/device-dev/kernel/kernel-small-debug-trace.md index 915532ce6a867d63a8d3689ac476649e42877851..b808e35d2515e9ede4def18ec35fd7a06a638d59 100644 --- a/en/device-dev/kernel/kernel-small-debug-trace.md +++ b/en/device-dev/kernel/kernel-small-debug-trace.md @@ -1,17 +1,4 @@ -# Trace - -- [Basic Concepts](#section531482192018) -- [Working Principles](#section5125124532010) -- [Available APIs](#section17747184017458) - - [Kernel Mode](#section104473014465) - - [User Mode](#section1996920294531) - -- [Development Guidelines](#section10302175017543) - - [Kernel-mode Development Process](#section04021008552) - -- [Kernel-mode Programming Example](#section112034213583) -- [Kernel-mode Sample Code](#section10348549155812) -- [Verification](#section8601444165916) +# Trace ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-debug-user-concept.md b/en/device-dev/kernel/kernel-small-debug-user-concept.md index e7deb11d9233d832e793fe3bd55f05adab2859de..6d9234ff74cf02724b3c6ebe404a7e760103f81f 100644 --- a/en/device-dev/kernel/kernel-small-debug-user-concept.md +++ b/en/device-dev/kernel/kernel-small-debug-user-concept.md @@ -1,4 +1,4 @@ -# Basic Concepts +# Basic Concepts The musl libc library of the debug version provides maintenance and test methods, such as memory leak check, heap memory statistics, memory corruption check, and backtrace, to improve the efficiency of locating memory problems in user space. diff --git a/en/device-dev/kernel/kernel-small-debug-user-faqs.md b/en/device-dev/kernel/kernel-small-debug-user-faqs.md index ec114f13d974efbdd966f916e6e905c73af42648..756cad3e586b1716aa63ef8de09b0d28413a09df 100644 --- a/en/device-dev/kernel/kernel-small-debug-user-faqs.md +++ b/en/device-dev/kernel/kernel-small-debug-user-faqs.md @@ -1,8 +1,5 @@ -# Typical Memory Problems +# Typical Memory Problems -- [Use After Free \(UAF\)](#section4427132815445) -- [Double Free](#section827194818458) -- [Heap Memory Node Corrupted](#section1763741216461) ## Use After Free \(UAF\) diff --git a/en/device-dev/kernel/kernel-small-debug-user-function.md b/en/device-dev/kernel/kernel-small-debug-user-function.md index 873cc69210029add9f52a8dcd13625b6f59e6a76..552ccee3423e29b38b97eb79360286ff2cc1926c 100644 --- a/en/device-dev/kernel/kernel-small-debug-user-function.md +++ b/en/device-dev/kernel/kernel-small-debug-user-function.md @@ -1,8 +1,4 @@ -# Working Principles - -- [Memory Leak Check](#section142061581018) -- [Heap Memory Statistics](#section136902041337) -- [Memory Integrity Check](#section196491231761) +# Working Principles ## Memory Leak Check diff --git a/en/device-dev/kernel/kernel-small-debug-user-guide-api.md b/en/device-dev/kernel/kernel-small-debug-user-guide-api.md index dd4edac33c85d74bfb8bda00e278c2d0988675c7..aa4aa98b5ce50f7085a94ccdafc07f073ae36759 100644 --- a/en/device-dev/kernel/kernel-small-debug-user-guide-api.md +++ b/en/device-dev/kernel/kernel-small-debug-user-guide-api.md @@ -1,4 +1,4 @@ -# API Description +# Available APIs **Table 1** Memory debugging module APIs diff --git a/en/device-dev/kernel/kernel-small-debug-user-guide-use-api.md b/en/device-dev/kernel/kernel-small-debug-user-guide-use-api.md index 2841f08b6e801f7eb12251102f22bdb1acedf249..4160dfa63d23648e398a6e5bbc043a0ba5b48a09 100644 --- a/en/device-dev/kernel/kernel-small-debug-user-guide-use-api.md +++ b/en/device-dev/kernel/kernel-small-debug-user-guide-use-api.md @@ -1,9 +1,5 @@ -# Calling APIs +# Calling APIs -- [Sample Code](#section5490173592518) -- [Compilation](#section534302242515) -- [Debugging Information](#section1017419992515) -- [Call Stack Parsing](#section1485163282417) ## Sample Code @@ -37,13 +33,13 @@ int main() } ``` -## Compilation +## Compilation ``` $ clang -o mem_check mem_check.c -funwind-tables -rdynamic -g -mfloat-abi=softfp -mcpu=cortex-a7 -mfpu=neon-vfpv4 -target arm-liteos --sysroot=/home//directory/out/hispark_taurus/ipcamera_hispark_taurus/sysroot $(clang -mfloat-abi=softfp -mcpu=cortex-a7 -mfpu=neon-vfpv4 -target arm-liteos -print-file-name=libunwind.a) ``` ->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](../public_sys-resources/icon-note.gif) **NOTE**
>- In this example, the compiler path is written into an environment variable in the **.bashrc** file. >- When compiling user programs and required libraries, add the option **-funwind-tables -rdynamic -g** for stack backtracking. >- The **-mfloat-abi=softfp**, **-mcpu=cortex-a7**, and **-mfpu=neon-vfpv4** options specify the floating-point calculation optimization, chip architecture, and FPU, which must be the same as the compilation options used by the libc library. Otherwise, the libc library file cannot be found during the link time. @@ -51,7 +47,7 @@ $ clang -o mem_check mem_check.c -funwind-tables -rdynamic -g -mfloat-abi=softfp >- **--sysroot=/home//directory/out/hispark\_taurus/ipcamera\_hispark\_taurus/sysroot** specifies the root directory of the compiler library files. In this example, the OpenHarmony project code is stored in **/home//directory**. The **out/hispark\_taurus/ipcamera\_hispark\_taurus** directory indicates the product specified by the **hb set** command during compilation. In this example, **ipcamera\_hispark\_taurus** is the product specified. >- **$\(clang -mfloat-abi=softfp -mcpu=cortex-a7 -mfpu=neon-vfpv4 -target arm-liteos -print-file-name=libunwind.a\)** specifies the path of the unwind library. -## Debugging Information +## Debugging Information ``` OHOS # ./mem_check @@ -102,7 +98,7 @@ Check heap integrity ok! // Heap memory integrity check Check heap integrity ok! ``` -## Call Stack Parsing +## Call Stack Parsing The **parse\_mem\_info.sh** script in **kernel/liteos\_a/tools/scripts/parse\_memory/** can be used to parse the call stack. You can use the script to convert the debug information into specific source code line number. In the following command, **mem\_debug.txt** stores the memory debugging information, and **elf1** and **elf2** are the executable and linkable format \(ELF\) files to parse. diff --git a/en/device-dev/kernel/kernel-small-debug-user-guide-use-cli.md b/en/device-dev/kernel/kernel-small-debug-user-guide-use-cli.md index 5d6a69f907560cb76c18ded46088ee78a6866544..14843967675e1bc67e40ad5dd014c0bb18333329 100644 --- a/en/device-dev/kernel/kernel-small-debug-user-guide-use-cli.md +++ b/en/device-dev/kernel/kernel-small-debug-user-guide-use-cli.md @@ -1,10 +1,4 @@ -# Using the CLI - -- [Sample Code](#section13793104782316) -- [Compilation](#section1676431122320) -- [Running the mwatch Command](#section1703415132311) -- [Call Stack Parsing](#section1880675510221) -- [Running the mrecord Command](#section071022822210) +# Using the CLI In addition to calling APIs to check the memory used by user-mode processes, you can run CLI commands to collect memory statistics, check for memory leaks, and check memory integrity. @@ -46,11 +40,11 @@ int main() } ``` -## Compilation +## Compilation -For details, see [Calling APIs](kernel-small-debug-user-guide-use-api.md#section534302242515). +For details, see [Calling APIs](kernel-small-debug-user-guide-use-api.md#compilation). -## Running the mwatch Command +## Running the mwatch Command ``` OHOS # ./mem_check --mwatch // Run the task command to obtain the mem_check process PID, which is 4. @@ -114,7 +108,7 @@ Now using addr2line ... ==PID:4== SUMMARY: 0x640 byte(s) leaked in 2 allocation(s). ``` -## Running the mrecord Command +## Running the mrecord Command 1. Run the user program and specify the path of the file that stores the memory debugging information. @@ -224,6 +218,6 @@ Now using addr2line ... ``` ->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](../public_sys-resources/icon-note.gif) **NOTE**
>The preceding information recorded gradually is added to the file specified during initialization. Therefore, running the **cat** command can also display the historical information in the file. diff --git a/en/device-dev/kernel/kernel-small-debug-user-guide-use.md b/en/device-dev/kernel/kernel-small-debug-user-guide-use.md index cbdc9e1152b875c46e9dadc154b906b418311d08..87d8b3da62348a62c12f6ef3b01cad785c2b919d 100644 --- a/en/device-dev/kernel/kernel-small-debug-user-guide-use.md +++ b/en/device-dev/kernel/kernel-small-debug-user-guide-use.md @@ -1,4 +1,4 @@ -# How to Use +# How to Use By default, the OpenHarmony debug version is compiled when a project is built. The libc library of the debug version has integrated the APIs for memory debugging. You can enable memory debugging as required. @@ -7,7 +7,7 @@ You can perform heap memory debugging by using either of the following: - API: By calling APIs, you can accurately check the heap memory information of a specific code logic segment. However, you have to modify user code. - CLI: By using the CLI, you do not need to modify user code. However, you cannot accurately check the heap memory information of a specific logic segment. ->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](../public_sys-resources/icon-note.gif) **NOTE**
>After memory debugging is enabled, a heap memory leak check and a heap memory integrity check will be performed by default when a process exits. If memory debugging is disabled, the heap memory statistics, heap memory leak check, and heap memory integrity check cannot be enabled, and there is no response to the calling of any debug API. - **[Calling APIs](kernel-small-debug-user-guide-use-api.md)** diff --git a/en/device-dev/kernel/kernel-small-debug-user-guide.md b/en/device-dev/kernel/kernel-small-debug-user-guide.md index 49ba86149d6b654a7bf652160a6d8fee09351ac0..a5f0afa8562526ba98226a29cb4976660343d78b 100644 --- a/en/device-dev/kernel/kernel-small-debug-user-guide.md +++ b/en/device-dev/kernel/kernel-small-debug-user-guide.md @@ -1,6 +1,6 @@ -# Usage +# Usage -- **[API Description](kernel-small-debug-user-guide-api.md)** +- **[Available APIs](kernel-small-debug-user-guide-api.md)** - **[How to Use](kernel-small-debug-user-guide-use.md)** diff --git a/en/device-dev/kernel/kernel-small-debug-user.md b/en/device-dev/kernel/kernel-small-debug-user.md index e9add7160c36bf17c152f406cf65e18b978fc76a..f7707851b3114c97de3453cde6b073d2205e1f0d 100644 --- a/en/device-dev/kernel/kernel-small-debug-user.md +++ b/en/device-dev/kernel/kernel-small-debug-user.md @@ -1,4 +1,4 @@ -# User-Mode Memory Debugging +# User-Mode Memory Debugging - **[Basic Concepts](kernel-small-debug-user-concept.md)** diff --git a/en/device-dev/kernel/kernel-small-debug.md b/en/device-dev/kernel/kernel-small-debug.md index cea060e9cd0be22529d8dce9681572b99ef50a18..3ebc6a8edf49eca067dcac19e62c75b39ad72eaf 100644 --- a/en/device-dev/kernel/kernel-small-debug.md +++ b/en/device-dev/kernel/kernel-small-debug.md @@ -1,4 +1,4 @@ -# Debugging and Tools +# Debugging and Tools - **[Shell](kernel-small-debug-shell.md)** @@ -8,7 +8,7 @@ - **[LMS](kernel-small-memory-lms.md)** -- **[Process Commissioning](kernel-small-debug-process.md)** +- **[Process Debugging](kernel-small-debug-process.md)** - **[Kernel-Mode Memory Debugging](kernel-small-debug-memory.md)** diff --git a/en/device-dev/kernel/kernel-small-memory-lms.md b/en/device-dev/kernel/kernel-small-memory-lms.md index c18b5bf6206af5592c264317f8eb41b3248590ab..74595cb951918bad29df9240c52395866cc5e853 100644 --- a/en/device-dev/kernel/kernel-small-memory-lms.md +++ b/en/device-dev/kernel/kernel-small-memory-lms.md @@ -1,21 +1,4 @@ -# LMS - -- [Basic Concepts](#section531482192018) -- [Working Principles](#section5125124532010) -- [Available APIs](#section17747184017458) - - [Kernel Mode](#section104473014465) - - [User Mode](#section58151229172811) - -- [Development Guidelines](#section10302175017543) - - [Kernel-mode Development Process](#section04021008552) - -- [Kernel-mode Development Example](#section112034213583) -- [Kernel-mode Sample Code](#section10348549155812) - - [Kernel-mode Verification](#section61719481795) - - [User-mode Development Process](#section1425821711114) - - [User-mode Development Example](#section3470546163) - - [User-Mode Sample Code](#section183253286161) - - [User-mode Verification](#section5665123516214) +# LMS ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-small-overview.md b/en/device-dev/kernel/kernel-small-overview.md index f4d419fef1b10ae3de2fba8d51da60c3e6e4bce4..487282bb8d94453f5135596f2df393f91dbb2ae6 100644 --- a/en/device-dev/kernel/kernel-small-overview.md +++ b/en/device-dev/kernel/kernel-small-overview.md @@ -1,7 +1,6 @@ -# Kernel Overview +# Kernel Overview + -- [Overview](#section6614133913129) -- [Kernel Architecture](#section827143517385) ## Overview diff --git a/en/device-dev/kernel/kernel-small-start-kernel.md b/en/device-dev/kernel/kernel-small-start-kernel.md index af89550ddf6ddf59b4032f4f3525d08794f09e2c..c92af04ba02216c05708e280bd427b7b8cb128d8 100644 --- a/en/device-dev/kernel/kernel-small-start-kernel.md +++ b/en/device-dev/kernel/kernel-small-start-kernel.md @@ -1,8 +1,4 @@ -# Startup in Kernel Mode - -- [Kernel Startup Process](#section9882154318299) -- [Programming Example](#section19145114703217) - - [Example Description](#section1045483642518) +# Startup in Kernel Mode ## Kernel Startup Process diff --git a/en/device-dev/kernel/kernel-small-start-user.md b/en/device-dev/kernel/kernel-small-start-user.md index c1c910972caa8782023bbae7e37ac5e5b54c7c05..f2526dda1e39f972865de8ae98f29fbffb24fd22 100644 --- a/en/device-dev/kernel/kernel-small-start-user.md +++ b/en/device-dev/kernel/kernel-small-start-user.md @@ -1,10 +1,4 @@ -# Startup in User Mode - -- [Startup of the Root Process in User Mode](#section79911135647) - - [Startup Process of the Root Process](#section1184317581349) - - [Responsibilities of the Root Process](#section1590220321759) - -- [Running Programs in User Mode](#section194576310611) +# Startup in User Mode ## Startup of the Root Process in User Mode diff --git a/en/device-dev/kernel/kernel-small-start.md b/en/device-dev/kernel/kernel-small-start.md index 72217136ac8dec2d69fcd8e62d833888cc314ac2..4f428bbb9f4dbe54cb6a3e8af4277f7b4340d962 100644 --- a/en/device-dev/kernel/kernel-small-start.md +++ b/en/device-dev/kernel/kernel-small-start.md @@ -1,4 +1,4 @@ -# Kernel Startup +# Kernel Startup - **[Startup in Kernel Mode](kernel-small-start-kernel.md)** diff --git a/en/device-dev/kernel/kernel-small.md b/en/device-dev/kernel/kernel-small.md index 755241d1b3ff7c8f4a7cd56707b6d505a83b8a46..07fae1d789b3870ecd390ac99d2dfdba40066be5 100644 --- a/en/device-dev/kernel/kernel-small.md +++ b/en/device-dev/kernel/kernel-small.md @@ -1,4 +1,4 @@ -# Kernel for the Small System +# Small-System Kernel - **[Kernel Overview](kernel-small-overview.md)** diff --git a/en/device-dev/kernel/kernel-standard-build.md b/en/device-dev/kernel/kernel-standard-build.md index da43934349c9513ca45a88168d8b1cd8628b39dc..747c9133458aec67156d3a1200d705b1a45df4a5 100644 --- a/en/device-dev/kernel/kernel-standard-build.md +++ b/en/device-dev/kernel/kernel-standard-build.md @@ -1,8 +1,6 @@ -# Compiling and Building the Linux Kernel +# Compiling and Building the Linux Kernel -- [Example 1](#section19369206113115) - -## Example 1 +## Example 1 The following uses the Hi3516D V300 board and Ubuntu x86 server as an example. diff --git a/en/device-dev/kernel/kernel-standard-mm-eswap.md b/en/device-dev/kernel/kernel-standard-mm-eswap.md index 0a4f464ec0d123c289f5c0614d9575cdf77a18f4..e44534ed70119aea30ec3b406f775d39732caaa0 100644 --- a/en/device-dev/kernel/kernel-standard-mm-eswap.md +++ b/en/device-dev/kernel/kernel-standard-mm-eswap.md @@ -1,4 +1,4 @@ -# Enhanced SWAP +# Enhanced Swap ## Basic Concepts diff --git a/en/device-dev/kernel/kernel-standard-mm.md b/en/device-dev/kernel/kernel-standard-mm.md index e9e248174ff7f4b8cd2ae6d2152aea5d2f62af0d..43e90bd327dfe1a34644860cdf8fc21dce451a99 100644 --- a/en/device-dev/kernel/kernel-standard-mm.md +++ b/en/device-dev/kernel/kernel-standard-mm.md @@ -1,4 +1,4 @@ # Memory Management -- **[Enhanced SWAP](kernel-standard-mm-eswap.md)** +- **[Enhanced Swap](kernel-standard-mm-eswap.md)** diff --git a/en/device-dev/kernel/kernel-standard-overview.md b/en/device-dev/kernel/kernel-standard-overview.md index 0bb067e3ff7afa0bdef3c1c7001d928620095154..8c9fdc21f6e0eb3771f631843bb40e4dff2f42d4 100644 --- a/en/device-dev/kernel/kernel-standard-overview.md +++ b/en/device-dev/kernel/kernel-standard-overview.md @@ -1,11 +1,9 @@ -# Linux Kernel Overview +# Linux Kernel Overview -- [Linux Kernel Versions](#section152847516485) -- [OpenHarmony Kernel Version Selection](#section2716416191715) OpenHarmony adopts the Linux kernel as the basic kernel for standard-system devices \(reference memory ≥ 128 MiB\) so that appropriate OS kernels can be selected for the devices subject to resource limitations and therefore provide basic capabilities for upper-layer apps. -## Linux Kernel Versions +## Linux Kernel Versions Linux kernel versions are classified into the stable version and long-term support \(LTS\) version. @@ -13,7 +11,7 @@ The stable version is released approximately every 3 months to support the lates The LTS version provides long-term kernel maintenance \(in fixing bugs and security vulnerabilities\). Generally, the maintenance lifespan is six years. By contrast, non-LTS kernel versions whose maintenance lifespan ranges from six months to two years cannot cover the entire lifespan of their products and may leave the products open to security vulnerabilities. In addition, new features are not added in the LTS version update, which ensures the version stability. Therefore, LTS versions are more suitable for commercial products that pursue stability and security. -## OpenHarmony Kernel Version Selection +## OpenHarmony Kernel Version Selection The Linux kernel in OpenHarmony selects appropriate LTS versions as its basic versions. Currently, it supports Linux-4.19 and Linux-5.10. diff --git a/en/device-dev/kernel/kernel-standard-patch.md b/en/device-dev/kernel/kernel-standard-patch.md index 029de25eb881cacd4556235bc4c067b7f15b27ae..9845278874991b0c820ae147e7532ac9a41ef1cf 100644 --- a/en/device-dev/kernel/kernel-standard-patch.md +++ b/en/device-dev/kernel/kernel-standard-patch.md @@ -1,4 +1,4 @@ -# Applying Patches on Development Boards +# Applying Patches on Development Boards 1. Apply the HDF patches. @@ -32,7 +32,7 @@ DEFCONFIG_FILE := $(DEVICE_NAME)_$(BUILD_TYPE)_defconfig ``` - >![](../public_sys-resources/icon-notice.gif) **NOTICE:** + >![](../public_sys-resources/icon-notice.gif) **NOTICE**
>In the OpenHarmony project build process, patches are applied after the code environment of **kernel/linux/linux-\*.\*** is copied. Before running the OpenHarmony version-level build command, ensure that the source code environment of **kernel/linux/linux-\*.\*** is available. >After the build is complete, the kernel is generated in the kernel directory in the **out** directory. Modify the **config** file based on the kernel generated, and copy the generated **.config** file to the corresponding path in the **config** repository. Then, the configuration takes effect. diff --git a/en/device-dev/kernel/kernel-standard.md b/en/device-dev/kernel/kernel-standard.md index 3eff0592d9c5869fa638e9f5d15ef3b6db2edd3a..7b17c73bbbd6875b71e1fbd55db008660c934dfa 100644 --- a/en/device-dev/kernel/kernel-standard.md +++ b/en/device-dev/kernel/kernel-standard.md @@ -1,4 +1,4 @@ -# Kernel for the Standard System +# Standard-System Kernel - **[Linux Kernel Overview](kernel-standard-overview.md)** diff --git a/en/device-dev/kernel/kernel.md b/en/device-dev/kernel/kernel.md index f633268641c19f7c3000eadec03834f1c6514d91..d62304607bb9fea5beafce206189e58e03622144 100644 --- a/en/device-dev/kernel/kernel.md +++ b/en/device-dev/kernel/kernel.md @@ -1,9 +1,8 @@ -# Kernel +# Kernel -- **[Kernel for Mini Systems](kernel-mini.md)** +- **[Mini-System Kernel](kernel-mini.md)** -- **[Kernel for Small Systems](kernel-small.md)** - -- **[User-Mode Memory Debugging](kernel-small-debug-user.md)** +- **[Small-System Kernel](kernel-small.md)** +- **[Standard-System Kernel](kernel-standard.md)** diff --git a/en/device-dev/porting/porting-linux-kernel.md b/en/device-dev/porting/porting-linux-kernel.md index 491355e6696898970d6ef3e3ca60445c32577e16..05b66768aa52ddc24b638cf88b2adbe8747c8b97 100644 --- a/en/device-dev/porting/porting-linux-kernel.md +++ b/en/device-dev/porting/porting-linux-kernel.md @@ -84,7 +84,7 @@ The following uses Raspberry Pi 3b \(BCM2837\) as an example to describe how to # Configure the build environment, and use clang provided by the project to build the Raspberry Pi kernel source code. export PATH=$PROJ_ROOT/prebuilts/clang/ohos/linux-x86_64/llvm/bin:$PROJ_ROOT/prebuilts/gcc/linux-x86/arm/gcc-linaro-7.5.0-arm-linux-gnueabi/bin/:$PATH export MAKE_OPTIONS="ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- CC=clang HOSTCC=clang" - export PRODUCT_PATH=vendor/hisilicon/Hi3516DV300 + export PRODUCT_PATH=vendor/hisilicon/hispark_taurus_standard ``` 3. Comment out the flags that cannot be recognized by **clang**. diff --git a/en/device-dev/quick-start/Readme-EN.md b/en/device-dev/quick-start/Readme-EN.md index 93481265a2d9310ffdb1818a4393804f0fe37b2e..1fb06af53be58306f25c68033f8db5dbd811e53f 100644 --- a/en/device-dev/quick-start/Readme-EN.md +++ b/en/device-dev/quick-start/Readme-EN.md @@ -2,7 +2,7 @@ - Getting Started with Mini and Small Systems (IDE Mode, Recommended) - [Mini and Small System Overview](quickstart-ide-lite-overview.md) - Environment Preparation - - [Setting Up the Windows+Ubuntu Hybrid Build Environment](quickstart-ide-lite-env-setup-win-ubuntu.md) + - [Setting Up the Windows+Ubuntu Hybrid Development Environment](quickstart-ide-lite-env-setup-win-ubuntu.md) - [Obtaining Source Code](quickstart-ide-lite-sourcecode-acquire.md) - [Creating a Source Code Project](quickstart-ide-lite-create-project.md) - Running a Hello World Program @@ -52,7 +52,7 @@ - Getting Started with Standard System (IDE Mode, Recommended) - [Standard System Overview](quickstart-ide-standard-overview.md) - Environment Preparation - - [Setting Up the Windows+Ubuntu Hybrid Build Environment](quickstart-ide-standard-env-setup-win-ubuntu.md) + - [Setting Up the Windows+Ubuntu Hybrid Development Environment](quickstart-ide-standard-env-setup-win-ubuntu.md) - [Obtaining Source Code](quickstart-ide-standard-sourcecode-acquire.md) - [Creating a Source Code Project](quickstart-ide-standard-create-project.md) - Running a Hello World Program diff --git a/en/device-dev/quick-start/quickstart-docker-lite.md b/en/device-dev/quick-start/quickstart-docker-lite.md index b0dedbd30e13ea886381add1820506fdf9e0d2d3..666b1510ff7b2346251cea45601e990ff5100d3e 100644 --- a/en/device-dev/quick-start/quickstart-docker-lite.md +++ b/en/device-dev/quick-start/quickstart-docker-lite.md @@ -4,7 +4,7 @@ - **[Mini and Small System Overview](quickstart-lite-overview.md)** -- **[Environment Preparation](quickstart-lite-env-setup.md)** +- **[Setting Up Environments for the Mini and Small Systems](quickstart-lite-env-setup.md)** - **[Running a Hello World Program](quickstart-lite-steps.md)** diff --git a/en/device-dev/quick-start/quickstart-ide-lite-create-project.md b/en/device-dev/quick-start/quickstart-ide-lite-create-project.md index 9227e669b4d34ca5453d2e392a3bc64604e055f5..37002b081cb5f699498cd8114ad89ee3a32ecece 100644 --- a/en/device-dev/quick-start/quickstart-ide-lite-create-project.md +++ b/en/device-dev/quick-start/quickstart-ide-lite-create-project.md @@ -10,7 +10,7 @@ After [setting up the Windows+Ubuntu hybrid development environment](../quick-st 2. Select the source code directory to be imported and click **Import**. - > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** + > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> Make sure the selected directory does not contain Chinese characters or spaces. Otherwise, the building may fail. ![en-us_image_0000001271477045](figures/en-us_image_0000001271477045.png) diff --git a/en/device-dev/quick-start/quickstart-ide-lite-env-setup-win-ubuntu.md b/en/device-dev/quick-start/quickstart-ide-lite-env-setup-win-ubuntu.md index fbed65d9a8e1c2f7c55c30c440d4a84a35e93ef1..b16ef9ebb0e6886773f01d1481b86f51720d1511 100644 --- a/en/device-dev/quick-start/quickstart-ide-lite-env-setup-win-ubuntu.md +++ b/en/device-dev/quick-start/quickstart-ide-lite-env-setup-win-ubuntu.md @@ -1,10 +1,10 @@ # Setting Up the Windows+Ubuntu Hybrid Development Environment -In embedded development, Windows-based tools, such as Visual Studio Code, are widely used in code editing. Yet, as the source code of most development boards, such as Hi3861 and Hi3516, cannot be built in Windows, these development boards require the Ubuntu build environment. +In embedded development, Windows-based tools, such as Visual Studio Code, are widely used in code editing. Yet, as the source code of most development boards, such as Hi3861 and Hi3516, cannot be built in Windows, these development boards require the Ubuntu development environment. -In the Windows+Ubuntu hybrid build environment, you can enjoy the benefits of both DevEco Device Tool for Windows and DevEco Device Tool for Ubuntu (where Visual Studio Code is optional). +In the Windows+Ubuntu hybrid development environment, you can enjoy the benefits of both DevEco Device Tool for Windows and DevEco Device Tool for Ubuntu (where Visual Studio Code is optional). ## System Requirements @@ -18,7 +18,7 @@ In the Windows+Ubuntu hybrid build environment, you can enjoy the benefits of bo - DevEco Device Tool: 3.0 Release -## Setting Up the Ubuntu Build Environment +## Setting Up the Ubuntu Development Environment The setup procedure varies, depending on whether you need a GUI. If you need a GUI, you need to install Visual Studio Code. In this case, follow the instructions in [Setting Up the Ubuntu Development Environment](https://device.harmonyos.com/en/docs/documentation/guide/ide-install-ubuntu-0000001072959308). If you do not need a GUI, perform the steps below: @@ -116,7 +116,7 @@ To remotely access the Ubuntu environment through Windows and enjoy the benefits ![en-us_image_0000001225760456](figures/en-us_image_0000001225760456.png) -## Configuring Windows to Remotely Access the Ubuntu Build Environment +## Configuring Windows to Remotely Access the Ubuntu Development Environment ### Installing the SSH Service and Obtaining the IP Address for Remote Access diff --git a/en/device-dev/quick-start/quickstart-ide-lite-env-setup.md b/en/device-dev/quick-start/quickstart-ide-lite-env-setup.md index a3722cf56712286e6bd5776e74b88470306f3261..e7461bde3df8da9ca14f7c3cbac5c36d1a37b6c5 100644 --- a/en/device-dev/quick-start/quickstart-ide-lite-env-setup.md +++ b/en/device-dev/quick-start/quickstart-ide-lite-env-setup.md @@ -2,6 +2,7 @@ -- **[Setting Up the Windows+Ubuntu Hybrid Build Environment](quickstart-ide-lite-env-setup-win-ubuntu.md)** +- **[Setting Up the Windows+Ubuntu Hybrid Development Environment](quickstart-ide-lite-env-setup-win-ubuntu.md)** - **[Obtaining Source Code](quickstart-ide-lite-sourcecode-acquire.md)** + diff --git a/en/device-dev/quick-start/quickstart-ide-lite-introduction-hi3516.md b/en/device-dev/quick-start/quickstart-ide-lite-introduction-hi3516.md index 4c85bdc37bd008627762569ba55a7bf7275ecaf8..68ec899169449ae2a1efced40511e095840d0de9 100644 --- a/en/device-dev/quick-start/quickstart-ide-lite-introduction-hi3516.md +++ b/en/device-dev/quick-start/quickstart-ide-lite-introduction-hi3516.md @@ -5,16 +5,16 @@ Hi3516D V300 is a next-generation system on chip (SoC) designed for the industry-dedicated smart HD IP camera. It introduces a next-generation image signal processor (ISP), the H.265 video compression encoder, and a high-performance NNIE engine, leading the industry in terms of low bit rate, high image quality, intelligent processing and analysis, and low power consumption. - **Figure 1** Hi3516 front view - +**Figure 1** Hi3516 front view + ![en-us_image_0000001271234717](figures/en-us_image_0000001271234717.png) ## Development Board Specifications - **Table 1** Hi3516 specifications +**Table 1** Hi3516 specifications -| Item| Description| +| Item| Description| | -------- | -------- | -| Processor and internal memory| - Hi3516D V300 chip
- DDR3 1GB
- eMMC 4.5, 8 GB capacity| -| External components| - Ethernet port
- Audio and video
  - 1 voice input
  - 1 mono channel (AC_L) output, connected to a 3 W power amplifier (LM4871)
  - MicroHDMI (1-channel HDMI 1.4)
- Camera
  - Sensor IMX335
  - M12 lens, 4 mm focal length, and 1.8 aperture
- Display
  - LCD connector (2.35-inch)
  - LCD connector (5.5-inch)
- External components and ports
  - Memory card port
  - JTAG/I2S port
  - ADC port
  - Steering gear port
  - Grove connector
  - USB 2.0 (Type-C)
  - Three function keys, two user-defined keys, and one upgrade key
  - LED indicator, green or red| +| Processor and internal memory| - Hi3516D V300 chip
- DDR3 1GB
- eMMC 4.5, 8 GB capacity| +| External components| - Ethernet port
- Audio and video
  - 1 voice input
  - 1 mono channel (AC_L) output, connected to a 3 W power amplifier (LM4871)
  - MicroHDMI (1-channel HDMI 1.4)
- Camera
  - Sensor IMX335
  - M12 lens, 4 mm focal length, and 1.8 aperture
- Display
  - LCD connector (2.35-inch)
  - LCD connector (5.5-inch)
- External components and ports
  - Memory card port
  - JTAG/I2S port
  - ADC port
  - Steering gear port
  - Grove connector
  - USB 2.0 (Type-C)
  - Three function keys, two user-defined keys, and one upgrade key
  - LED indicator, green or red| diff --git a/en/device-dev/quick-start/quickstart-ide-lite-introduction-hi3861.md b/en/device-dev/quick-start/quickstart-ide-lite-introduction-hi3861.md index fa6235602d1b4e080b703ff85a6651cc3bd19105..b32ea6e794af6c80dcd9059d70cbe8816906f1a7 100644 --- a/en/device-dev/quick-start/quickstart-ide-lite-introduction-hi3861.md +++ b/en/device-dev/quick-start/quickstart-ide-lite-introduction-hi3861.md @@ -5,14 +5,14 @@ Hi3861 is a 2 x 5 cm development board. It is a 2.4 GHz WLAN SoC chip that highly integrates the IEEE 802.11b/g/n baseband and radio frequency (RF) circuit. It supports OpenHarmony and provides an open and easy-to-use development and debugging environment. - **Figure 1** Hi3861 development board +**Figure 1** Hi3861 development board ![en-us_image_0000001226634692](figures/en-us_image_0000001226634692.png) The Hi3861 development board can also be connected to the Hi3861 mother board to expand its peripheral capabilities. The following figure shows the Hi3861 mother board. - **Figure 2** Hi3861 mother board - +**Figure 2** Hi3861 mother board + ![en-us_image_0000001226794660](figures/en-us_image_0000001226794660.png) - The RF circuit includes modules such as the power amplifier (PA), low noise amplifier (LNA), RF Balun, antenna switch, and power management. It supports a standard bandwidth of 20 MHz and a narrow bandwidth of 5 MHz or 10 MHz, and provides a maximum rate of 72.2 Mbit/s at the physical layer. @@ -35,34 +35,34 @@ The resources of the Hi3861 development board are limited. The entire board has ## Development Board Specifications - **Table 1** Hi3861 specifications +**Table 1** Hi3861 specifications -| Item| Description| +| Item| Description| | -------- | -------- | -| General specifications| - 1 x 1 2.4 GHz frequency band (ch1–ch14)
- PHY supports IEEE 802.11b/g/n.
- MAC supports IEEE802.11d/e/h/i/k/v/w.
- Built-in PA and LNA; integrated TX/RX switch and Balun
- Support for STA and AP modes. When functioning as an AP, it supports a maximum of 6 STAs.
- Support for WFA WPA/WPA2 personal and WPS2.0.
- 2/3/4-line PTA solution that coexists with BT/BLE chips.
- Input voltage range: 2.3 V to 3.6 V
- I/O power voltage: 1.8 V or 3.3 V.
- RF self-calibration
- Low power consumption:
  - Ultra Deep Sleep mode: 5 μA@3.3 V
  - DTIM1: 1.5 mA \@3.3V
  - DTIM3: 0.8 mA \@3.3V| -| PHY features| - Supports all data rates of the IEEE802.11b/g/n single antenna.
- Supported maximum rate: 72.2 Mbps\@HT20 MCS7
- 20 MHz standard bandwidth and 5 MHz/10 MHz narrow bandwidth.
-  STBC.
- Short-GI.| -| MAC features| - A-MPDU and A-MSDU.
- Blk-ACK.
- QoS to meet the quality requirements of different services.| -| CPU subsystem| -  High-performance 32-bit microprocessor with a maximum working frequency of 160 MHz.
- Embedded SRAM of 352 KB; ROM of 288 KB
- Embedded 2 MB flash memory| -| Peripheral ports| - One SDIO interface, two SPI interfaces, two I2C interfaces, three UART interfaces, 15 GPIO interfaces, seven ADC inputs, six PWM interfaces, and one I2S interface (Note: These interfaces are all multiplexed.)
- Frequency of the external main crystal: 40 MHz or 24 MHz| -| Others| - Package: QFN-32, 5 mm x 5 mm
- Working temperature: -40°C to +85°C| +| General specifications| - 1 x 1 2.4 GHz frequency band (ch1–ch14)
- PHY supports IEEE 802.11b/g/n.
- MAC supports IEEE802.11d/e/h/i/k/v/w.
- Built-in PA and LNA; integrated TX/RX switch and Balun
- Support for STA and AP modes. When functioning as an AP, it supports a maximum of 6 STAs.
- Support for WFA WPA/WPA2 personal and WPS2.0.
- 2/3/4-line PTA solution that coexists with BT/BLE chips.
- Input voltage range: 2.3 V to 3.6 V
- I/O power voltage: 1.8 V or 3.3 V.
- RF self-calibration
- Low power consumption:
  - Ultra Deep Sleep mode: 5 μA@3.3 V
  - DTIM1: 1.5 mA \@3.3V
  - DTIM3: 0.8 mA \@3.3V| +| PHY features| - Supports all data rates of the IEEE802.11b/g/n single antenna.
- Supported maximum rate: 72.2 Mbps\@HT20 MCS7
- 20 MHz standard bandwidth and 5 MHz/10 MHz narrow bandwidth.
-  STBC.
- Short-GI.| +| MAC features| - A-MPDU and A-MSDU.
- Blk-ACK.
- QoS to meet the quality requirements of different services.| +| CPU subsystem| -  High-performance 32-bit microprocessor with a maximum working frequency of 160 MHz.
- Embedded SRAM of 352 KB; ROM of 288 KB
- Embedded 2 MB flash memory| +| Peripheral ports| - One SDIO interface, two SPI interfaces, two I2C interfaces, three UART interfaces, 15 GPIO interfaces, seven ADC inputs, six PWM interfaces, and one I2S interface (Note: These interfaces are all multiplexed.)
- Frequency of the external main crystal: 40 MHz or 24 MHz| +| Others| - Package: QFN-32, 5 mm x 5 mm
- Working temperature: -40°C to +85°C| ## OpenHarmony Key Features OpenHarmony provides a wide array of available capabilities based on the Hi3861 platform. The following table describes the available key components. - **Table 2** Key components of OpenHarmony +**Table 2** Key components of OpenHarmony -| Component| Capability| +| Component| Capability| | -------- | -------- | -| WLAN| Provides the WLAN service capability. For example, connecting to or disconnecting from a station or hotspot, and querying the status of a station or hotspot.| -| IoT controller| Provides the capability of operating peripherals, including the I2C, I2S, ADC, UART, SPI, SDIO, GPIO, PWM and flash memory.| -| DSoftBus| Provides the capabilities of device discovery and data transmission in the distributed network.| -| hichainsdk| Provides the capability of securely transferring data between devices when they are interconnected.| -| huks| Provides capabilities of key management, encryption, and decryption.| -| System service management| Provides a unified OpenHarmony service development framework based on the service-oriented architecture.| -| Boot| Provides the entry identifier for starting a system service. When the system service management is started, the function identified by bootstrap is called to start a system service.| -| System attribute| Provides capabilities of obtaining and setting system attributes.| -| Base library| Provides the common basic library capability, including file operations and KV storage management.| -| DFX | Provides the DFX capability, such as logging and printing.| -| XTS | Provides a set of OpenHarmony certification test suites.| +| WLAN| Provides the WLAN service capability. For example, connecting to or disconnecting from a station or hotspot, and querying the status of a station or hotspot.| +| IoT controller| Provides the capability of operating peripherals, including the I2C, I2S, ADC, UART, SPI, SDIO, GPIO, PWM and flash memory.| +| DSoftBus| Provides the capabilities of device discovery and data transmission in the distributed network.| +| hichainsdk| Provides the capability of securely transferring data between devices when they are interconnected.| +| huks| Provides capabilities of key management, encryption, and decryption.| +| System service management| Provides a unified OpenHarmony service development framework based on the service-oriented architecture.| +| Boot| Provides the entry identifier for starting a system service. When the system service management is started, the function identified by bootstrap is called to start a system service.| +| System attribute| Provides capabilities of obtaining and setting system attributes.| +| Base library| Provides the common basic library capability, including file operations and KV storage management.| +| DFX | Provides the DFX capability, such as logging and printing.| +| XTS | Provides a set of OpenHarmony certification test suites.| diff --git a/en/device-dev/quick-start/quickstart-ide-lite-steps-hi3516-burn.md b/en/device-dev/quick-start/quickstart-ide-lite-steps-hi3516-burn.md index 2c23f4eec8a31da21b836de69b535b12ca8b9875..36a19432f9e567609a7c7a3b92d006d71a91ef2b 100644 --- a/en/device-dev/quick-start/quickstart-ide-lite-steps-hi3516-burn.md +++ b/en/device-dev/quick-start/quickstart-ide-lite-steps-hi3516-burn.md @@ -6,15 +6,15 @@ Hi3516D V300 supports burning through the USB port, network port, and serial por 1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3516D V300 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3516.md). -2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment). +2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment). - If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required. - If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon. ![en-us_image_0000001261395999](figures/en-us_image_0000001261395999.png) - > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** - > This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step. + > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+ > This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step. 3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool. diff --git a/en/device-dev/quick-start/quickstart-ide-lite-steps-hi3861-burn.md b/en/device-dev/quick-start/quickstart-ide-lite-steps-hi3861-burn.md index 3ebd031b51f4d1b0273c1ccb45990b0293c43436..72a07f63239b0a79da9958a8b1dc77fe964e51ab 100644 --- a/en/device-dev/quick-start/quickstart-ide-lite-steps-hi3861-burn.md +++ b/en/device-dev/quick-start/quickstart-ide-lite-steps-hi3861-burn.md @@ -6,7 +6,7 @@ Hi3861 V100 supports burning through the serial port. To burn source code throug 1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3861 V100 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3861.md). -2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment). +2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment). - If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required. - If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon. @@ -14,7 +14,7 @@ Hi3861 V100 supports burning through the serial port. To burn source code throug ![en-us_image_0000001261395999](figures/en-us_image_0000001261395999.png) > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** - > This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step. + > This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step. 3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool. diff --git a/en/device-dev/quick-start/quickstart-ide-standard-board-introduction-hi3516.md b/en/device-dev/quick-start/quickstart-ide-standard-board-introduction-hi3516.md index 250a2a496ed1f7e3aa84a564a3498fadedc5ad01..e27bfe3de9d731e002b47a69440684783b572069 100644 --- a/en/device-dev/quick-start/quickstart-ide-standard-board-introduction-hi3516.md +++ b/en/device-dev/quick-start/quickstart-ide-standard-board-introduction-hi3516.md @@ -5,16 +5,16 @@ Hi3516D V300 is a next-generation system on chip (SoC) designed for industry-dedicated smart HD IP cameras. It introduces a next-generation image signal processor (ISP), the H.265 video compression encoder, and a high-performance NNIE engine, leading the industry in terms of low bit rate, high image quality, intelligent processing and analysis, and low power consumption. - **Figure 1** Hi3516 front view +**Figure 1** Hi3516 front view ![en-us_image_0000001227082182](figures/en-us_image_0000001227082182.png) ## Development Board Specifications - **Table 1** Hi3516 specifications +**Table 1** Hi3516 specifications -| Item| Description| +| Item| Description| | -------- | -------- | -| Processor and internal memory| - Hi3516D V300 chip
- DDR3 1GB
- eMMC 4.5, 8 GB capacity| -| External components| - Ethernet port
- Audio and video
  - 1 voice input
  - 1 mono channel (AC_L) output, connected to a 3 W power amplifier (LM4871)
  - MicroHDMI (1-channel HDMI 1.4)
- Camera
  - Sensor IMX335
  - M12 lens, 4 mm focal length, and 1.8 aperture
- Display
  - LCD connector (2.35-inch)
  - LCD connector (5.5-inch)
- External components and ports
  - Memory card port
  - JTAG/I2S port
  - ADC port
  - Steering gear port
  - Grove connector
  - USB 2.0 (Type-C)
  - Three function keys, two user-defined keys, and one upgrade key
  - LED indicator, green or red| +| Processor and internal memory| - Hi3516D V300 chip
- DDR3 1GB
- eMMC 4.5, 8 GB capacity| +| External components| - Ethernet port
- Audio and video
  - 1 voice input
  - 1 mono channel (AC_L) output, connected to a 3 W power amplifier (LM4871)
  - MicroHDMI (1-channel HDMI 1.4)
- Camera
  - Sensor IMX335
  - M12 lens, 4 mm focal length, and 1.8 aperture
- Display
  - LCD connector (2.35-inch)
  - LCD connector (5.5-inch)
- External components and ports
  - Memory card port
  - JTAG/I2S port
  - ADC port
  - Steering gear port
  - Grove connector
  - USB 2.0 (Type-C)
  - Three function keys, two user-defined keys, and one upgrade key
  - LED indicator, green or red| diff --git a/en/device-dev/quick-start/quickstart-ide-standard-board-introduction-rk3568.md b/en/device-dev/quick-start/quickstart-ide-standard-board-introduction-rk3568.md index 6f74a5fa510bcea8b73cfff9cb70e29f50d6bf8f..e076fca68d808468d8eef98ff1bd46a89094f45e 100644 --- a/en/device-dev/quick-start/quickstart-ide-standard-board-introduction-rk3568.md +++ b/en/device-dev/quick-start/quickstart-ide-standard-board-introduction-rk3568.md @@ -5,7 +5,7 @@ Bolstered by the Rockchip RK3568 chip, the RK3568 development board integrates a dual-core GPU and high-efficiency NPU. Its quad-core 64-bit Cortex-A55 processor uses the advanced 22 nm manufacturing process and is clocked at up to 2.0 GHz. The development board is packed with Bluetooth, Wi-Fi, audio, video, and camera features, with a wide range of expansion ports as well as video input and output ports. It comes with dual GE auto-sensing RJ45 ports, so it can be used in multi-connectivity products, such as NVRs and industrial gateways. - **Figure 1** Front view of the RK3568 development board +**Figure 1** Front view of the RK3568 development board ![en-us_image_0000001271442261](figures/en-us_image_0000001271442261.png) diff --git a/en/device-dev/quick-start/quickstart-ide-standard-create-project.md b/en/device-dev/quick-start/quickstart-ide-standard-create-project.md index 5e1e39d880cc945e06b35db0607bc8752838d4d1..3ac2873105b2f43ad674ea99d4b698a5f5940451 100644 --- a/en/device-dev/quick-start/quickstart-ide-standard-create-project.md +++ b/en/device-dev/quick-start/quickstart-ide-standard-create-project.md @@ -10,7 +10,7 @@ After [setting up the Windows+Ubuntu hybrid development environment](../quick-st 2. Select the source code directory to be imported and click **Import**. - > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** + > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> Make sure the selected directory does not contain Chinese characters or spaces. Otherwise, the building may fail. ![en-us_image_0000001271562277](figures/en-us_image_0000001271562277.png) @@ -25,7 +25,7 @@ After [setting up the Windows+Ubuntu hybrid development environment](../quick-st 5. On the **Import Project** page, select a product, and the MCU, board, company, and kernel fields will be automatically populated. Then, select the OpenHarmony source code version for **ohosVersion**. The following figure uses **Hi3516DV300** as an example. - > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** + > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> - Set **Product** to **Hi3516DV300** for the Hi3516D V300 development board. > > - Set **Product** to **rk3568** for the RK3568 development board. diff --git a/en/device-dev/quick-start/quickstart-ide-standard-env-setup-win-ubuntu.md b/en/device-dev/quick-start/quickstart-ide-standard-env-setup-win-ubuntu.md index af96bb9caf70d0b72becd22ac8164ec08ba03d0b..0618faf0c02e4e5a3c72edeec4d204a6083026a6 100644 --- a/en/device-dev/quick-start/quickstart-ide-standard-env-setup-win-ubuntu.md +++ b/en/device-dev/quick-start/quickstart-ide-standard-env-setup-win-ubuntu.md @@ -1,10 +1,10 @@ # Setting Up the Windows+Ubuntu Hybrid Development Environment -In embedded development, Windows-based tools, such as Visual Studio Code, are widely used in code editing. Yet, as the source code of most development boards, such as Hi3861 and Hi3516, cannot be built in Windows, these development boards require the Ubuntu build environment. +In embedded development, Windows-based tools, such as Visual Studio Code, are widely used in code editing. Yet, as the source code of most development boards, such as Hi3861 and Hi3516, cannot be built in Windows, these development boards require the Ubuntu development environment. -In the Windows+Ubuntu hybrid build environment, you can enjoy the benefits of both DevEco Device Tool for Windows and DevEco Device Tool for Ubuntu (where Visual Studio Code is optional). +In the Windows+Ubuntu hybrid development environment, you can enjoy the benefits of both DevEco Device Tool for Windows and DevEco Device Tool for Ubuntu (where Visual Studio Code is optional). ## System Requirements @@ -18,9 +18,7 @@ In the Windows+Ubuntu hybrid build environment, you can enjoy the benefits of bo - DevEco Device Tool: 3.0 Release -## Setting Up the Ubuntu Build Environment - -The setup procedure varies, depending on whether you need a GUI. If you need a GUI, you need to install Visual Studio Code. In this case, follow the instructions in [Setting Up the Ubuntu Development Environment](https://device.harmonyos.com/en/docs/documentation/guide/ide-install-ubuntu-0000001072959308). If you do not need a GUI, perform the steps below: +## Setting Up the Ubuntu Development Environment 1. Make sure the Ubuntu shell environment is **bash**. @@ -116,7 +114,7 @@ To remotely access the Ubuntu environment through Windows and enjoy the benefits ![en-us_image_0000001225760456](figures/en-us_image_0000001225760456.png) -## Configuring Windows to Remotely Access the Ubuntu Build Environment +## Configuring Windows to Remotely Access the Ubuntu Development Environment ### Installing the SSH Service and Obtaining the IP Address for Remote Access diff --git a/en/device-dev/quick-start/quickstart-ide-standard-env-setup.md b/en/device-dev/quick-start/quickstart-ide-standard-env-setup.md index cb161ced75854ad67c97d548d0beb24bae637bfb..8faf2853a5d319958d0ebb4eeb6ebf1268cb0be0 100644 --- a/en/device-dev/quick-start/quickstart-ide-standard-env-setup.md +++ b/en/device-dev/quick-start/quickstart-ide-standard-env-setup.md @@ -2,6 +2,6 @@ -- **[Setting Up the Windows+Ubuntu Hybrid Build Environment](quickstart-ide-standard-env-setup-win-ubuntu.md)** +- **[Setting Up the Windows+Ubuntu Hybrid Development Environment](quickstart-ide-standard-env-setup-win-ubuntu.md)** - **[Obtaining Source Code](quickstart-ide-standard-sourcecode-acquire.md)** diff --git a/en/device-dev/quick-start/quickstart-ide-standard-running-hi3516-burning.md b/en/device-dev/quick-start/quickstart-ide-standard-running-hi3516-burning.md index f618b545c42ac566bb5d5ae9a51c7c7337ee028a..dad8d48305a2b4451e397e06f13aa5976446ca96 100644 --- a/en/device-dev/quick-start/quickstart-ide-standard-running-hi3516-burning.md +++ b/en/device-dev/quick-start/quickstart-ide-standard-running-hi3516-burning.md @@ -6,7 +6,7 @@ To burn source code to Hi3516D V300 through the USB port in Windows, perform the 1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3516D V300 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3516.md). -2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment). +2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment). - If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required. - If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon. @@ -14,7 +14,7 @@ To burn source code to Hi3516D V300 through the USB port in Windows, perform the ![en-us_image_0000001261395999](figures/en-us_image_0000001261395999.png) > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** - > This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step. + > This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step. 3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool. diff --git a/en/device-dev/quick-start/quickstart-ide-standard-running-hi3516-running.md b/en/device-dev/quick-start/quickstart-ide-standard-running-hi3516-running.md index a0e31a6a05ca740c4ad8c23e5c7ca3c60557076f..0031532533dbe6bcd2994a6f161632732459ab49 100644 --- a/en/device-dev/quick-start/quickstart-ide-standard-running-hi3516-running.md +++ b/en/device-dev/quick-start/quickstart-ide-standard-running-hi3516-running.md @@ -5,7 +5,7 @@ After the burning is complete, perform the following steps to start the system: -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> This operation procedure is required only if this is the first time you burn an image for the standard system. 1. In DevEco Device Tool, click **Monitor** to open the serial port tool. @@ -17,12 +17,12 @@ After the burning is complete, perform the following steps to start the system: ![en-us_image_0000001271202289](figures/en-us_image_0000001271202289.gif) 3. Run the following commands to set system boot parameters: - + ``` setenv bootargs 'mem=640M console=ttyAMA0,115200 mmz=anonymous,0,0xA8000000,384M clk_ignore_unused rootdelay=10 hardware=Hi3516DV300 init=/init root=/dev/ram0 rw blkdevparts=mmcblk0:1M(boot),15M(kernel),20M(updater),2M(misc),3307M(system),256M(vendor),-(userdata)'; ``` - + ``` setenv bootcmd 'mmc read 0x0 0x82000000 0x800 0x4800; bootm 0x82000000' ``` @@ -30,7 +30,7 @@ After the burning is complete, perform the following steps to start the system: ![en-us_image_0000001271562269](figures/en-us_image_0000001271562269.png) 4. Save the parameter settings. - + ``` save ``` @@ -38,7 +38,7 @@ After the burning is complete, perform the following steps to start the system: ![en-us_image_0000001226762210](figures/en-us_image_0000001226762210.png) 5. Restart the development board to start the system. - + ``` reset ``` diff --git a/en/device-dev/quick-start/quickstart-ide-standard-running-rk3568-burning.md b/en/device-dev/quick-start/quickstart-ide-standard-running-rk3568-burning.md index 57f29832e59d419fb000706cff30b7b7e9941208..8c342589b7bf22a9e519be85b816110d946cf109 100644 --- a/en/device-dev/quick-start/quickstart-ide-standard-running-rk3568-burning.md +++ b/en/device-dev/quick-start/quickstart-ide-standard-running-rk3568-burning.md @@ -8,7 +8,7 @@ 2. Connect the computer to the target development board through the USB port. -3. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment). +3. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment). - If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required. - If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon. @@ -16,7 +16,7 @@ ![en-us_image_0000001261395999](figures/en-us_image_0000001261395999.png) > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
- > This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step. + > This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step. 4. In DevEco Device Tool, choose QUICK ACCESS > DevEco Home > Projects, and then click Settings. diff --git a/en/device-dev/quick-start/quickstart-ide-standard-running-rk3568-running.md b/en/device-dev/quick-start/quickstart-ide-standard-running-rk3568-running.md index cf86116a18cf1c428dd4ad0bd8a8f29bd12f260a..e21d612fa72e3e02527d4235bc70400d5a3a1ba5 100644 --- a/en/device-dev/quick-start/quickstart-ide-standard-running-rk3568-running.md +++ b/en/device-dev/quick-start/quickstart-ide-standard-running-rk3568-running.md @@ -5,7 +5,7 @@ After the image is burnt and the development board is restarted, the system automatically starts. If the following page is displayed on the screen of the development board, the system is running properly. - **Figure 1** System startup effect +**Figure 1** System startup effect ![en-us_image_0000001226762222](figures/en-us_image_0000001226762222.jpg) diff --git a/en/device-dev/quick-start/quickstart-ide-standard-sourcecode-acquire.md b/en/device-dev/quick-start/quickstart-ide-standard-sourcecode-acquire.md index 997e0ee227d706351e8b4c5c42d74e3858d86074..c84614b09578234a33cbec7223e1f88e93abbb77 100644 --- a/en/device-dev/quick-start/quickstart-ide-standard-sourcecode-acquire.md +++ b/en/device-dev/quick-start/quickstart-ide-standard-sourcecode-acquire.md @@ -19,13 +19,13 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony ``` Run the following command to install the tools: - + ``` sudo apt-get install git git-lfs ``` 4. Configure user information. - + ``` git config --global user.name "yourname" git config --global user.email "your-email-address" @@ -33,7 +33,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony ``` 5. Run the following commands to install the **repo** tool: - + ``` curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o /usr/local/bin/repo # If you do not have the access permission to this directory, download the tool to any other accessible directory and configure the directory to the environment variable. chmod a+x /usr/local/bin/repo @@ -43,7 +43,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony ## Obtaining Source Code -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> Download the master code if you want to get quick access to the latest features for your development. Download the release code, which is more stable, if you want to develop commercial functionalities. - **Obtaining OpenHarmony master code** @@ -58,7 +58,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony Method 2: Use the **repo** tool to download the source code over HTTPS. - + ``` repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify repo sync -c @@ -72,8 +72,8 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony ## Running prebuilts - Go to the root directory of the source code and run the following script to install the compiler and binary tool: - +Go to the root directory of the source code and run the following script to install the compiler and binary tool: + ``` bash build/prebuilts_download.sh ``` diff --git a/en/device-dev/quick-start/quickstart-lite-env-setup.md b/en/device-dev/quick-start/quickstart-lite-env-setup.md index 5820ee61fb0a66a76ad7e8afaf0f8e3b823d0c31..894e3d8b8fb99afcfd005fa232c0945b0e990315 100644 --- a/en/device-dev/quick-start/quickstart-lite-env-setup.md +++ b/en/device-dev/quick-start/quickstart-lite-env-setup.md @@ -148,7 +148,7 @@ To remotely access the Ubuntu environment through Windows to perform operations ![en-us_image_0000001198722374](figures/en-us_image_0000001198722374.png) -## Configuring Windows to Remotely Access the Ubuntu Build Environment +## Configuring Windows to Remotely Access the Ubuntu Development Environment ### Installing the SSH Service and Obtaining the IP Address for Remote Access diff --git a/en/device-dev/quick-start/quickstart-lite-ide-directory.md b/en/device-dev/quick-start/quickstart-lite-ide-directory.md index 88773504a4830ba8b23f3265f197630b853d8d74..49ae1c33bc4dce0fecda7b7cd0a1b8ea4e52400f 100644 --- a/en/device-dev/quick-start/quickstart-lite-ide-directory.md +++ b/en/device-dev/quick-start/quickstart-lite-ide-directory.md @@ -1,7 +1,7 @@ ## Getting Started with Mini and Small Systems (IDE Mode) - [Mini and Small System Overview](quickstart-ide-lite-overview.md) - - Environment Preparation - - [Setting Up the Windows+Ubuntu Hybrid Build Environment](quickstart-ide-lite-env-setup-win-ubuntu.md) + - Setting Up Environments for the Mini and Small Systems + - [Setting Up the Windows+Ubuntu Hybrid Development Environment](quickstart-ide-lite-env-setup-win-ubuntu.md) - [Obtaining Source Code](quickstart-ide-lite-sourcecode-acquire.md) - [Creating a Source Code Project](quickstart-ide-lite-create-project.md) - Running a Hello World Program diff --git a/en/device-dev/quick-start/quickstart-lite-package-directory.md b/en/device-dev/quick-start/quickstart-lite-package-directory.md index 96f3578b058936d5f757e3cd0fa677257f5f4b9b..78fee5a65bc346220534309249b4b2cb19255d7c 100644 --- a/en/device-dev/quick-start/quickstart-lite-package-directory.md +++ b/en/device-dev/quick-start/quickstart-lite-package-directory.md @@ -1,6 +1,6 @@ ## Getting Started with Mini and Small Systems (Installation Package Mode) - [Mini and Small System Overview](quickstart-lite-overview.md) -- [Environment Preparation](quickstart-lite-env-setup.md) +- [Setting Up Environments for the Mini and Small Systems](quickstart-lite-env-setup.md) - Running a Hello World Program - Hi3861 Development Board - [Setting Up the Hi3861 Development Board Environment](quickstart-lite-steps-hi3861-setting.md) diff --git a/en/device-dev/quick-start/quickstart-lite-reference.md b/en/device-dev/quick-start/quickstart-lite-reference.md index c6fa6d023fbb1468e99b3c2ad2274ec64b5799bf..46ee65fc6593c280b1946d24d1e7e4fa3f9cf3d1 100644 --- a/en/device-dev/quick-start/quickstart-lite-reference.md +++ b/en/device-dev/quick-start/quickstart-lite-reference.md @@ -11,7 +11,7 @@ ``` > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** - > _name_ indicates the product name, for example, **Hi3516D V300** and **rk3568**. + > _name_ indicates the product name, for example, **hispark_taurus_standard** and **rk3568**. 2. Check the build result. After the build is complete, the following information is displayed in the log: @@ -21,7 +21,7 @@ ``` Files generated during the build are stored in the **out/{device_name}/** directory, and the generated image is stored in the **out/{device_name}/packages/phone/images/** directory. - > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** + > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> For details about other modular compilation operations, see [Building a Standard System](../subsystems/subsys-build-standard-large.md). diff --git a/en/device-dev/quick-start/quickstart-lite-steps-hi3516-burn.md b/en/device-dev/quick-start/quickstart-lite-steps-hi3516-burn.md index a8065841e5ffd0d3b72d2d6a52929118b7b13ffe..cd0b1434eb03b1f237c69eb3dc1b4a5a66382dbb 100644 --- a/en/device-dev/quick-start/quickstart-lite-steps-hi3516-burn.md +++ b/en/device-dev/quick-start/quickstart-lite-steps-hi3516-burn.md @@ -40,7 +40,7 @@ After the source code is imported, perform the following steps: 1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3516D V300 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3516.md). -2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment). +2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment). - If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required. - If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon. @@ -48,7 +48,7 @@ After the source code is imported, perform the following steps: ![en-us_image_0000001261395999](figures/en-us_image_0000001261395999.png) > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** - > This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step. + > This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step. 3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool. diff --git a/en/device-dev/quick-start/quickstart-lite-steps-hi3861-burn.md b/en/device-dev/quick-start/quickstart-lite-steps-hi3861-burn.md index 5a2d1a31a5d0ebfe4a890f41441e0aab0f37061d..46974e89328fec671bae02e748ea393b1d147914 100644 --- a/en/device-dev/quick-start/quickstart-lite-steps-hi3861-burn.md +++ b/en/device-dev/quick-start/quickstart-lite-steps-hi3861-burn.md @@ -40,7 +40,7 @@ After the source code is imported, perform the following steps: 1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3861 V100 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3861.md). -2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment). +2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment). - If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required. - If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon. @@ -48,7 +48,7 @@ After the source code is imported, perform the following steps: ![en-us_image_0000001261395999](figures/en-us_image_0000001261395999.png) > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** - > This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step. + > This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step. 3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool. diff --git a/en/device-dev/quick-start/quickstart-standard-env-setup.md b/en/device-dev/quick-start/quickstart-standard-env-setup.md index ff6fccdf759439a321deee7569cc069f1d261c9f..9b55be45cee8bab38bcc23b23558f9b8d3806c16 100644 --- a/en/device-dev/quick-start/quickstart-standard-env-setup.md +++ b/en/device-dev/quick-start/quickstart-standard-env-setup.md @@ -140,7 +140,7 @@ To remotely access the Ubuntu environment through Windows to perform operations ![en-us_image_0000001198722374](figures/en-us_image_0000001198722374.png) -## Configuring Windows to Remotely Access the Ubuntu Build Environment +## Configuring Windows to Remotely Access the Ubuntu Development Environment ### Installing the SSH Service and Obtaining the IP Address for Remote Access diff --git a/en/device-dev/quick-start/quickstart-standard-ide-directory.md b/en/device-dev/quick-start/quickstart-standard-ide-directory.md index 297424cb26da0d60a9500e2a78623eb232e523a9..5285337d788ce1d7e97b286419f7beabfa59faef 100644 --- a/en/device-dev/quick-start/quickstart-standard-ide-directory.md +++ b/en/device-dev/quick-start/quickstart-standard-ide-directory.md @@ -1,7 +1,7 @@ ## Getting Started with Standard System (IDE Mode) - [Standard System Overview](quickstart-ide-standard-overview.md) - Environment Preparation - - [Setting Up the Windows+Ubuntu Hybrid Build Environment](quickstart-ide-standard-env-setup-win-ubuntu.md) + - [Setting Up the Windows+Ubuntu Hybrid Development Environment](quickstart-ide-standard-env-setup-win-ubuntu.md) - [Obtaining Source Code](quickstart-ide-standard-sourcecode-acquire.md) - [Creating a Source Code Project](quickstart-ide-standard-create-project.md) - Running a Hello World Program diff --git a/en/device-dev/quick-start/quickstart-standard-reference.md b/en/device-dev/quick-start/quickstart-standard-reference.md index 2c20ea41430d7201815a82058950a99f53847d28..ada4dac3c77729838792875bc4e1c61f603be0cb 100644 --- a/en/device-dev/quick-start/quickstart-standard-reference.md +++ b/en/device-dev/quick-start/quickstart-standard-reference.md @@ -11,7 +11,7 @@ ``` > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** - > _name_ indicates the product name, for example, **Hi3516D V300** and **rk3568**. + > _name_ indicates the product name, for example, **hispark_taurus_standard** and **rk3568**. 2. Check the build result. After the build is complete, the following information is displayed in the log: diff --git a/en/device-dev/quick-start/quickstart-standard-running-hi3516-burning.md b/en/device-dev/quick-start/quickstart-standard-running-hi3516-burning.md index 231e6fea28ebeed249fc93799efe21e891232f61..4c1e34c22be466aca3721ac696aa6ae306eae58b 100644 --- a/en/device-dev/quick-start/quickstart-standard-running-hi3516-burning.md +++ b/en/device-dev/quick-start/quickstart-standard-running-hi3516-burning.md @@ -40,7 +40,7 @@ After the source code is imported, perform the following steps: 1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3516D V300 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3516.md). -2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment). +2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment). - If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required. - If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon. @@ -48,7 +48,7 @@ After the source code is imported, perform the following steps: ![en-us_image_0000001261395999](figures/en-us_image_0000001261395999.png) > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** - > This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step. + > This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step. 3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool. diff --git a/en/device-dev/quick-start/quickstart-standard-running-rk3568-burning.md b/en/device-dev/quick-start/quickstart-standard-running-rk3568-burning.md index 961c8f00406560b536d28dc7fa40cca77fc7d239..d17d3881e3a921f358e502272bd87ab8d6521cd0 100644 --- a/en/device-dev/quick-start/quickstart-standard-running-rk3568-burning.md +++ b/en/device-dev/quick-start/quickstart-standard-running-rk3568-burning.md @@ -44,7 +44,7 @@ After the source code is imported, perform the following steps: 2. Connect the computer to the target development board through the USB port. -3. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment). +3. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment). - If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. Inthis case, no further action is required. - If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon. @@ -52,7 +52,7 @@ After the source code is imported, perform the following steps: ![en-us_image_0000001261395999](figures/en-us_image_0000001261395999.png) > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
- > This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step. + > This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step. 4. In DevEco Device Tool, choose QUICK ACCESS > DevEco Home > Projects, and then click Settings. diff --git a/en/device-dev/subsystems/subsys-build-standard-large.md b/en/device-dev/subsystems/subsys-build-standard-large.md index 4412923e4bfbc0b84e2b167dce7018e60aeed8dc..8dc0d3f4b08c9df0b1138d69ab3355bec787cce1 100644 --- a/en/device-dev/subsystems/subsys-build-standard-large.md +++ b/en/device-dev/subsystems/subsys-build-standard-large.md @@ -87,7 +87,7 @@ The process to build OpenHarmony is as follows: ./build.sh --product-name {product_name} ``` - **product\_name** indicates the product supported by the current distribution, for example, Hi3516D V300. + **product\_name** indicates the product supported by the current distribution, for example, hispark_taurus_standard. The image generated after build is stored in the **out/{device_name}/packages/phone/images/** directory. diff --git a/en/device-dev/website.md b/en/device-dev/website.md index d8cffc4d611143831068382fef26cf802e30eee0..8f6c8f6d8321de1b4895b7c7227cb873ac137788 100644 --- a/en/device-dev/website.md +++ b/en/device-dev/website.md @@ -479,6 +479,7 @@ - [HiSysEvent Tool Usage](subsystems/subsys-dfx-hisysevent-tool.md) - [HiDumper Development](subsystems/subsys-dfx-hidumper.md) - [HiChecker Development](subsystems/subsys-dfx-hichecker.md) + - [FaultLogger Development](subsystems/subsys-dfx-faultlogger.md) - Featured Topics - HPM Part - [HPM Part Overview](hpm-part/hpm-part-about.md) diff --git a/en/readme/startup.md b/en/readme/startup.md index c622cf3080c3b4897bc10a8d6548ec80807ac4c9..98c67077d5c1b8cf4d0a59e61492ab90b50c068a 100644 --- a/en/readme/startup.md +++ b/en/readme/startup.md @@ -288,11 +288,11 @@ It is worth noting that the modified **init.cfg** file must be in JSON format. Startup subsystem -[startup\_syspara\_lite](https://gitee.com/openharmony/startup_syspara_lite) +[startup\_init\_lite](https://gitee.com/openharmony/startup_init_lite) -[startup\_appspawn\_lite](https://gitee.com/openharmony/startup_appspawn_lite) +[startup\_syspara\_lite](https://gitee.com/openharmony/startup_syspara_lite) [startup\_bootstrap\_lite](https://gitee.com/openharmony/startup_bootstrap_lite) -[startup\_init\_lite](https://gitee.com/openharmony/startup_init_lite) +[startup\_appspawn\_lite](https://gitee.com/openharmony/startup_appspawn_lite) diff --git a/en/release-notes/OpenHarmony-v3.1-release.md b/en/release-notes/OpenHarmony-v3.1-release.md index b72f91a0a6eb3006fc32ec43efaebc7d1dd084bc..760aae4f61fd6df2c1fb784e9d7e4abe6c8c181c 100644 --- a/en/release-notes/OpenHarmony-v3.1-release.md +++ b/en/release-notes/OpenHarmony-v3.1-release.md @@ -58,10 +58,13 @@ More system applications, including the Home Screen, System UI, Settings, Camera | Software/Tool| Version| Remarks| | -------- | -------- | -------- | -| OpenHarmony | 3.1 Release | NA | -| SDK | Ohos_sdk 3.1 Release (API Version 8 Beta)| NA | -| (Optional) HUAWEI DevEco Studio| 3.0 Beta3 for OpenHarmony | Recommended for developing OpenHarmony applications| -| (Optional) HUAWEI DevEco Device Tool| 3.0 Release | Recommended for developing OpenHarmony smart devices| +| OpenHarmony | 3.1 Release | NA | +| SDK | Ohos_sdk 3.1 Release (API Version 8 Release)
Ohos_sdk 3.2 Canary (API Version 9 Canary) | NA | +| (Optional) HUAWEI DevEco Studio| 3.0 Beta3 for OpenHarmony | Recommended for developing OpenHarmony applications| +| (Optional) HUAWEI DevEco Device Tool| 3.0 Release | Recommended for developing OpenHarmony smart devices| + +>Note: The canary release is a preliminary release open only to specific developers. This release does not promise API stability and may require tolerance of instability. + ## Source Code Acquisition @@ -127,6 +130,7 @@ repo forall -c 'git lfs pull' | Hi3516 mini system solution - Linux (binary) | 3.1 Release | [Download](https://repo.huaweicloud.com/harmonyos/os/3.1-Release/hispark_taurus_linux.tar.gz)| [Download](https://repo.huaweicloud.com/harmonyos/os/3.1-Release/hispark_taurus_linux.tar.gz.sha256)| | Standard system SDK package (macOS) | 3.1 Release | [Download](https://repo.huaweicloud.com/harmonyos/os/3.1-Release/ohos-sdk-mac.tar.gz)| [Download](https://repo.huaweicloud.com/harmonyos/os/3.1-Release/ohos-sdk-mac.tar.gz.sha256)| | Standard system SDK package (Windows/Linux) | 3.1 Release | [Download](https://repo.huaweicloud.com/harmonyos/os/3.1-Release/ohos-sdk.tar.gz)| [Download]((https://repo.huaweicloud.com/harmonyos/os/3.1-Release/ohos-sdk.tar.gz.sha256)| +| Standard system SDK package | 3.2 Canary | Loaded only by using HUAWEI DevEco Studio| NA | | Compiler toolchain | - | [Download](https://repo.huaweicloud.com/harmonyos/os/2.0/tool_chain/)| - | @@ -150,33 +154,33 @@ This version has the following updates to OpenHarmony 3.1 Beta. | Power management|
Power management, battery management, thermal management, and power consumption statistics are supported.
The following requirements are involved:
I40IRO [Power management] Hibernation and hybrid sleep modes
I412F4 [Power management] Power saving mode
I4MBRL [Power management] Display-related power consumption adjustment
I4MBRM [Power management] Proximity sensor lock: During a call, the screen can be turned on or off by using the proximity sensor.
I4OEOZ [Power management] Monitoring of input screen-on events and turning on or off the screen based on the events
I4OEQT [Power management] Screen-off detection
I4QGI0 [Power management] Pressing and holding the **Power** button to display the shutdown screen
I410YD [Battery management] Charging while the device is shut down
I410Y1 [battery management] Shutdown due to abnormal battery temperature
I4GY9U [Thermal management] Kernel temperature control
I4GYAF [Thermal management] User layer and service temperature control
I4GYBV [Thermal management] Temperature monitoring API
I4GYCD [Power consumption statistics] Software power consumption statistics
I4GYCN [Power consumption statistics] Hardware power consumption statistics
I4GYDQ [Power consumption statistics] Power consumption details| NA | | Account| - The lifecycle of local accounts (also called system accounts) can be managed, including creating, switching, deleting, subscribing to, querying, and modifying local accounts.
- Distributed account ID derivation and status management are supported. When a distributed account logs in, a unique account ID is derived and bound to the local account. When the distributed account logs out or the token expires, the binding between the distributed account and the local account is removed.
- The function of binding a domain account to a local account is added. A local account is automatically created based on the passed domain account and bound to the domain account.
- The **acm** command is added for local account management. You can run the **acm create/delete/switch/dump** command to add, delete, modify, or query local accounts, and the **acm --help** command to view the command description.
I4JBFB Account status management in a distributed network
I4JBEK Account ID derivation in a distributed network
I4IU6N Local multi-user basic information management
I4IU5W Local multi-user lifecycle management of the **os_account_standard** component
I4IU5G Local multi-user auxiliary management tool
I4IU3V Mappings between domain accounts and local accounts
I4IU3B Local multi-user start, stop, and switching
I4IU33 Local multi-user function setting and content modification| NA | | Kernel| - Memory management enhancement features, including Continuous Memory Allocator (CMA), shared memory, and enhanced memory swapping, are added to improve memory usage efficiency.
- Process scheduling enhancement features, including CPU hotplug, lightweight isolation, and preferential supply for frame drawing threads, are added to improve CPU usage and enhance resource supply in sliding scenarios.
- The latest kernel security vulnerability patch and other security hardening mechanisms, such as token ID configuration and query, are supported.
The following requirements are involved:
I4MBTN [New feature] CMA
I4MBTO [New feature] Memory usage query by category
I4LKQ0 [New feature] Decoupling between cpuset and CPU hotplug
I4QE9K [New feature] Kernel sharing between the kernel-mode driver and the user-mode driver, and between a pair of user-mode drivers
I4LRGQ [New feature] OpenHarmony kernel baseline enablement
I4RXQ3 [New feature] Basic memory management features
I4TEGS [New feature] Performance optimization for F2FS when there is little storage space available
I4SRVK [New feature] Lightweight CPU isolation
I4SE2N [New feature] User-specific memory resource management
I4VMGZ [New feature] Basic Frame Per Second (FPS) awareness scheduling
I4U089 [New feature] Preferential supply for frame drawing threads
I4OWTZ [External dependency] Token ID setting for processes| NA | -| Bundle management framework| - Multi-HAP installation, implicit query, multi-user management, and authority management are supported.
- Distributed capabilities such as Database Management System (DBMS) and cross-device synchronization are added.
- The zlib native SDK is supported.
The following requirements are involved:
I4MBSD [New feature] Multi-HAP installation
I4MBSG [Enhanced feature] Installation package information query
I4PKY7 [New feature] Cross-device information synchronization
I4PKY8 [New feature] Cross-device information query
I4PKYK [Enhanced feature] Scanning
I4PKYI [New feature] Data clearing
I4PKYM [New feature] Multi-user creation
I4QA3D [Enhanced feature] Native APIs (NAPIs) for zlib compression and decompression
I4SIH9 [New feature] Application permission management| NA | +| Bundle management framework| - Multi-HAP installation, implicit query, multi-user management, and authority management are supported.
- Distributed capabilities such as Database Management System (DBMS) and cross-device synchronization are added.
- The zlib native SDK is supported.
The following requirements are involved:
I4MBSD [New feature] Multi-HAP installation
I4MBSG [Enhanced feature] Installation package information query
I4PKY7 [New feature] Cross-device information synchronization
I4PKY8 [New feature] Cross-device information query
I4PKYK [Enhanced feature] Scanning
I4PKYI [New feature] Data clearing
I4PKYM [New feature] Multi-user creation
I4QA3D [Enhanced feature] Native APIs (NAPIs) for zlib compression and decompression
I4SIH9 [New feature] Application permission management
(Canary) I4PKYH [New feature] Extension query
(Canary) I4PKYD [New feature] Adjustment of the installation capability for adaption to the config.json file
(Canary) I4PKYB [Enhanced feature] Schema construction for adaptation to the config.json file| NA | | Location| - The location subsystem is added to provide the location service framework capability.
- The location subsystem provides services such as Global Navigation Satellite System (GNSS) based positioning, GNSS geofencing, GNSS Batching, network positioning, and geocoding.
The following requirements are involved:
I4XXIH [location_gnss] Auxiliary information request and injection related to GNSS performance improvement
I4XXIG [location_gnss] GNSS hardware power consumption statistics and power consumption optimization
I4XXIF [location_gnss] GNSS based positioning
I4XXIC [location_gnss] GNSS Batching
I4XXIB [location_gnss] GNSS parameter setting and information reporting
I4XXI8 [location_locator] Security management of the location service
I4XXI7 [location_locator] Security assurance for location privacy
I4XXI5 [location_locator] Management of multiple location requests
I4XXI4 [location_locator] Location management
I4XXI3 [location_geofence] GNSS geofencing
I4XXI0 [location_geocode] Conversion between geographic coordinates (like longitudes and latitudes) and addresses
I4XXHZ [location_network] Network positioning
I4XXHW [location_gnss] GNSS auxiliary information protocol support| NA | | Communication| - The Wi-Fi STA, AP, and P2P basic capabilities and related JS APIs are added. Experience for STA, AP, and P2P connections is enhanced.
- The Bluetooth BR, SPP, and BLE capabilities and related JS APIs are added.
The following requirements are involved:
**Wi-Fi**
I4XXFG [New feature] Wi-Fi power consumption statistics and power consumption optimization
I4XXFF [New feature] Basic Wi-Fi P2P capabilities
I4XXFB [New feature] P2P magic link
I4XXF7 [New feature] SoftAP 5G and automatic channel selection
I4MBRI [New feature] Basic SoftAP features
I4MBRH [New feature] Basic STA features
**Bluetooth**
I4XXGC [bluetooth_standard] Bluetooth BR/Enhanced Data Rate (EDR)
I4XXFT [bluetooth_standard] Advanced Audio Distribution Profile (A2DP) capabilities and related JS APIs
I4XXFP [bluetooth_standard] Basic BLE capabilities
I4XXFL [bluetooth_standard] Bluetooth SPP and BR data transmission
| NA | -| Ability management framework| - The widget capability is added. The zidl tool supports automatic generation of C++ server/client code. The ability test framework is provided, and the command line tool capabilities are enhanced.
- The following capabilities are added: multi-user, mission stack reconstruction, ability-based decoupling, application resident process, application exception detection enhancement, and environment change notifications.
The following requirements are involved:
I4PCM4 [New feature] Application/HAP/Ability information query in the context module
I4PCPP [New feature] Multi-user in the context module
I4PCPV [New feature] System interface for user-specific ability start
I4PCQP [New feature] Single-user running mode
I4PCQU [New feature] Default user initialization
I4PCGY [Enhanced feature] Widget development base class
I4PCH9 [Enhanced feature] Widget configuration through configuration files
I4PCLL [New feature] Application-level JS context
I4PCLN [New feature] Ability status recovery
I4PCP1 [New feature] Application running information query
I4PCPG [Enhanced feature] System environment change notifications
I4PCR8 [Enhanced feature] Resident process upon system boot
I4PCV4 [New feature] Mission switching
I4PCVZ [New feature] Ability startup by display ID
I4PCW3 [Enhanced feature] Pending want for cross-device ability startup
I4PCH4 [New feature] Multi-user widget
I4PCM1 [New feature] CE/DE-level context
I4PCVN [New feature] Obtaining and updating mission snapshots
I4PPW6 [Enhanced feature] Ability startup in specified window mode
I4PC3R [New feature] Basic widget development capabilities
I4PQ0M [Enhanced feature] Message sending and monitoring provided by the context module
II4PQ13 [Enhanced feature] Permission verification and application APIs provided by the context module
I4PQ1E [Enhanced feature] Resident process recovery from exceptions
I4PQ1O [New Feature] New want
I4PCPI [Enhanced feature] System environment information query
I4PCRL [New feature] Ability test framework
I4PCVU [New feature] Ability call| NA | +| Ability management framework| - The widget capability is added. The zidl tool supports automatic generation of C++ server/client code. The ability test framework is provided, and the command line tool capabilities are enhanced.
- The following capabilities are added: multi-user, mission stack reconstruction, ability-based decoupling, application resident process, application exception detection enhancement, and environment change notifications.
The following requirements are involved:
I4PCM4 [New feature] Application/HAP/Ability information query in the context module
I4PCPP [New feature] Multi-user in the context module
I4PCPV [New feature] System interface for user-specific ability start
I4PCQP [New feature] Single-user running mode
I4PCQU [New feature] Default user initialization
I4PCGY [Enhanced feature] Widget development base class
I4PCH9 [Enhanced feature] Widget configuration through configuration files
I4PCLL [New feature] Application-level JS context
I4PCLN [New feature] Ability status recovery
I4PCP1 [New feature] Application running information query
I4PCPG [Enhanced feature] System environment change notifications
I4PCR8 [Enhanced feature] Resident process upon system boot
I4PCV4 [New feature] Mission switching
I4PCVZ [New feature] Ability startup by display ID
I4PCW3 [Enhanced feature] Pending want for cross-device ability startup
I4PCH4 [New feature] Multi-user widget
I4PCM1 [New feature] CE/DE-level context
I4PCVN [New feature] Obtaining and updating mission snapshots
I4PPW6 [Enhanced feature] Ability startup in specified window mode
I4PC3R [New feature] Basic widget development capabilities
I4PQ0M [Enhanced feature] Message sending and monitoring provided by the context module
II4PQ13 [Enhanced feature] Permission verification and application APIs provided by the context module
I4PQ1E [Enhanced feature] Resident process recovery from exceptions
I4PQ1O [New Feature] New want
I4PCPI [Enhanced feature] System environment information query
I4PCRL [New feature] Ability test framework
I4PCVU [New feature] Ability call
(Canary) I4QU0P [New feature] Work Scheduler
(Canary) I4PCRL [New feature] Ability test framework
(Canary) I4PCLL [New feature] Application-level JS context
(Canary) I4PC3R [New feature] Basic widget development capabilities
(Canary) I4PCS0 [New feature] APIs for starting and stopping abilities
(Canary) I4PCRQ [New feature] APIs for Scheduler component lifecycle management
(Canary) I4WVBL [Enhanced feature] [AMS] Cross-device mission continuation
(Canary) I4PCP1 [New feature] Application running information query
(Canary) I4PCPI [Enhanced feature] System environment information query
(Canary) I4PCPG [Enhanced feature] System environment change notifications
(Canary) I4PQ0K [Enhanced feature] Indepent running of the Extension process
(Canary) I4PPW6 [Enhanced feature] Ability startup in specified window mode
(Canary) I4PCVZ [New feature] Ability startup by display ID
(Canary) I4U457 [Enhanced feature] URI permission verification API
(Canary) I4S8X4 [Enhanced feature] Dynamic URI permission authorization
(Canary) I4VUXP WantAgent obtaining the operation type| NA | | Accessibility| - The internal implementation of UI information exchange is added.
- The function of reading accessibility configuration is added.
The following requirements are involved:
I4X2EM [New feature & information exchange mechanism] Key interception
I4X2EN [New feature & information exchange mechanism] Reporting of window node information
I4X2ET [New feature & information exchange mechanism] Reporting of control node information
I4X2EV [New feature & information exchange mechanism] Focus query
I4X2EY [New feature & information exchange mechanism] Accessibility event list
I4X2EZ [New feature & information exchange mechanism] Accessibility event information
I4X2F0 [New feature & information exchange mechanism] Accessibility action initiation
I4X2F1 [New feature & information exchange mechanism] Auxiliary application list query
I4X2F2 [New feature & information exchange mechanism] Auxiliary application status query and monitoring
I4X2F3 [New feature & information exchange mechanism] Gesture simulation
I4X2F4 [New feature & information exchange mechanism] Touchpad interception
I4X2EO [New feature & accessibility service management] Target application connection
I4X2EP [New feature & accessibility service management] Assistance application connection
I4X2ER [New feature & accessibility service management] Assistance application update
I4X2ES [New feature & accessibility service management] Accessibility caption configuration| NA | -| Multimedia| - The local basic audio/video playback capabilities, video hardware codecs, and mainstream audio/video codecs and encapsulation formats are supported.
- The basic camera preview, photographing, and distributed camera functions are provided.
The following requirements are involved:
I4WYPP [audio_standard] Bluetooth audio playback
I4WYK8 [audio_standard] OpenSL ES basic playback interfaces
I4WYW4 [Enhanced feature] Camera session management
I4WYVE [Enhanced feature] Basic photographing functions
I4WZ8G [New feature] Basic image decoding framework
I4X5E1 [New feature] Video software decoding
I4X552 [New feature] Local audio/video playback
I4X5Q9 [New feature] Distributed media library - thumbnail synchronization
I4X5L5 [New feature] Basic media database| NA | +| Multimedia| - The local basic audio/video playback capabilities, video hardware codecs, and mainstream audio/video codecs and encapsulation formats are supported.
- The basic camera preview, photographing, and distributed camera functions are provided.
The following requirements are involved:
I4WYPP [audio_standard] Bluetooth audio playback
I4WYK8 [audio_standard] OpenSL ES basic playback interfaces
I4WYW4 [Enhanced feature] Camera session management
I4WYVE [Enhanced feature] Basic photographing functions
I4WZ8G [New feature] Basic image decoding framework
I4X5E1 [New feature] Video software decoding
I4X552 [New feature] Local audio/video playback
I4X5Q9 [New feature] Distributed media library - thumbnail synchronization
I4X5L5 [New feature] Basic media database
(Canary) I4WYOP [audio_standard component] Enhanced audio focus management
(Canary) I4WZBF [New feature] Image receiver
(Canary) I4WYW4 [Enhanced feature] Camera session management
(Canary) I4WYVE [Enhanced feature] Basic photographing functions
(Canary) I4WYSW [Enhanced Feature] Preview function in basic photographing mode
(Canary) I4X59J [New feature] Video recording| NA | | Graphics| - A new graphics rendering framework RenderService is provided.
- 2D/3D drawing is supported.
- A new animation framework is provided.
The following requirements are involved:
I4MBTY [render_service] [New feature] Background rendering feature for the UI framework
I4RKT3 [composer] Combination and display
I4ZCGG [drawing] Graphics native SDK
I4RKSW [drawing] 3D and graphics capabilities, and native SDK capabilities
I4MBTW [animation] Basic animation framework| NA | -| Window Manager| - A new window management framework is provided, which offers more flexible window framework capabilities and supports full-screen, split-screen, window modes, and cross-window content dragging.
- The display management capability is provided, which supports split-screen display and enhanced screen-on/off management.
The following requirements are involved:
I4R308 [Enhanced feature] Application window creation and management: Multiple primary windows can be created for multiple ability instances of a single application.
I4R309 [Enhanced feature] Application window creation and management: The window display policy can be set when a window is started. The window display policy status (split screen, full screen, or free window) is provided for applications.
I4R30D [New feature] Free window display, tile layout, and cascade layout of the application's primary window.
I4R9P0 [New specification] Enhanced features:
1. Display management
2. Creating and destroying a display by inserting or removing a physical screen
3. Multi-display mapping management
I4ZEKH [New feature] Screen on/off process
1. Sleep, wake-up, screen-on, and screen-off requests initiated from the power management module
2. Calling of the RenderServer interface to turn the screen on/off or adjust the screen brightness as requested| NA | +| Window Manager| - A new window management framework is provided, which offers more flexible window framework capabilities and supports full-screen, split-screen, window modes, and cross-window content dragging.
- The display management capability is provided, which supports split-screen display and enhanced screen-on/off management.
The following requirements are involved:
I4R308 [Enhanced feature] Application window creation and management: Multiple primary windows can be created for multiple ability instances of a single application.
I4R309 [Enhanced feature] Application window creation and management: The window display policy can be set when a window is started. The window display policy status (split screen, full screen, or free window) is provided for applications.
I4R30D [New feature] Free window display, tile layout, and cascade layout of the application's primary window.
I4R9P0 [New specification] Enhanced features:
1. Display management
2. Creating and destroying a display by inserting or removing a physical screen
3. Multi-display mapping management
I4ZEKH [New feature] Screen on/off process
1. Sleep, wake-up, screen-on, and screen-off requests initiated from the power management module
2. Calling of the RenderServer interface to turn the screen on/off or adjust the screen brightness as requested
(Canary) I4R30B [New specifications] [Enhanced feature]: Creation and management of the application window| NA | | Network management| I4XXHU [Enhanced feature] TCP/UDP socket
I4XXHT [Enhanced feature] Support for HTTP 1.1/HTTPS/HTTP 2
I4XXHS [Enhanced feature] Wi-Fi/Cellular network connection management and handover
I4XXHP [Enhanced feature] Domain Name System (DNS) resolution and configuration
I4XXHN [Enhanced feature] Network connection status query and status change notification
I4XXHH [WPA_supplicant] Wi-Fi Protected Access (WPA) and P2P capabilities based on nl80211
I4XXHG [WPA_supplicant] Magic link| NA | | MSDP| I4WWRO [MSDP] device_status component standardization| NA | | Globalization| - Locale selection is added.
- The following internationalization features are supported: single and plural rules, string sorting, phone number processing, calendar and local calendar, measurement units and formatting, time segment formatting, alphabet retrieval, Unicode character attributes, wrapping and line feed.
- System resources are supported.
- rawfile resources are supported.
The following requirements are involved:
I4MBR0 [Enhanced feature] Locale representation and attributes
I4MBR1 [Enhanced feature] Singular and plural rules
I4MBR2 [Enhanced feature] String sorting
I4MBR3 [Enhanced feature] Phone number processing
I4MBR7 [New feature] Calendar and local calendar
I4MBR5 [New feature] Measurement units and formatting
I4MBQZ [Enhanced feature] Time segment formatting
I4MBR4 [New feature] Alphabet retrieval
I4MBR8 [Enhanced feature] Unicode character attribute
I4MBR9 [Enhanced feature] Wrapping and line feed
I4MBRA [New feature] System resource management
I4MBRB [New feature] rawfile resource management
I4R2YA [New feature] Native SDK for resource management| NA | | DSoftBus| - Network switching is supported.
- Bluetooth is supported.
- Bluetooth file transfer is supported.
- Streaming is supported.
- P2P connection is supported.
- P2P-based file transfer and streaming are supported.
The following requirements are involved:
I4MBS0 [New feature] [Networking] Network switching
I4XXEL [Enhanced feature] Bluetooth
I4XXEX [Transmission] File transfer over Bluetooth
I4XXEO [Enhanced feature] [Transmission] Enhanced file transfer (NSTACK component capability)
I4XXEV [New feature] [Transmission] Enhanced streaming (NSTACK component capability enhancement)
I4XXEN [New feature] [Networking] P2P connection
I4XXEP [New feature] [Connection] P2P connection
I4XXES [New feature] [Transmission] P2P file transfer
I4XXET [New feature] [Transmission] P2P streaming| NA | -| ArkUI| - Keyboard and mouse interaction is supported.
- The declarative **\** component is added.
- The declarative **XComponent** is added.
- The declarative **Canvas2D** and **OffscreenCanvas** capabilities are added.
- Rich text display is supported.
- Multiple functional components are added.
- The customization capabilities of multiple components are enhanced.
- Debugging is enhanced.
The following requirements are involved:
I4MBV7 [New specification] Scroll bar style customization
I4MBVO [New feature] Content customization specifications for the **\** component.
I4MBVP [New feature] Canvas drawing
I4MBVR [New feature] Touch hot zone setting
I4MBVS [New feature] Lottie animations
I4MBVU [New feature] Content customization specifications for the **\** component.
I4MBVV [New feature] Swipe gesture
I4MBV9 [New specification] **\** content customization specifications for the **\** component
I4MBVA [New specification] Title bar setting specification for the **\** component
I4MBVC [New specification] Content customization specification for the **\** component
I4WTQY [New feature] Linear proportion display component
I4MBV3 [New specification] Component polymorphic style specifications
I4MBV5 [New specification] Prompt menu content specifications for the **\** component
I4WTQ2 [New specification] Content dragging specification for the **\** component
I4WTQ4 [New specification] Content dragging specification for the **\** component
I4WYNA [New specification] Enhanced **\** component: dialog box displayed at the user-specified location
I4WTQX [New feature] **\** component
I4QC4N [New specification] **\** component
I4WTQK [New feature] Double-click for word selection
I4WTPG [New specification] Enhanced parameter configuration of the basic animations
I4X26M [New specification] **\** component that supports selection by the mouse operation alone and the combination of keyboard and mouse operations
I4X26Y [New specification] **\** component that supports selection by the mouse operation alone and the combination of keyboard and mouse operations
I4WTR8 [New feature] Focus setting
I4U5XM [New specification] Conditional compilation of JS files by ArkUI Loader
I4WTQN [New feature] **RichText** label| NA | +| ArkUI| - Keyboard and mouse interaction is supported.
- The declarative **\** component is added.
- The declarative **XComponent** is added.
- The declarative **Canvas2D** and **OffscreenCanvas** capabilities are added.
- Rich text display is supported.
- Multiple functional components are added.
- The customization capabilities of multiple components are enhanced.
- Debugging is enhanced.
The following requirements are involved:
I4MBV7 [New specification] Scroll bar style customization
I4MBVO [New feature] Content customization specifications for the **\** component.
I4MBVP [New feature] Canvas drawing
I4MBVR [New feature] Touch hot zone setting
I4MBVS [New feature] Lottie animations
I4MBVU [New feature] Content customization specifications for the **\** component.
I4MBVV [New feature] Swipe gesture
I4MBV9 [New specification] **\** content customization specifications for the **\** component
I4MBVA [New specification] Title bar setting specification for the **\** component
I4MBVC [New specification] Content customization specification for the **\** component
I4WTQY [New feature] Linear proportion display component
I4MBV3 [New specification] Component polymorphic style specifications
I4MBV5 [New specification] Prompt menu content specifications for the **\** component
I4WTQ2 [New specification] Content dragging specification for the **\** component
I4WTQ4 [New specification] Content dragging specification for the **\** component
I4WYNA [New specification] Enhanced **\** component: dialog box displayed at the user-specified location
I4WTQX [New feature] **\** component
I4QC4N [New specification] **\** component
I4WTQK [New feature] Double-click for word selection
I4WTPG [New specification] Enhanced parameter configuration of the basic animations
I4X26M [New specification] **\** component that supports selection by the mouse operation alone and the combination of keyboard and mouse operations
I4X26Y [New specification] **\** component that supports selection by the mouse operation alone and the combination of keyboard and mouse operations
I4WTR8 [New feature] Focus setting
I4U5XM [New specification] Conditional compilation of JS files by ArkUI Loader
I4WTQN [New feature] **RichText** label
(Canary) I4WTQV [New feature] Scenario-specific data storage | NA | | Program access control| - The functions of defining, managing, authorizing, querying, and authenticating local application permissions are added.
- The functions of managing, querying, authenticating, and synchronizing distributed permissions are added.
The following requirements are involved:
I4WVMH [New specification] Predefined system application permission initialization
I4WVO9 [New specification] Application permission request query
I4WVPH [New specification] Basic framework of the AT synchronization service
I4WVPV [New specification] Local permission verification interface and mechanism
I4WVQT [New specification] Native token creation and update mechanism
I4WVR3 [New specification] Application permission setting interface and mechanism
I4WVRG [New specification] Basic framework of the AT management service
I4WVRR [New specification] Token query interface for HAP applications
I4WVS6 [New specification] Token deletion for HAP applications
I4WVSI [New specification] Token creation and update for HAP applications
I4TYDA [New specification] Cross-device token information synchronization
I4TYCV [New specification] Token information synchronization for the native process upon device online
I4V02K [New specification] Application authorization status update and synchronization
I4V02Y [New specification] Application uninstall synchronization
I4V032 [New specification] Implementation of the application permission management page
I4V038 [New specification] Application permission setting on the application permission management page
I4TYCK [New specification] Distributed permission verification interface and mechanism
I4TYDO [New specification] Token deletion upon device offline
I4SEZD [New specification] Dynamic permission request
I4SEZ7 [Dynamic permission setting] Dynamic permission authorization| NA | | Multi-language runtime| - Language compilation and runtime: A multi-device basic JS toolchain and runtime are provided, and the JS engine on the device side is provided to support application running.
- TS/JS Utils: The TS/JS Utils provides basic functions and supports TS/JS multi-thread.
- TS/JS/C/C++ toolchain: The basic requirements for development, debugging, and optimization are met.
- Lite Actor: This model shares bytecode and Virtual Machine (VM) internal infrastructure, optimizes the implementation of the JS engine and the memory usage, and improves the startup performance.
- High Perf Partial GC: ArkUI Garbage Collector (GC) supports concurrent mark, parallel mark, and lazy free, reducing the GC pause time by 50% and improving user experience.
The following requirements are involved:
I4W7ZR [New specification] Memory management, allocation, and reclamation/HPP GC performance optimization
I4P7F7 [language compilation and runtime, graphics, DRF] Native SDK integration
I4WWKK [Enhanced feature] Lite Actor 1.0| NA | | Update| - The components of the update subsystem are standardized.
- The SysCap mechanism is supported.
The following requirements are involved:
I4WXHW [Component-based] Component standardization
I4XXH6 [SysCap] SysCap support| NA | -| Misc services| - Management of time and time zone synchronization is supported.
- The capabilities of querying, setting, deleting, and replacing pasteboard data items are added.
- Lock screen management is supported.
- Static wallpaper management is supported.
- Downloading management is supported.
The following requirements are involved:
I4U2WR [New feature] Time and time zone synchronization management
I4ZTTE [New feature] Pasteboard data items - Forcible conversion from pasteboard data items to text
I4ZTTO [New feature] Pasteboard data - Obtaining, deleting, and replacing pasteboard data items, and querying and setting pasteboard data attributes
I4ZTTZ [New feature] System pasteboard - Obtaining, clearing, and querying pasteboard data, and sending pasteboard content change notifications
I4ZTZC [New feature] Lock screen management - Multi-user scenario
I4ZTZT [New feature] Lock screen management - System startup and screen on/off scenarios
I4ZU1S [New feature] Static wallpaper
I4ZTXT [request] Downloading management, including creating, deleting, modifying, querying, pausing, and resuming download tasks, monitoring download task progress, and sending download status change notifications. The downloading management service provides Data abilities for system download management, persists download task data, checks the application interface permission, performs HTTP download, and handles download exceptions.| NA | +| Misc services| - Management of time and time zone synchronization is supported.
- The capabilities of querying, setting, deleting, and replacing pasteboard data items are added.
- Lock screen management is supported.
- Static wallpaper management is supported.
- Downloading management is supported.
The following requirements are involved:
I4U2WR [New feature] Time and time zone synchronization management
I4ZTTE [New feature] Pasteboard data items - Forcible conversion from pasteboard data items to text
I4ZTTO [New feature] Pasteboard data - Obtaining, deleting, and replacing pasteboard data items, and querying and setting pasteboard data attributes
I4ZTTZ [New feature] System pasteboard - Obtaining, clearing, and querying pasteboard data, and sending pasteboard content change notifications
I4ZTZC [New feature] Lock screen management - Multi-user scenario
I4ZTZT [New feature] Lock screen management - System startup and screen on/off scenarios
I4ZU1S [New feature] Static wallpaper
I4ZTXT [request] Downloading management, including creating, deleting, modifying, querying, pausing, and resuming download tasks, monitoring download task progress, and sending download status change notifications. The downloading management service provides Data abilities for system download management, persists download task data, checks the application interface permission, performs HTTP download, and handles download exceptions.
(Canary) I4ZTZC [New feature] Lock screen management - Multi-user scenario
(Canary) I4ZTZT [New feature] Lock screen management - System startup and screen on/off scenarios| NA | | Light kernel| NA | For the mini system:
I4RD3H POSIX interfaces such as **signal**, **pipe**, **poll**, and **select** for the LiteOS-M kernel
I4Q9OQ Cortex-M55 architecture
I4Q9F2 Dynamic loading
I4RD2M Kernel componentization| -| File management| - The basic file system Ext4 and F2FS capabilities and related tools are supported. Cross-device file access of the distributed file system is provided.
- Device storage management functions are provided, including file encryption, space management and statistics, multi-user space management, and external card mount management.
- Application data protection is enhanced by supporting application sandbox isolation. User data management is optimized, including security hardening for user data sandbox isolation as well as user file access framework and interfaces.
- Basic file operation APIs are provided, including statfs usage statistics and asynchronous file access APIs.
The following requirements are involved:
I4RDNG [New feature] [local_file_system] User-mode tools such as Ext4 and F2FS
I4RFBD [New feature] [local_file_system] Pluggable file systems such as File Allocation Table (FAT), Extensible FAT (exFAT), and New Technology File System (NTFS)
I4TTN8 [New feature] Basic functions of the distributed file system
I4TTNG [New feature] Data classification, device grade, and data hopping specification control
I4TTGR [New feature] [storage_manager] File encryption
I4TTHQ [New feature] External storage access
I4TTJN [New feature] Event distribution of external cards
I4TTJV [New feature] Volume information query and management
I4XXIR [New feature] Creation and deletion of user directories by responding to multi-user requests
I4XXIY [New feature] Application space statistics
I4SNSU [New feature] Application sandbox isolation
I4XXIX [New feature] JS APIs for file picker
I4MBS2 [New feature] statfs APIs| NA | +| File management| - The basic file system Ext4 and F2FS capabilities and related tools are supported. Cross-device file access of the distributed file system is provided.
- Device storage management functions are provided, including file encryption, space management and statistics, multi-user space management, and external card mount management.
- Application data protection is enhanced by supporting application sandbox isolation. User data management is optimized, including security hardening for user data sandbox isolation as well as user file access framework and interfaces.
- Basic file operation APIs are provided, including statfs usage statistics and asynchronous file access APIs.
The following requirements are involved:
I4RDNG [New feature] [local_file_system] User-mode tools such as Ext4 and F2FS
I4RFBD [New feature] [local_file_system] Pluggable file systems such as File Allocation Table (FAT), Extensible FAT (exFAT), and New Technology File System (NTFS)
I4TTN8 [New feature] Basic functions of the distributed file system
I4TTNG [New feature] Data classification, device grade, and data hopping specification control
I4TTGR [New feature] [storage_manager] File encryption
I4TTHQ [New feature] External storage access
I4TTJN [New feature] Event distribution of external cards
I4TTJV [New feature] Volume information query and management
I4XXIR [New feature] Creation and deletion of user directories by responding to multi-user requests
I4XXIY [New feature] Application space statistics
I4SNSU [New feature] Application sandbox isolation
I4XXIX [New feature] JS APIs for file picker
I4MBS2 [New feature] statfs APIs
(Canary) I4XXIY Application space statistics
(Canary) I4TTJV Volume information query and management
(Canary) I4TTJN Event distribution of external cards| NA | | Common event and notification| - Multi-user is supported.
- Distributed notifications are supported.
- Notification templates are provided.
The following requirements are involved:
I4PBOK [New feature] Multi-user notification
I4PBP7 [New feature] Sending of template notifications (debugging capability)
I4PBPE [New feature] Progress bar notification
I4PBPM [Enhanced feature] Traffic control for distributed notifications
I4PBRM [New feature] Clicking notifications on another device and redirection on the local device
I4PBRW [New feature] Device-level distributed notification enabling control
I4PBSE [New feature] Notification management application setting and query of the application-level distributed notification enabling status
I4PBSP [New feature] Enabling/Disabling distributed notifications for applications
I4PBT7 [New feature] Distributed notification synchronization
I4PBU3 [New feature] Distributed notification linkage cancellation
I4PBUU [New specification] Static configuration of common events in **config.json**, and static start of subscribers using Wok Scheduler
I4PBV9 [New specification] Static subscriber management
I4WTGK [New feature] Template notification registration, query, and sending
I4PBSZ [New feature] Notification sending based on the device status
I4PBBV [New feature] EventRunner timeout detection
I4PD0O [Enhanced feature] Enhanced notification sending enabling
I4PBQ1 [Enhanced feature] dump command for distributed notifications
I4PBR0 [New feature] Clicking a notification on one device and redirection on another device
I4PC2S [New feature] Multi-user for common events| NA | | Pan-sensor| - Data reporting by common sensors, such as acceleration, gyroscope, and Hall effect sensors, is supported.
- The basic functions of vibrators are supported.
- The general algorithms and geomagnetic field algorithms are supported.
The following requirements are involved:
I4WWTG [miscdevice] Peripheral dependency support by miscdevice
I4WWTF [Sensor] Peripheral dependency support by sensor
I4WWTD [Sensor] Common algorithm interfaces
I4MBRQ [sensor] Horizontal intensity and total intensity of the magnetic field
I4MBRP (sensor component) Magnetic declination and dip| NA | | Distributed data management| - Memory JS objects can now be treated as distributed data objects; Distributed relational data management is provided to support data synchronization based on relational tables.
- Condition-based data synchronization and subscription capabilities are supported, making data synchronization more accurate.
- File upload is supported.
- Data encryption and security tiering are supported, and security control is optimized for data transfer. Multi-user synchronization and isolation are supported.
The following requirements are involved:
I4IBPH [distributed_kv_store] Supplemented the functions of the distributed data service
I4MBRS [distributed_kv_store] Cross-device synchronization and subscription of database records based on predicates
I4MBRU [RDB] Database encryption
I4NZVP [distributed_kv_store] Distributed database JS APIs
I4HAMI [data_share_ability] Subscription of cross-application database changes
I4NZP6 [RDB] Multi-table query
I4FZ6B [RDB] Transaction
I4HAMI [data_share_ability] Subscription of cross-application database changes
I4PNX7 [Distributed RDB] Data storage
I4HAMD [data_share_ability] Data access modes
I4H4FH [distributed_kv_store] Data classification and tiering for the distributed database
I4H3M8 [New feature] Complex type of distributed data objects
I4HAMD [data_share_ability] Data access modes
I4PO00 [Distributed RDB] Data synchronization
I4OTW6 [distributed_kv_store] InKeys predicate for the distributed database
I4RGFY [DataShare] Reconstruction based on the Extension ability and cross-application data sharing on a single device
I4H4FR [distributed_kv_store] Multi-user data isolation and sharing
I4RGFY [DataShare] Reconstruction based on the Extension ability and cross-application data sharing on a single device
I4XXGF [request] File upload| For the mini and small systems:
Distributed data objects are now available to small-system devices.
The following requirements are involved:
I4H3JJ: Distributed objects for small-system devices| | DFX| Watchdog detection for the system and application is provided. Log collection for native crashes and JS crashes is supported.
Abnormal behavior detection is provided for JS applications.
System and process status information can be exported. JS applications can obtain the bottom-layer memory, CPU, and VM information.
Distributed tracing and debugging are supported.
Log, system event, and application event capabilities are enhanced.
The following requirements are involved:
I4PJE3 [New feature] Hidumper framework and tool for the standard system
I4MBRE [hiperf] Performance statistics
I4U0KP [profiler] CPU profiler
I4PJE5 [New feature] JS application debugging and optimization based on native memory information
I4Q6AQ [New feature] Watchdog
I4U0JZ [New feature] hisysevent management
I4Q6B6 [Enhanced feature] HiTrace JS APIs
I4Q6AY [New feature] Detection mode framework and basic detection basic functions| NA | -| Driver| -& Enhanced Hardware Driver Foundation (HDF) capabilities are provided, including HDF Configuration Source (HCS) configuration parsing and power management.
- The shared memory queue and on-demand hardware device interface (HDI) service startup are added to the HDI management framework.
- The user-mode platform interfaces are provided for user-mode driver development.
- More than 200 HDI interfaces are defined for peripheral modules such as display, audio, camera, sensor, power supply, and USB. The number of device interfaces exceeds 600, providing more hardware access capabilities.
The following requirements are involved:
I4HPR7 [Enhanced feature] HCS macro parsing interface
I4LZZF [Enhanced feature] Synchronous/Asynchronous power management invocation
I4QEKH [New feature] Shared memory HDIs
I4QEKI [New feature] Driver development tool for standard-system driver development
I4QEKZ [New feature] User-mode platform driver interfaces
I4QEKL [New feature] Unified platform driver object model built on the HDF
I4QELC [New feature] On-demand UHDF process startup
I4QEKJ [New feature] HDI adaptation for the Linux-input driver
I4QEKM [New feature] Power HDIs
I4QEKK [New feature] HDF-based hardware timer driver
I4QEKP [New feature] HDF-based light driver
I4MBTP [Enhanced feature] Enhanced sensor driver model
I4MBTQ [Enhanced feature] Enhanced sensor driver
I4MBTR [Enhanced feature] Display HDI reference implementation for the standard system
I4MBTS [New feature] More HDF input device capabilities
I4QEKP [New feature] HDF based light driver
I4QEKQ [New feature] Service-oriented display HDI implementation
I4QEL2 [Enhanced feature] Enhanced vibrator driver model
I4XXGZ [New feature] HDF based pedometer sensor driver| For the mini and small systems:
HCS macro parsing interfaces are provided to reduce the memory usage during compilation.
The following requirements are involved:
I4TFTB [New feature] HCS macro parsing interfaces for the mini system| +| Driver| -& Enhanced Hardware Driver Foundation (HDF) capabilities are provided, including HDF Configuration Source (HCS) configuration parsing and power management.
- The shared memory queue and on-demand hardware device interface (HDI) service startup are added to the HDI management framework.
- The user-mode platform interfaces are provided for user-mode driver development.
- More than 200 HDI interfaces are defined for peripheral modules such as display, audio, camera, sensor, power supply, and USB. The number of device interfaces exceeds 600, providing more hardware access capabilities.
The following requirements are involved:
I4HPR7 [Enhanced feature] HCS macro parsing interface
I4LZZF [Enhanced feature] Synchronous/Asynchronous power management invocation
I4QEKH [New feature] Shared memory HDIs
I4QEKI [New feature] Driver development tool for standard-system driver development
I4QEKZ [New feature] User-mode platform driver interfaces
I4QEKL [New feature] Unified platform driver object model built on the HDF
I4QELC [New feature] On-demand UHDF process startup
I4QEKJ [New feature] HDI adaptation for the Linux-input driver
I4QEKM [New feature] Power HDIs
I4QEKK [New feature] HDF-based hardware timer driver
I4QEKP [New feature] HDF-based light driver
I4MBTP [Enhanced feature] Enhanced sensor driver model
I4MBTQ [Enhanced feature] Enhanced sensor driver
I4MBTR [Enhanced feature] Display HDI reference implementation for the standard system
I4MBTS [New feature] More HDF input device capabilities
I4QEKP [New feature] HDF based light driver
I4QEKQ [New feature] Service-oriented display HDI implementation
I4QEL2 [Enhanced feature] Enhanced vibrator driver model
I4XXGZ [New feature] HDF based pedometer sensor driver | For the mini and small systems:
HCS macro parsing interfaces are provided to reduce the memory usage during compilation.
The following requirements are involved:
I4TFTB [New feature] HCS macro parsing interfaces for the mini system| | USB| - A complete USB service management framework is built, including the host and device modules.
- Port switching is supported for switching between different function modes.
- USB JS APIs are provided for application development.
- USB HDIs are defined and implemented, and standard interfaces for USB driver access are provided.
The following requirements are involved:
I4MBRK [New feature] JS API implementation for the USB service
I4QEKV [New feature] HDI implementation for the USB service
I4QEKN [New feature] USB device implementation
I4QEKO [New feature] USB host implementation
I4QEL6 [New feature] USB port implementation| NA | | Compilation and building| - Normalized component definition and compilation are added.
- A unified compilation framework is provided, including the unified gn template, component configuration, product configuration, build commands, and build process.
- Native SDK compilation and release are supported.
- The Kconfig framework is supported.
- The hb capabilities are enhanced, including using the hb compilation entry in a unified manner, displaying build logs by level, and supporting hb command installation, integration, and extension.
- gn coding specifications and best practice are provided.| The feature changes for the mini and small systems are the same as those for the standard system.| -| Test| - The automated test framework is added to support the compilation and running of basic unit/UI test scripts.
- The wukong tool is provided to support pressure testing of random event injection at the level of the entire system or a single application.
-& The SmartPerf tool is added to collect and display basic performance data such as FPS, CPU, and memory data.
- The test scheduling framework is enhanced to support automatic case execution configuration and execution configuration management.
- The DCTS compatibility test suite is provided to support the DSoftBus and distributed data compatibility test.
-& The ACTS and HATS compatibility test suites are enhanced, covering external public JS APIs and HDF APIs in OpenHarmony 3.1 Release.
The following requirements are involved:
I4XXCR [Test framework] UI automation test
I4XXCV [Test framework] TS developer test framework
I4XXCW [Test framework] JS application developer test framework
I4XXD0 [Test framework] Executor device management
I4XXCX [Test framework] Test pipeline test suite execution report
I4XXCZ [Test framework] Test case configuration management
I4XXD0 [Test framework] Executor device management
I4XGLQ [New feature] UI random pressure test tool
I4XXD7 [Authentication test] DCTS 3.1 distributed compatibility test suite| NA | +| Test| - The automated test framework is added to support the compilation and running of basic unit/UI test scripts.
- The wukong tool is provided to support pressure testing of random event injection at the level of the entire system or a single application.
-& The SmartPerf tool is added to collect and display basic performance data such as FPS, CPU, and memory data.
- The test scheduling framework is enhanced to support automatic case execution configuration and execution configuration management.
- The DCTS compatibility test suite is provided to support the DSoftBus and distributed data compatibility test.
-& The ACTS and HATS compatibility test suites are enhanced, covering external public JS APIs and HDF APIs in OpenHarmony 3.1 Release.
The following requirements are involved:
I4XXCR [Test framework] UI automation test
I4XXCV [Test framework] TS developer test framework
I4XXCW [Test framework] JS application developer test framework
I4XXD0 [Test framework] Executor device management
I4XXCX [Test framework] Test pipeline test suite execution report
I4XXCZ [Test framework] Test case configuration management
I4XXD0 [Test framework] Executor device management
I4XGLQ [New feature] UI random pressure test tool
I4XXD7 [Compatibility test] DCTS 3.1 distributed compatibility test suite| NA | | Startup| - Process grouping and concurrent startup are supported.
- The SA and UHDF services can be started as required or based on hotplug events.
- The functions of creating a socket for a service and holding a file descriptor (FD) for a process that exits are added.
- **begetctl** is used as the unified init maintenance command.
- The recycling policy after process exit is optimized to support core process restart after exit. Non-core processes can be isolated when they are frequently suspended.
The following requirements are involved:
I4UTCF [New feature] Process grouping and parallel startup basic framework
I4UGE9 Bootchart function
I4UP28 SELinux label adaptation for dynamic files
I4UTCO [Enhanced feature] Enhanced application process incubation
I4UTCY [Enhanced feature] Recycling of incubated application processes by appspawn
I4RXJ2 [New specification] Unified init maintenance command
I4RXJ9 [New feature] On-demand service process startup
I4TNBV [New specification] Enhanced process startup configuration
I4PD3K Enhanced recycling policy configuration after process exit| NA | | User IAM| - The multi-user identity management and user identity authentication functions are added.
- A unified user identity authentication framework is added to manage various authentication modes.
- Password authentication is added.
- Facial authentication is added.
The following requirements are involved:
I4RG55 [New specification] [user_idm] Query of local authentication credential information of users
I4RG5R [New specification] [user_idm] Deletion of the identity authentication credential when a user is deleted
I4RG8W [New specification] [pin_auth] Input of local passwords
I4RG91 [New specification] [pin_auth] Local password authentication
I4RGWU [New specification] [pin_auth] Local password deletion
I4TSK7 [New specification] [face_auth] Local facial information deletion
I4TSJE [New specification] [face_auth] Local face recording
I4TSJY [New specification] [face_auth] Local facial authentication| NA | | Security| - The device security level management framework is added to support security level query for a specified device.
- Management policies for cross-device data migration are added to provide a basis for data security management during internal data processing and service hopping.
- A unified key management service is added to manage the full lifecycle of local keys for system applications and upper-layer services.
- The device mutual trust authentication capability is added to secure device connections.
The following requirements are involved:
I4RTYU [New feature] [Service] Devices on the network can query their own security levels.
I4RTYW [New feature] [Service] Devices can query the security level of their own or others.
I4TJFZ [Enhanced feature] DeviceAuth supports multi-user isolation for trust relationship authentication between devices. The trust relationship managed by a specified system user is used for authentication.
I4TJG1 [Enhanced feature] DeviceAuth implements multiple instances of trusted group data and supports data query of a specified user.
I4TJG3 [Enhanced feature] DeviceAuth supports the establishment and cancellation of account-irrelevant P2P trust relationships between multiple users.
I4TT8L [New specification] HUKS provides a three-segment key management interface.
I4TYEM [New specification] HUKS supports import, issuing, and verification of security level credentials.
I4TYFI [New specification] When a subuser is deleted from HUKS, the related key data must be deleted.
I4TYFR [New specification] When an application is deleted from HUKS, the related key data must be deleted.
I4TYFA [New specification] HUKS supports application UID-based access isolation for key applications.
I4TYF1 [New specification] HUKS supports key attestation and ID attestation.
I4SAI0 [New feature] DataTransitMgrLib is provided to support management policies for cross-device data migration.| NA | @@ -186,10 +190,7 @@ This version has the following updates to OpenHarmony 3.1 Beta. For details, see the following: -*[JS API Differences](api-change/v3.1-Release/js-apidiff-v3.1-release.md)* - - -*[Native API Differences](api-change/v3.1-Release/native-apidiff-v3.1-release.md)* +*[API Differences](api-change/v3.1-Release/readme.md)* ### Chip and Development Board Adaptation @@ -207,7 +208,7 @@ For details about the adaptation status, see [SIG-Devboard](https://gitee.com/op | Telephony| [SMS](https://gitee.com/openharmony/app_samples/tree/master/Telephony/Message)| This sample shows how to send SMS messages.| eTS | | Telephony| [Radio](https://gitee.com/openharmony/app_samples/tree/master/Telephony/RadioTech)| This sample shows how to use the radio function of the telephony service in eTS to obtain information, including the radio access technology, network status, network selection mode, ISO country code, signal strength list, and whether the radio function is enabled.| eTS | | Device management| [Power Management](https://gitee.com/openharmony/app_samples/tree/master/common/PowerManager)| This sample shows how to power off a device, restart the system, and check the screen status.| eTS | -| Device management| [Sensor](https://gitee.com/openharmony/app_samples/tree/master/device/SenSor)| This sample uses the orientation sensor APIs to implement the compass effect.| eTS | +| Device management| [Sensor](https://gitee.com/openharmony/app_samples/tree/master/device/Sensor)| This sample uses the orientation sensor APIs to implement the compass effect.| eTS | | Device management| [Device Management](https://gitee.com/openharmony/app_samples/tree/master/device/DeviceManager)| This sample shows the use of the **DeviceManager** API in eTS, including obtaining the trusted device list, scanning for devices, authenticating devices, and subscribing to device status changes.| eTS | | Account management| [Application Account Management](https://gitee.com/openharmony/app_samples/tree/master/Account/AppAccountManager)| This sample shows how to register/log in to an application and set the account information to demonstrate application account management.| eTS | | ArkUI | [web](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Web)| This sample shows the function pages of the **\** component.| eTS | @@ -233,7 +234,7 @@ For more information, visit [Samples](https://gitee.com/openharmony/app_samples) | [Distributed Authentication](https://gitee.com/openharmony/codelabs/tree/master/Distributed/GameAuthOpenH)| This codelab shows how to develop a distributed game authentication application in JS and how to use the distributed startup, **DeviceManager** objects, and device attribute display interfaces.| JS | | [Distributed Game Controller](https://gitee.com/openharmony/codelabs/tree/master/Distributed/HandleGameApplication)| This codelab shows how to develop a game controller in eTS. By leveraging the distributed capabilities, one development board is used as the game controller, and another development board is used as the game server.| eTS | | [Distributed Jigsaw Puzzle](https://gitee.com/openharmony/codelabs/tree/master/Distributed/OpenHarmonyPictureGame)| This codelab shows how to develop a jigsaw puzzle. In this development, the RPC is used for cross-device communication, and **CommonEvent** is used to implement communication between the Service ability and FA.| eTS | -| [Distributed Control](https://gitee.com/openharmony/codelabs/tree/master/Distributed/RemoteControllerETS)| This codelab shows how to develop a distributed control in eTS. By leveraging the distributed capabilities, one development board is used as the TV, and another development board is used as as the remote control.| eTS | +| [Distributed Control](https://gitee.com/openharmony/codelabs/tree/master/Distributed/RemoteControllerETS)| This codelab shows how to develop a distributed control in eTS. By leveraging the distributed capabilities, one development board is used as the TV, and another development board is used as the remote control.| eTS | | [Audio Recording](https://gitee.com/openharmony/codelabs/tree/master/Media/Audio_OH_ETS)| This codelab shows how to use **AudioRecorder** to record an audio file and use **AudioPlayer** to play the recorded audio.| eTS | | [Notepad](https://gitee.com/openharmony/codelabs/tree/master/Data/NotePad_OH_ETS)| This codelab shows how to develop a notepad in eTS. You can create, delete, and favorite notes, and use the lightweight database to store data persistently.| eTS | | [Distributed Mail Editing](https://gitee.com/openharmony/codelabs/tree/master/Distributed/OHMailETS)| This codelab shows how to develop the distributed email editing function. By leveraging the distributed capabilities, a remote device in the same LAN and with the same login account can be started, and email editing can be continued on the remote device.| eTS | diff --git a/zh-cn/application-dev/media/audio-capturer.md b/zh-cn/application-dev/media/audio-capturer.md index 50ca00d4938e97a1e3ad9c6cf4fd54864342907a..84a51ffd2461a5e156d627f79033948b4a157be9 100644 --- a/zh-cn/application-dev/media/audio-capturer.md +++ b/zh-cn/application-dev/media/audio-capturer.md @@ -42,7 +42,38 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以 var state = audioRenderer.state; ``` -2. 调用start()方法来启动/恢复采集任务。 +2. (可选)使用on('stateChange')订阅音频采集器状态更改。 +如果应用需要在采集器状态更新时进行一些操作,可以订阅该事件。更多事件请参考[API参考文档](../reference/apis/js-apis-audio.md)。 + + ```js + audioCapturer.on('stateChange',(state) => { + console.info('AudioCapturerLog: Changed State to : ' + state) + switch (state) { + case audio.AudioState.STATE_PREPARED: + console.info('--------CHANGE IN AUDIO STATE----------PREPARED--------------'); + console.info('Audio State is : Prepared'); + break; + case audio.AudioState.STATE_RUNNING: + console.info('--------CHANGE IN AUDIO STATE----------RUNNING--------------'); + console.info('Audio State is : Running'); + break; + case audio.AudioState.STATE_STOPPED: + console.info('--------CHANGE IN AUDIO STATE----------STOPPED--------------'); + console.info('Audio State is : stopped'); + break; + case audio.AudioState.STATE_RELEASED: + console.info('--------CHANGE IN AUDIO STATE----------RELEASED--------------'); + console.info('Audio State is : released'); + break; + default: + console.info('--------CHANGE IN AUDIO STATE----------INVALID--------------'); + console.info('Audio State is : invalid'); + break; + } + }); + ``` + +3. 调用start()方法来启动/恢复采集任务。 启动完成后,采集器状态将变更为STATE_RUNNING,然后应用可以开始读取缓冲区。 @@ -55,14 +86,14 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以 } ``` -3. 使用getBufferSize()方法获取要读取的最小缓冲区大小。 +4. 使用getBufferSize()方法获取要读取的最小缓冲区大小。 ```js var bufferSize = await audioCapturer.getBufferSize(); console.info('AudioRecLog: buffer size: ' + bufferSize); ``` -4. 读取采集器的音频数据并将其转换为字节流。重复调用read()方法读取数据,直到应用准备停止采集。 +5. 读取采集器的音频数据并将其转换为字节流。重复调用read()方法读取数据,直到应用准备停止采集。 参考以下示例,将采集到的数据写入文件。 @@ -98,7 +129,7 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以 } ``` -5. 采集完成后,调用stop方法,停止录制。 +6. 采集完成后,调用stop方法,停止录制。 ``` await audioCapturer.stop(); @@ -109,7 +140,7 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以 } ``` -6. 任务结束,调用release()方法释放相关资源。 +7. 任务结束,调用release()方法释放相关资源。 ```js await audioCapturer.release(); diff --git a/zh-cn/application-dev/quick-start/start-with-ets-low-code.md b/zh-cn/application-dev/quick-start/start-with-ets-low-code.md index 2be296de7cb22dbf1ee5012befde40b1f4a5b103..81e1cf99a9143329d3bba0217511091f9ab0e751 100644 --- a/zh-cn/application-dev/quick-start/start-with-ets-low-code.md +++ b/zh-cn/application-dev/quick-start/start-with-ets-low-code.md @@ -17,7 +17,7 @@ OpenHarmony低代码开发方式具有丰富的UI界面编辑功能,通过可 - 直接创建一个支持低代码开发的新工程以进行开发。本文以此方式为例进行说明。 -- 在已有工程中,创建Visual文件来进行开发。 +- 在已有工程中,创建visual文件来进行开发。 ## 创建新工程支持低代码开发 @@ -46,9 +46,9 @@ OpenHarmony低代码开发方式具有丰富的UI界面编辑功能,通过可 ## 构建第一个页面 -工程同步完成后,第一个页面已有一个容器、文本(Hello World)显示。为了更详细地了解低代码开发,我们将删除画布原有模板组件,从零开始完成页面的添加、设置。 +工程同步完成后,第一个页面已有一个容器、一段文本(Hello World)显示。为了更详细地了解低代码开发,我们将删除画布原有模板组件,从零开始完成页面的添加、设置。 -第一个页面内有一个容器、文本和一个按钮,通过Column、Text和Button组件来实现。其中,Column为沿垂直方向布局的容器组件,具体使用请见[Column](../reference/arkui-ts/ts-container-column.md)。 +第一个页面内有一个容器、一段文本和一个按钮,通过Column、Text和Button组件来实现。其中,Column为沿垂直方向布局的容器组件,具体使用请见[Column](../reference/arkui-ts/ts-container-column.md)。 1. 删除画布原有模板组件。 打开index.visual文件,选中画布中的组件,单击鼠标右键,选择Delete删除画布原有模板组件。操作如下所示: diff --git a/zh-cn/application-dev/quick-start/start-with-ets.md b/zh-cn/application-dev/quick-start/start-with-ets.md index 0b84c9b3f64168de0f9e6ae209a7f74f046a9174..8f85148746c4d952ede64bc4cb80ba47393244a1 100644 --- a/zh-cn/application-dev/quick-start/start-with-ets.md +++ b/zh-cn/application-dev/quick-start/start-with-ets.md @@ -64,7 +64,7 @@ ``` 2. 添加按钮。 - 在默认页面基础上,我们添加一个Button组件,作为按钮接收用户点击的动作,从而实现跳转到另一个页面。“**index.ets**”文件的示例如下: + 在默认页面基础上,我们添加一个Button组件,作为按钮响应用户点击,从而实现跳转到另一个页面。“**index.ets**”文件的示例如下: ``` @@ -79,7 +79,7 @@ Text(this.message) .fontSize(50) .fontWeight(FontWeight.Bold) - // 添加按钮,以接收用户点击 + // 添加按钮,以响应用户点击 Button() { Text('Next') .fontSize(30) @@ -171,7 +171,7 @@ Text(this.message) .fontSize(50) .fontWeight(FontWeight.Bold) - // 添加按钮,以接收用户点击 + // 添加按钮,以响应用户点击 Button() { Text('Next') .fontSize(30) diff --git a/zh-cn/application-dev/quick-start/start-with-js-low-code.md b/zh-cn/application-dev/quick-start/start-with-js-low-code.md index f8b9a22bdaf20339eb11572356d3a4b40cf6987d..4b7db2ab59aaf7583b530dee648942f0466873ae 100644 --- a/zh-cn/application-dev/quick-start/start-with-js-low-code.md +++ b/zh-cn/application-dev/quick-start/start-with-js-low-code.md @@ -15,7 +15,7 @@ OpenHarmony低代码开发方式具有丰富的UI界面编辑功能,通过可 - 直接创建一个支持低代码开发的新工程以进行开发。本文以此方式为例进行说明。 -- 在已有工程中,创建Visual文件来进行开发。 +- 在已有工程中,创建visual文件来进行开发。 ## 创建新工程支持低代码开发 @@ -50,9 +50,9 @@ OpenHarmony低代码开发方式具有丰富的UI界面编辑功能,通过可 ## 构建第一个页面 -工程同步完成后,第一个页面已有一个容器、文本(Hello World)显示。为了更详细地了解低代码开发,我们将删除画布原有模板组件,从零开始完成页面的添加、设置。 +工程同步完成后,第一个页面已有一个容器、一段文本(Hello World)显示。为了更详细地了解低代码开发,我们将删除画布原有模板组件,从零开始完成页面的添加、设置。 -第一个页面内有一个容器、文本和一个按钮,通过Div、Text和Button组件来实现。 +第一个页面内有一个容器、一段文本和一个按钮,通过Div、Text和Button组件来实现。 1. 删除画布原有模板组件。 打开index.visual文件,选中画布中的组件,单击鼠标右键,选择Delete删除画布原有模板组件。操作如下所示: diff --git a/zh-cn/application-dev/quick-start/start-with-js.md b/zh-cn/application-dev/quick-start/start-with-js.md index e3861a65ad10d2d9dfd713ee604a388b187c0ba1..0d41f5245e116ca5c21ef3fa90925566e2bac4af 100644 --- a/zh-cn/application-dev/quick-start/start-with-js.md +++ b/zh-cn/application-dev/quick-start/start-with-js.md @@ -52,7 +52,7 @@ ``` 2. 添加按钮,并绑定onclick方法。 - 在默认页面基础上,我们添加一个button类型的input组件,作为按钮接收用户点击的动作,从而实现跳转到另一个页面。“**index.hml**”文件的示例代码如下: + 在默认页面基础上,我们添加一个button类型的input组件,作为按钮响应用户点击,从而实现跳转到另一个页面。“**index.hml**”文件的示例代码如下: ``` diff --git a/zh-cn/application-dev/reference/apis/Readme-CN.md b/zh-cn/application-dev/reference/apis/Readme-CN.md index dba338b22c9a6bc34b2b89381ef7bec4dd3519f1..1142241c5219aae8f40d3961460826329de89b9b 100644 --- a/zh-cn/application-dev/reference/apis/Readme-CN.md +++ b/zh-cn/application-dev/reference/apis/Readme-CN.md @@ -113,6 +113,7 @@ - [@ohos.statfs (statfs)](js-apis-statfs.md) - [@ohos.storageStatistics (应用空间统计)](js-apis-storage-statistics.md) - [@ohos.volumeManager (卷管理)](js-apis-volumemanager.md) + - [@ohos.securityLabel (数据标签)](js-apis-securityLabel.md) - 电话服务 - [@ohos.contact (联系人)](js-apis-contact.md) diff --git a/zh-cn/application-dev/reference/apis/js-apis-Bundle.md b/zh-cn/application-dev/reference/apis/js-apis-Bundle.md index 408790d3e011215e437f629ff146ae007744dbf1..4bcfa50b6e870937e9ed59e382ec7bd53205b257 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-Bundle.md +++ b/zh-cn/application-dev/reference/apis/js-apis-Bundle.md @@ -807,7 +807,7 @@ bundle.getAbilityLabel(bundleName, moduleName, abilityName, (err, data) => { isAbilityEnabled(info: AbilityInfo): Promise\ -以异步方法根据给定的意图查询ability是否已经启用,使用Promise形式返回结果。 +以异步方法根据给定的AbilityInfo查询ability是否已经启用,使用Promise形式返回结果。 **需要权限:** @@ -832,15 +832,14 @@ SystemCapability.BundleManager.BundleFramework **示例:** ```js -let Info = { - bundleName : "com.example.myapplication", - name : "com.example.myapplication.MainAbility" -}; -bundle.isAbilityEnabled(Info) -.then((data) => { - console.info('Operation successful. Data: ' + JSON.stringify(data)); -}).catch((error) => { - console.error('Operation failed. Cause: ' + JSON.stringify(error)); +let bundleName = "com.example.myapplication"; +let abilityName = "com.example.myapplication.MainAbility"; +bundle.getAbilityInfo(bundleName, abilityName).then((abilityInfo)=>{ + bundle.isAbilityEnabled(abilityInfo).then((data) => { + console.info('Operation successful. Data: ' + JSON.stringify(data)); + }).catch((error) => { + console.error('Operation failed. Cause: ' + JSON.stringify(error)); + }) }) ``` @@ -848,7 +847,7 @@ bundle.isAbilityEnabled(Info) isAbilityEnabled(info : AbilityInfo, callback : AsyncCallback\): void -以异步方法根据给定的意图查询ability是否已经启用,使用callback形式返回结果。 +以异步方法根据给定的AbilityInfo查询ability是否已经启用,使用callback形式返回结果。 **需要权限:** @@ -868,16 +867,16 @@ SystemCapability.BundleManager.BundleFramework **示例:** ```js -let Info = { - bundleName : "com.example.myapplication", - name : "com.example.myapplication.MainAbility" -}; -bundle.isAbilityEnabled(Info, (err, data) => { +let bundleName = "com.example.myapplication"; +let abilityName = "com.example.myapplication.MainAbility"; +bundle.getAbilityInfo(bundleName, abilityName).then((abilityInfo)=>{ + bundle.isAbilityEnabled(abilityInfo, (err, data) => { if (err) { console.error('Operation failed. Cause: ' + JSON.stringify(err)); return; } console.info('Operation successful. Data:' + JSON.stringify(data)); + }) }) ``` @@ -885,7 +884,7 @@ bundle.isAbilityEnabled(Info, (err, data) => { isApplicationEnabled(bundleName: string): Promise\ -以异步方法根据给定的意图查询指定应用程序是否已经启用,使用Promise形式返回结果。 +以异步方法根据给定的包名查询指定应用程序是否已经启用,使用Promise形式返回结果。 **需要权限:** @@ -923,7 +922,7 @@ bundle.isApplicationEnabled(bundleName) isApplicationEnabled(bundleName: string, callback : AsyncCallback\): void -以异步方法根据给定的意图查询指定应用程序是否已经启用,使用callback形式返回结果。 +以异步方法根据给定的包名查询指定应用程序是否已经启用,使用callback形式返回结果。 **需要权限:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-fileio.md b/zh-cn/application-dev/reference/apis/js-apis-fileio.md index 1215a09fafc3d883ef9e05cf8a8be91222625610..f04103f1e8b72a2e166db480680504996b57963a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-fileio.md +++ b/zh-cn/application-dev/reference/apis/js-apis-fileio.md @@ -1900,7 +1900,7 @@ mkdtemp(prefix: string): Promise<string> | prefix | string | 是 | 用随机产生的字符串替换以“XXXXXX”结尾目录路径。 | **返回值:** - | 参数名 | 说明 | + | 类型 | 说明 | | --------------------- | ---------- | | Promise<string> | 生成的唯一目录路径。 | @@ -1950,7 +1950,7 @@ mkdtempSync(prefix: string): string | prefix | string | 是 | 用随机产生的字符串替换以“XXXXXX”结尾目录路径。 | **返回值:** - | 参数名 | 说明 | + | 类型 | 说明 | | ------ | ---------- | | string | 产生的唯一目录路径。 | @@ -1975,7 +1975,7 @@ fchmod(fd: number, mode: number): Promise<void> | mode | number | 是 | 若创建文件,则指定文件的权限,可给定如下权限,以按位或的方式追加权限。
- 0o700:所有者具有读、写及可执行权限。
- 0o400:所有者具有读权限。
- 0o200:所有者具有写权限。
- 0o100:所有者具有可执行权限。
- 0o070:所有用户组具有读、写及可执行权限。
- 0o040:所有用户组具有读权限。
- 0o020:所有用户组具有写权限。
- 0o010:所有用户组具有可执行权限。
- 0o007:其余用户具有读、写及可执行权限。
- 0o004:其余用户具有读权限。
- 0o002:其余用户具有写权限。
- 0o001:其余用户具有可执行权限。 | **返回值:** - | 参数名 | 说明 | + | 类型 | 说明 | | ------------------- | ---------------------------- | | Promise<void> | Promise实例,用于异步获取结果,本调用将返回空值。 | @@ -2099,7 +2099,7 @@ createStreamSync(path: string, mode: string): Stream | mode | string | 是 | - r:打开只读文件,该文件必须存在。
- r+:打开可读写的文件,该文件必须存在。
- w:打开只写文件,若文件存在则文件长度清0,即该文件内容会消失。若文件不存在则建立该文件。
- w+:打开可读写文件,若文件存在则文件长度清0,即该文件内容会消失。若文件不存在则建立该文件。
- a:以附加的方式打开只写文件。若文件不存在,则会建立该文件,如果文件存在,写入的数据会被加到文件尾,即文件原先的内容会被保留。
- a+:以附加方式打开可读写的文件。若文件不存在,则会建立该文件,如果文件存在,写入的数据会被加到文件尾后,即文件原先的内容会被保留。 | **返回值:** - | 参数名 | 说明 | + | 类型 | 说明 | | ------------------ | --------- | | [Stream](#stream7) | 返回文件流的结果。 | @@ -2124,7 +2124,7 @@ fdopenStream(fd: number, mode: string): Promise<Stream> | mode | string | 是 | - r:打开只读文件,该文件必须存在。
- r+:打开可读写的文件,该文件必须存在。
- w:打开只写文件,若文件存在则文件长度清0,即该文件内容会消失。若文件不存在则建立该文件。
- w+:打开可读写文件,若文件存在则文件长度清0,即该文件内容会消失。若文件不存在则建立该文件。
- a:以附加的方式打开只写文件。若文件不存在,则会建立该文件,如果文件存在,写入的数据会被加到文件尾,即文件原先的内容会被保留。
- a+:以附加方式打开可读写的文件。若文件不存在,则会建立该文件,如果文件存在,写入的数据会被加到文件尾后,即文件原先的内容会被保留。 | **返回值:** - | 参数名 | 说明 | + | 类型 | 说明 | | --------------------------------- | --------- | | Promise<[Stream](#stream7)> | 返回文件流的结果。 | @@ -2176,7 +2176,7 @@ fdopenStreamSync(fd: number, mode: string): Stream | mode | string | 是 | - r:打开只读文件,该文件必须存在。
- r+:打开可读写的文件,该文件必须存在。
- w:打开只写文件,若文件存在则文件长度清0,即该文件内容会消失。若文件不存在则建立该文件。
- w+:打开可读写文件,若文件存在则文件长度清0,即该文件内容会消失。若文件不存在则建立该文件。
- a:以附加的方式打开只写文件。若文件不存在,则会建立该文件,如果文件存在,写入的数据会被加到文件尾,即文件原先的内容会被保留。
- a+:以附加方式打开可读写的文件。若文件不存在,则会建立该文件,如果文件存在,写入的数据会被加到文件尾后,即文件原先的内容会被保留。 | **返回值:** - | 参数名 | 说明 | + | 类型 | 说明 | | ------------------ | --------- | | [Stream](#stream7) | 返回文件流的结果。 | @@ -2358,7 +2358,7 @@ createWatcher(filename: string, events: number, callback: AsyncCallback<numbe | callback | AsyncCallback<number > | 是 | 每发生变化一次,调用一次此函数。 | **返回值:** - | 参数名 | 说明 | + | 类型 | 说明 | | -------------------- | ---------- | | [Watcher](#watcher7) | 文件变化监听的实例。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-hitracechain.md b/zh-cn/application-dev/reference/apis/js-apis-hitracechain.md index 3b91f99086628744c56eb036bbf22d24fa46c3c8..7cb6da52a058023bfb4b92e7ed24f8252bcfc6fa 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-hitracechain.md +++ b/zh-cn/application-dev/reference/apis/js-apis-hitracechain.md @@ -155,6 +155,7 @@ setId(id: HiTraceId): void **示例:** ```js +let asyncTraceId; let traceId = hiTraceChain.begin("business"); // 若干业务逻辑完成后,设置当前HiTraceId。 hiTraceChain.setId(asyncTraceId); @@ -297,7 +298,7 @@ enableFlag(id: HiTraceId, flag: HiTraceFlag): void ```js let asyncTraceId = hiTraceChain.begin("business", hiTraceChain.HiTraceFlag.INCLUDE_ASYNC); -hiTraceChain.enable(asyncTraceId, hiTraceChain.HiTraceFlag.DONOT_CREATE_SPAN); +hiTraceChain.enableFlag(asyncTraceId, hiTraceChain.HiTraceFlag.DONOT_CREATE_SPAN); // enabledDoNotCreateSpanFlag为true let enabledDoNotCreateSpanFlag = hiTraceChain.isFlagEnabled(asyncTraceId, hiTraceChain.HiTraceFlag.DONOT_CREATE_SPAN); ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-hitracemeter.md b/zh-cn/application-dev/reference/apis/js-apis-hitracemeter.md index 5b6f314e87006c3bffdfa1c14184a5d4d099a530..14c49f64cd2180a71a90c274a9d71c7e17f5ed6b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-hitracemeter.md +++ b/zh-cn/application-dev/reference/apis/js-apis-hitracemeter.md @@ -34,7 +34,6 @@ startTrace(name: string, taskId: number): void ```js hiTraceMeter.startTrace("myTestFunc", 1); -hiTraceMeter.startTrace("myTestFunc", 1, 5); //从startTrace到finishTrace流程的耗时期望为5ms ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-medialibrary.md b/zh-cn/application-dev/reference/apis/js-apis-medialibrary.md index bbef4853c744928131d086ec671ee05cab3aa9f9..46646adfa05c85f329b78d58ae72b368bfda561d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-medialibrary.md +++ b/zh-cn/application-dev/reference/apis/js-apis-medialibrary.md @@ -28,7 +28,13 @@ getMediaLibrary(context: Context): MediaLibrary | ----------------------------- | :---- | | [MediaLibrary](#medialibrary) | 媒体库实例 | -**示例:** +**示例:(从API Version 9开始)** + +``` +var media = mediaLibrary.getMediaLibrary(this.context); +``` + +**示例:(API Version 8)** ``` import featureAbility from '@ohos.ability.featureAbility'; @@ -893,6 +899,8 @@ open(mode: string, callback: AsyncCallback<number>): void 打开当前文件,使用callback方式返回异步结果。 +**注意**:当前写操作是互斥的操作,写操作完成后需要调用close进行释放 + **需要权限**:ohos.permission.READ_MEDIA('r'模式打开),ohos.permission.WRITE_MEDIA('w'模式打开) **系统能力**:SystemCapability.Multimedia.MediaLibrary.Core @@ -928,6 +936,8 @@ open(mode: string): Promise<number> 打开当前文件,使用promise方式返回异步结果。 +**注意**:当前写操作是互斥的操作,写操作完成后需要调用close进行释放 + **需要权限**:ohos.permission.READ_MEDIA('r'模式打开),ohos.permission.WRITE_MEDIA('w'模式打开) **系统能力**:SystemCapability.Multimedia.MediaLibrary.Core diff --git a/zh-cn/application-dev/reference/apis/js-apis-securityLabel.md b/zh-cn/application-dev/reference/apis/js-apis-securityLabel.md new file mode 100644 index 0000000000000000000000000000000000000000..fbab84ec56d3975a41b0ae81f0783e5458c64f1c --- /dev/null +++ b/zh-cn/application-dev/reference/apis/js-apis-securityLabel.md @@ -0,0 +1,182 @@ +# 数据标签 + +> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** +> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 + +## 导入模块 + +```js +import securityLabel from '@ohos.securityLabel'; +``` + +## 使用说明 + +使用该功能模块对文件/目录进行操作前,需要先获取其绝对路径,获取方式及其接口用法请参考:[Context模块的接口getOrCreateLocalDir](js-apis-Context.md)。 + +“文件/目录绝对路径”=“应用目录路径”+“文件/目录名” + +通过上述接口获取到应用目录路径dir,文件名为“xxx.txt”,文件所在绝对路径为: + +```js +let path = dir + "/xxx.txt"; +``` + +文件描述符fd: + +```js +let fd = fileio.openSync(path, 0o102, 0o666); +``` + +## securityLabel.setSecurityLabel + +setSecurityLabel(path:string, dataLevel:string):Promise<void> + +以异步方法设置数据标签,以promise形式返回结果。 + +**系统能力**:SystemCapability.FileManagement.File.DistributedFile + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------ | ---- | -------------------------------------------- | +| path | string | 是 | 文件路径 | +| dataLevel | string | 是 | 文件等级属性,只支持"s0","s1","s2","s3","s4" | + +**返回值:** + + | 类型 | 说明 | + | ------------------- | ---------------- | + | Promise<void> | Promise实例,用于异步获取结果。本调用将返回空值。| + +**示例:** + + ```js + securityLabel.setSecurityLabel(path, dataLevel).then(function(){ + console.info("setSecurityLabel successfully"); + }).catch(function(error){ + console.info("setSecurityLabel failed with error:" + error); + }); + ``` + +## securityLabel.setSecurityLabel + +setSecurityLabel(path:string, dataLevel:string, callback: AsyncCallback<void>):void + +以异步方法设置数据标签,以callback形式返回结果。 + +**系统能力**:SystemCapability.FileManagement.File.DistributedFile + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------------------------- | ---- | -------------------------------------------- | +| path | string | 是 | 文件路径 | +| dataLevel | string | 是 | 文件等级属性,只支持"s0","s1","s2","s3","s4" | +| callback | AsyncCallback<void> | 是 | 是否设置数据标签之后的回调 | + +**示例:** + + ```js + securityLabel.setSecurityLabel(path, dataLevel, function(error){ + console.info("setSecurityLabel:" + JSON.stringify(error)); + }); + ``` +## securityLabel.setSecurityLabelSync + +setSecurityLabelSync(path:string, dataLevel:string):void + +以同步方法设置数据标签。 + +**系统能力**:SystemCapability.FileManagement.File.DistributedFile + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------ | ---- | -------------------------------------------- | +| path | string | 是 | 文件路径 | +| dataLevel | string | 是 | 文件等级属性,只支持"s0","s1","s2","s3","s4" | + +**示例:** + +```js +securityLabel.setSecurityLabelSync(path, dataLevel); +``` + +## securityLabel.getSecurityLabel + +getSecurityLabel(path:string):Promise<string> + +异步方法获取数据标签,以promise形式返回结果。 + +**系统能力**:SystemCapability.FileManagement.File.DistributedFile + +**参数:** + + | 参数名 | 类型 | 必填 | 说明 | + | ------ | ------ | ---- | -------- | + | path | string | 是 | 文件路径 | + +**返回值:** + + | 类型 | 说明 | + | --------------------- | ------------ | + | Promise<string> | 返回数据标签 | + +**示例:** + + ```js + securityLabel.getSecurityLabel(path).then(function(dataLevel){ + console.log("getSecurityLabel successfully:" + dataLevel); + }).catch(function(error){ + console.log("getSecurityLabel failed with error:" + error); + }); + ``` + +## securityLabel.getSecurityLabel + +getSecurityLabel(path:string, callback:AsyncCallback<string>): void + +异步方法获取数据标签,以callback形式返回结果。 + +**系统能力**:SystemCapability.FileManagement.File.DistributedFile + +**参数:** + + | 参数名 | 类型 | 必填 | 说明 | + | -------- | --------------------------- | ---- | -------------------------- | + | path | string | 是 | 文件路径 | + | callback | AsyncCallback<string> | 是 | 异步获取数据标签之后的回调 | + +**示例:** + + ```js + securityLabel.getSecurityLabel(function(error, dataLevel){ + console.log("getSecurityLabel successfully:" + dataLevel); + }); + ``` +## securityLabel.getSecurityLabelSync + +getSecurityLabelSync(path:string):string + +以同步方法获取数据标签。 + +**系统能力**:SystemCapability.FileManagement.File.DistributedFile + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | -------- | +| path | string | 是 | 文件路径 | + +**返回值:** + +| 类型 | 说明 | +| ------ | ------------ | +| string | 返回数据标签 | + +**示例:** + +```js +let result = securityLabel.getSecurityLabelSync(path); +console.log("getSecurityLabel successfully:" + result); +``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-settings.md b/zh-cn/application-dev/reference/apis/js-apis-settings.md index 20e07393953849127eaddf314ce2a7142028f825..80f832bab548df8fa5945458e8f0c20b94991a8c 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-settings.md +++ b/zh-cn/application-dev/reference/apis/js-apis-settings.md @@ -9,7 +9,7 @@ ## 导入模块 -``` +```typescript import settings from '@ohos.settings'; ``` @@ -34,7 +34,7 @@ getUriSync(name: string): string | string | 数据项的URI。 | - 示例: - ``` + ```typescript // 获取数据项的URI let urivar = settings.getUriSync('settings.screen.brightness'); ``` @@ -61,7 +61,7 @@ getValueSync(dataAbilityHelper: DataAbilityHelper, name: string, defValue: strin | string | 返回数据项的值。 | - 示例: - ``` + ```typescript import featureAbility from '@ohos.featureAbility'; //获取数据项亮度的值(该数据项在数据库中已存在) @@ -96,7 +96,7 @@ setValueSync(dataAbilityHelper: DataAbilityHelper, name: string, value: string): | boolean | 返回设置数据项的值是否成功的结果。true表示设置成功,false则表示设置失败。 | - 示例: - ``` + ```typescript import featureAbility from '@ohos.featureAbility'; //更新数据项亮度的值(该数据项在数据库中已存在,故setValueSync方法将更新该数据项的值) diff --git a/zh-cn/application-dev/reference/apis/js-apis-socket.md b/zh-cn/application-dev/reference/apis/js-apis-socket.md index 0b570cefdda585fa0d9bcc81c02b809a2c4b686b..e6958bcba25264fac5fe7ee7c64ab58df3107fce 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-socket.md +++ b/zh-cn/application-dev/reference/apis/js-apis-socket.md @@ -110,6 +110,8 @@ send\(options: UDPSendOptions, callback: AsyncCallback\): void 通过UDPSocket连接发送数据。使用callback方式作为异步方法。 +发送数据前,需要先调用[UDPSocket.bind()](#bind)绑定IP地址和端口。 + **需要权限**:ohos.permission.INTERNET **系统能力**:SystemCapability.Communication.NetStack @@ -148,6 +150,8 @@ send\(options: UDPSendOptions\): Promise 通过UDPSocket连接发送数据。使用Promise方式作为异步方法。 +发送数据前,需要先调用[UDPSocket.bind()](#bind)绑定IP地址和端口。 + **需要权限**:ohos.permission.INTERNET **系统能力**:SystemCapability.Communication.NetStack diff --git a/zh-cn/application-dev/reference/apis/js-apis-window.md b/zh-cn/application-dev/reference/apis/js-apis-window.md index 507f67d85cf93cf3b8c0abfc7546213e10b0236b..64130a267005cd2cabd62bc83de18d848f849d88 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-window.md +++ b/zh-cn/application-dev/reference/apis/js-apis-window.md @@ -2,7 +2,8 @@ 窗口提供管理窗口的一些基础能力,包括对窗口的创建、销毁,以及对窗口的属性设置等各项功能。 -> **说明:** +> **说明:** +> > 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 ## 导入模块 @@ -108,7 +109,7 @@ import window from '@ohos.window'; ## AvoidArea7+ -表示窗口内容规避区域。 +窗口内容规避区域。 **系统能力:** 以下各项对应的系统能力均为SystemCapability.WindowManager.WindowManager.Core。 @@ -136,20 +137,19 @@ import window from '@ohos.window'; **系统能力:** 以下各项对应的系统能力均为SystemCapability.WindowManager.WindowManager.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| ------------------------------- | ------------------------- | ---- | ---- | ------------------------------------------------------------ | -| windowRect7+ | [Rect](#rect) | 是 | 是 | 窗口尺寸。 | -| type7+ | [WindowType](#windowtype) | 是 | 是 | 窗口类型。 | -| isFullScreen | boolean | 是 | 是 | 是否全屏,默认为false。 | -| isLayoutFullScreen7+ | boolean | 是 | 是 | 窗口是否为沉浸式,默认为false。 | -| focusable7+ | boolean | 是 | 否 | 窗口是否可聚焦,默认为true。 | -| touchable7+ | boolean | 是 | 否 | 窗口是否可触摸,默认为true。 | -| brightness | number | 是 | 是 | 屏幕亮度, 取值范围为0~1,1表示最大亮度值。
本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 | -| dimBehindValue7+ | number | 是 | 是 | 靠后窗口的暗度值,取值范围为0~1,1表示最暗。
本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 | -| isKeepScreenOn | boolean | 是 | 是 | 屏幕是否常亮,默认为false。
本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 | -| isPrivacyMode7+ | boolean | 是 | 是 | 隐私模式,默认为false。
本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 | -| isRoundCorner7+ | boolean | 是 | 是 | 窗口是否为圆角。默认为false。
本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 | -| isTransparent7+ | boolean | 是 | 是 | 窗口是否透明。默认为false。
本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| ------------------------------- | ------------------------- | ---- | ---- | -------------------------------------------- | +| windowRect7+ | [Rect](#rect) | 是 | 是 | 窗口尺寸。 | +| type7+ | [WindowType](#windowtype) | 是 | 是 | 窗口类型。 | +| isFullScreen | boolean | 是 | 是 | 是否全屏,默认为false。 | +| isLayoutFullScreen7+ | boolean | 是 | 是 | 窗口是否为沉浸式,默认为false。 | +| focusable7+ | boolean | 是 | 否 | 窗口是否可聚焦,默认为true。 | +| touchable7+ | boolean | 是 | 否 | 窗口是否可触摸,默认为true。 | +| brightness | number | 是 | 是 | 屏幕亮度, 取值范围为0~1,1表示最大亮度值。 | +| isKeepScreenOn | boolean | 是 | 是 | 屏幕是否常亮,默认为false。 | +| isPrivacyMode7+ | boolean | 是 | 是 | 隐私模式,默认为false。 | +| isRoundCorner7+ | boolean | 是 | 是 | 窗口是否为圆角。默认为false。 | +| isTransparent7+ | boolean | 是 | 是 | 窗口是否透明。默认为false。 | ## ColorSpace8+ @@ -166,21 +166,21 @@ import window from '@ohos.window'; create(id: string, type: WindowType, callback: AsyncCallback<Window>): void -创建子窗口,使用callback方式作为异步方法。 +创建子窗口,使用callback异步回调。 从API version 8开始,此接口废弃,推荐使用[window.create8+](#windowcreate8)接口。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------------------------------------- | ---- | -------------------------- | - | id | string | 是 | 窗口id。 | - | type | [WindowType](#windowtype) | 是 | 窗口类型。 | - | callback | AsyncCallback<[Window](#window)> | 是 | 回调返回创建的子窗口对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------------------- | ---- | -------------------------- | +| id | string | 是 | 窗口id。 | +| type | [WindowType](#windowtype) | 是 | 窗口类型。 | +| callback | AsyncCallback<[Window](#window)> | 是 | 回调返回创建的子窗口对象。 | -**示例:** +**示例:** ```js var windowClass = null; @@ -199,26 +199,26 @@ create(id: string, type: WindowType, callback: AsyncCallback<Window>): voi create(id: string, type: WindowType): Promise<Window> -创建子窗口,使用Promise方式作为异步方法。 +创建子窗口,使用Promise异步回调。 从API version 8开始,此接口废弃,推荐使用[window.create8+](#windowcreate8)接口。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------ | ------------------------- | ---- | ---------- | - | id | string | 是 | 窗口id。 | - | type | [WindowType](#windowtype) | 是 | 窗口类型。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------------------------- | ---- | ---------- | +| id | string | 是 | 窗口id。 | +| type | [WindowType](#windowtype) | 是 | 窗口类型。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | -------------------------------- | ------------------------------------------------- | - | Promise<[Window](#window)> | 以Promise形式返回结果,返回当前创建的子窗口对象。 | +| 类型 | 说明 | +| -------------------------------- | ------------------------------------------------- | +| Promise<[Window](#window)> | 以Promise形式返回结果,返回当前创建的子窗口对象。 | -**示例:** +**示例:** ```js var windowClass = null; @@ -235,22 +235,22 @@ create(id: string, type: WindowType): Promise<Window> create(ctx: Context, id: string, type: WindowType, callback: AsyncCallback<Window>): void -创建子窗口,使用callback方式作为异步方法,其中Context详见[Context](js-apis-Context.md)。 +创建子窗口,使用callback异步回调,其中Context详见[Context](js-apis-Context.md)。 -从API version 9开始,当Context为[ServiceExtensionContext](js-apis-service-extension-context.md)时,创建系统窗口,使用callback方式作为异步方法。 +从API version 9开始,当Context为[ServiceExtensionContext](js-apis-service-extension-context.md)时,创建系统窗口,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------------------------------------- | ---- | ------------------------------------------------------------ | - | ctx | Context | 是 | 当前应用上下文信息。
API version 8的Context定义见[Context](js-apis-Context.md)。
API version 9的Context定义见[Context](js-apis-service-extension-context.md)。 | - | id | string | 是 | 窗口id。 | - | type | [WindowType](#windowtype) | 是 | 窗口类型。 | - | callback | AsyncCallback<[Window](#window)> | 是 | 回调返回当前窗口对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------------------- | ---- | ------------------------------------------------------------ | +| ctx | Context | 是 | 当前应用上下文信息。
API version 8的Context定义见[Context](js-apis-Context.md)。
API version 9的Context定义见[Context](js-apis-service-extension-context.md)。 | +| id | string | 是 | 窗口id。 | +| type | [WindowType](#windowtype) | 是 | 窗口类型。 | +| callback | AsyncCallback<[Window](#window)> | 是 | 回调返回当前窗口对象。 | -**示例:** +**示例:** ```js var windowClass = null; @@ -269,27 +269,27 @@ create(ctx: Context, id: string, type: WindowType, callback: AsyncCallback<Wi create(ctx: Context, id: string, type: WindowType): Promise<Window> -创建子窗口,使用Promise方式作为异步方法,其中Context详见[Context](js-apis-Context.md)。 +创建子窗口,使用Promise异步回调,其中Context详见[Context](js-apis-Context.md)。 -从API version 9开始,当Context为[ServiceExtensionContext](js-apis-service-extension-context.md)时,创建系统窗口,使用Promise方式作为异步方法。 +从API version 9开始,当Context为[ServiceExtensionContext](js-apis-service-extension-context.md)时,创建系统窗口,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------ | ------------------------- | ---- | ------------------------------------------------------------ | - | ctx | Context | 是 | 当前应用上下文信息。
API version 8的Context定义见[Context](js-apis-Context.md)。
API version 9的Context定义见[Context](js-apis-service-extension-context.md)。 | - | id | string | 是 | 窗口id。 | - | type | [WindowType](#windowtype) | 是 | 窗口类型。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------------------------- | ---- | ------------------------------------------------------------ | +| ctx | Context | 是 | 当前应用上下文信息。
API version 8的Context定义见[Context](js-apis-Context.md)。
API version 9的Context定义见[Context](js-apis-service-extension-context.md)。 | +| id | string | 是 | 窗口id。 | +| type | [WindowType](#windowtype) | 是 | 窗口类型。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | -------------------------------- | ----------------------------------------------- | - | Promise<[Window](#window)> | 以Promise形式返回结果,返回当前创建的窗口对象。 | +| 类型 | 说明 | +| -------------------------------- | ----------------------------------------------- | +| Promise<[Window](#window)> | 以Promise形式返回结果,返回当前创建的窗口对象。 | -**示例:** +**示例:** ```js var windowClass = null; @@ -306,18 +306,18 @@ create(ctx: Context, id: string, type: WindowType): Promise<Window> find(id: string, callback: AsyncCallback<Window>): void -查找id所对应的窗口,使用callback方式作为异步方法。 +查找id所对应的窗口,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------------------------------------- | ---- | ---------------------------- | - | id | string | 是 | 窗口id。 | - | callback | AsyncCallback<[Window](#window)> | 是 | 回调返回当前查找的窗口对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------------------- | ---- | ---------------------------- | +| id | string | 是 | 窗口id。 | +| callback | AsyncCallback<[Window](#window)> | 是 | 回调返回当前查找的窗口对象。 | -**示例:** +**示例:** ```js var windowClass = null; @@ -335,23 +335,23 @@ find(id: string, callback: AsyncCallback<Window>): void find(id: string): Promise<Window> -查找id所对应的窗口,使用Promise方式作为异步方法。 +查找id所对应的窗口,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------ | ------ | ---- | -------- | - | id | string | 是 | 窗口id。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | -------- | +| id | string | 是 | 窗口id。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | -------------------------------- | ----------------------------------------------- | - | Promise<[Window](#window)> | 以Promise形式返回结果,返回当前查找的窗口对象。 | +| 类型 | 说明 | +| -------------------------------- | ----------------------------------------------- | +| Promise<[Window](#window)> | 以Promise形式返回结果,返回当前查找的窗口对象。 | -**示例:** +**示例:** ```js var windowClass = null; @@ -368,19 +368,19 @@ find(id: string): Promise<Window> getTopWindow(callback: AsyncCallback<Window>): void -获取当前应用内最后显示的窗口,使用callback方式作为异步方法。 +获取当前应用内最后显示的窗口,使用callback异步回调。 从API version 8开始,此接口废弃,推荐使用[window.getTopWindow8+](#windowgettopwindow8)接口。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------------------------------------- | ---- | -------------------------------------- | - | callback | AsyncCallback<[Window](#window)> | 是 | 回调返回当前应用内最后显示的窗口对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------------------- | ---- | -------------------------------------- | +| callback | AsyncCallback<[Window](#window)> | 是 | 回调返回当前应用内最后显示的窗口对象。 | -**示例:** +**示例:** ```js var windowClass = null; @@ -398,19 +398,19 @@ getTopWindow(callback: AsyncCallback<Window>): void getTopWindow(): Promise<Window> -获取当前应用内最后显示的窗口,使用Promise方式作为异步方法。 +获取当前应用内最后显示的窗口,使用Promise异步回调。 从API version 8开始,此接口废弃,推荐使用[window.getTopWindow8+](#windowgettopwindow8)接口。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**返回值:** +**返回值:** - | 类型 | 说明 | - | -------------------------------- | --------------------------------------------------------- | - | Promise<[Window](#window)> | 以Promise形式返回结果,返回当前应用内最后显示的窗口对象。 | +| 类型 | 说明 | +| -------------------------------- | --------------------------------------------------------- | +| Promise<[Window](#window)> | 以Promise形式返回结果,返回当前应用内最后显示的窗口对象。 | -**示例:** +**示例:** ```js var windowClass = null; @@ -427,18 +427,18 @@ getTopWindow(): Promise<Window> getTopWindow(ctx: Context, callback: AsyncCallback<Window>): void -获取当前应用内最后显示的窗口,使用callback方式作为异步方法。 +获取当前应用内最后显示的窗口,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------------------------------------- | ---- | ------------------------------------------------------------ | - | ctx | Context | 是 | 当前应用上下文信息。
API version 8的Context定义见[Context](js-apis-Context.md)。
API version 9的Context定义见[Context](js-apis-ability-context.md)。 | - | callback | AsyncCallback<[Window](#window)> | 是 | 回调返回当前应用内最后显示的窗口对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------------------- | ---- | ------------------------------------------------------------ | +| ctx | Context | 是 | 当前应用上下文信息。
API version 8的Context定义见[Context](js-apis-Context.md)。
API version 9的Context定义见[Context](js-apis-ability-context.md)。 | +| callback | AsyncCallback<[Window](#window)> | 是 | 回调返回当前应用内最后显示的窗口对象。 | -**示例:** +**示例:** ```js var windowClass = null; @@ -456,23 +456,23 @@ getTopWindow(ctx: Context, callback: AsyncCallback<Window>): void getTopWindow(ctx: Context): Promise<Window> -获取当前应用内最后显示的窗口,使用Promise方式作为异步方法。 +获取当前应用内最后显示的窗口,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------ | ------- | ---- | ------------------------------------------------------------ | - | ctx | Context | 是 | 当前应用上下文信息。
API version 8的Context定义见[Context](js-apis-Context.md)。
API version 9的Context定义见[Context](js-apis-ability-context.md)。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------- | ---- | ------------------------------------------------------------ | +| ctx | Context | 是 | 当前应用上下文信息。
API version 8的Context定义见[Context](js-apis-Context.md)。
API version 9的Context定义见[Context](js-apis-ability-context.md)。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | -------------------------------- | --------------------------------------------------------- | - | Promise<[Window](#window)> | 以Promise形式返回结果,返回当前应用内最后显示的窗口对象。 | +| 类型 | 说明 | +| -------------------------------- | --------------------------------------------------------- | +| Promise<[Window](#window)> | 以Promise形式返回结果,返回当前应用内最后显示的窗口对象。 | -**示例:** +**示例:** ```js var windowClass = null; @@ -495,14 +495,14 @@ on(type: 'systemBarTintChange', callback: Callback<SystemBarTintState>): v **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ | - | type | string | 是 | 监听事件,固定为'systemBarTintChange',即导航栏、状态栏属性变化事件。 | - | callback | Callback<[SystemBarTintState](#systembartintstate)> | 是 | 回调返回监听到的信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ | +| type | string | 是 | 监听事件,固定为'systemBarTintChange',即导航栏、状态栏属性变化事件。 | +| callback | Callback<[SystemBarTintState](#systembartintstate)> | 是 | 回调返回监听到的信息。 | -**示例:** +**示例:** ```js var type = 'systemBarTintChange'; @@ -521,14 +521,14 @@ off(type: 'systemBarTintChange', callback?: Callback<SystemBarTintState >) **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ | - | type | string | 是 | 监听事件,固定为'systemBarTintChange',即导航栏、状态栏属性变化事件。 | - | callback | Callback<[SystemBarTintState](#systembartintstate)> | 否 | 回调返回监听到的信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ | +| type | string | 是 | 监听事件,固定为'systemBarTintChange',即导航栏、状态栏属性变化事件。 | +| callback | Callback<[SystemBarTintState](#systembartintstate)> | 否 | 回调返回监听到的信息。 | -**示例:** +**示例:** ```js var type = 'systemBarTintChange'; @@ -537,25 +537,25 @@ off(type: 'systemBarTintChange', callback?: Callback<SystemBarTintState >) ## Window -下列API示例中都需使用[getTopWindow()](#windowgettopwindow)、[create()](#windowcreate7)、[find()](#windowfind7)等先获取到Window实例,再通过此实例调用对应方法。 +下列API示例中都需先使用[getTopWindow()](#windowgettopwindow)、[create()](#windowcreate7)、[find()](#windowfind7)中的任一方法获取到Window实例,再通过此实例调用对应方法。 ### hide7+ hide (callback: AsyncCallback<void>): void -隐藏当前窗口,使用callback方式作为异步方法。 +隐藏当前窗口,使用callback异步回调。 此接口为系统接口,三方应用不支持调用。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ------------------------- | ---- | ---------- | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------- | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js windowClass.hide((err, data) => { @@ -571,19 +571,19 @@ hide (callback: AsyncCallback<void>): void hide(): Promise<void> -隐藏当前窗口,使用Promise方式作为异步方法。 +隐藏当前窗口,使用Promise异步回调。 此接口为系统接口,三方应用不支持调用。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js let promise = windowClass.hide(); @@ -598,17 +598,17 @@ hide(): Promise<void> show(callback: AsyncCallback<void>): void -显示当前窗口,使用callback方式作为异步方法。 +显示当前窗口,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ------------------------- | ---- | ---------- | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------- | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js windowClass.show((err, data) => { @@ -624,17 +624,17 @@ show(callback: AsyncCallback<void>): void show(): Promise<void> -显示当前窗口,使用Promise方式作为异步方法。 +显示当前窗口,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js let promise = windowClass.show(); @@ -649,17 +649,17 @@ show(): Promise<void> destroy(callback: AsyncCallback<void>): void -销毁当前窗口,使用callback方式作为异步方法。 +销毁当前窗口,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ------------------------- | ---- | ---------- | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------- | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js windowClass.destroy((err, data) => { @@ -675,17 +675,17 @@ destroy(callback: AsyncCallback<void>): void destroy(): Promise<void> -销毁当前窗口,使用Promise方式作为异步方法。 +销毁当前窗口,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js let promise = windowClass.destroy(); @@ -700,19 +700,19 @@ destroy(): Promise<void> moveTo(x: number, y: number, callback: AsyncCallback<void>): void -移动窗口位置,使用callback方式作为异步方法。 +移动窗口位置,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ------------------------- | ---- | --------------------------------------- | - | x | number | 是 | 窗口在x轴方向移动的值,值为正表示右移。 | - | y | number | 是 | 窗口在y轴方向移动的值,值为正表示下移。 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | --------------------------------------- | +| x | number | 是 | 窗口在x轴方向移动的值,值为正表示右移。 | +| y | number | 是 | 窗口在y轴方向移动的值,值为正表示下移。 | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js windowClass.moveTo(300, 300, (err, data)=>{ @@ -729,24 +729,24 @@ moveTo(x: number, y: number, callback: AsyncCallback<void>): void moveTo(x: number, y: number): Promise<void> -移动窗口位置,使用Promise方式作为异步方法。 +移动窗口位置,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------ | ------ | ---- | --------------------------------------- | - | x | number | 是 | 窗口在x轴方向移动的值,值为正表示右移。 | - | y | number | 是 | 窗口在y轴方向移动的值,值为正表示下移。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | --------------------------------------- | +| x | number | 是 | 窗口在x轴方向移动的值,值为正表示右移。 | +| y | number | 是 | 窗口在y轴方向移动的值,值为正表示下移。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js let promise = windowClass.moveTo(300, 300); @@ -761,19 +761,19 @@ moveTo(x: number, y: number): Promise<void> resetSize(width: number, height: number, callback: AsyncCallback<void>): void -改变当前窗口大小,使用callback方式作为异步方法。 +改变当前窗口大小,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ------------------------- | ---- | ---------------- | - | width | number | 是 | 目标窗口的宽度。 | - | height | number | 是 | 目标窗口的高度。 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------------- | +| width | number | 是 | 目标窗口的宽度。 | +| height | number | 是 | 目标窗口的高度。 | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js windowClass.resetSize(500, 1000, (err, data) => { @@ -789,24 +789,24 @@ resetSize(width: number, height: number, callback: AsyncCallback<void>): v resetSize(width: number, height: number): Promise<void> -改变当前窗口大小,使用Promise方式作为异步方法。 +改变当前窗口大小,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------ | ------ | ---- | ---------------- | - | width | number | 是 | 目标窗口的宽度。 | - | height | number | 是 | 目标窗口的高度。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ---------------- | +| width | number | 是 | 目标窗口的宽度。 | +| height | number | 是 | 目标窗口的高度。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js let promise = windowClass.resetSize(500, 1000); @@ -821,20 +821,20 @@ resetSize(width: number, height: number): Promise<void> setWindowType(type: WindowType, callback: AsyncCallback<void>): void -设置窗口类型,使用callback方式作为异步方法。 +设置窗口类型,使用callback异步回调。 此接口为系统接口,三方应用不支持调用。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ------------------------- | ---- | ---------- | - | type | [WindowType](#windowtype) | 是 | 窗口类型。 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------- | +| type | [WindowType](#windowtype) | 是 | 窗口类型。 | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js var type = window.TYPE_APP; @@ -851,25 +851,25 @@ setWindowType(type: WindowType, callback: AsyncCallback<void>): void setWindowType(type: WindowType): Promise<void> -设置窗口类型,使用Promise方式作为异步方法。 +设置窗口类型,使用Promise异步回调。 此接口为系统接口,三方应用不支持调用。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------ | ------------------------- | ---- | ---------- | - | type | [WindowType](#windowtype) | 是 | 窗口类型。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------------------------- | ---- | ---------- | +| type | [WindowType](#windowtype) | 是 | 窗口类型。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js var type = window.TYPE_APP; @@ -885,17 +885,17 @@ setWindowType(type: WindowType): Promise<void> getProperties(callback: AsyncCallback<WindowProperties>): void -获取当前窗口的属性,使用callback方式作为异步方法返回WindowProperties。 +获取当前窗口的属性,使用callback异步回调,返回WindowProperties。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ---------------------------------------------------------- | ---- | ------------------ | - | callback | AsyncCallback<[WindowProperties](#windowproperties)> | 是 | 回调返回窗口属性。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------------------------- | ---- | ------------------ | +| callback | AsyncCallback<[WindowProperties](#windowproperties)> | 是 | 回调返回窗口属性。 | -**示例:** +**示例:** ```js windowClass.getProperties((err, data) => { @@ -911,17 +911,17 @@ getProperties(callback: AsyncCallback<WindowProperties>): void getProperties(): Promise<WindowProperties> -获取当前窗口的属性,使用promise方式作为异步方法返回WindowProperties。 +获取当前窗口的属性,使用Promise异步回调,返回WindowProperties。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**返回值:** +**返回值:** - | 类型 | 说明 | - | ---------------------------------------------------- | ------------------------------------- | - | Promise<[WindowProperties](#windowproperties)> | 以Promise形式返回结果,返回窗口属性。 | +| 类型 | 说明 | +| ---------------------------------------------------- | ------------------------------------- | +| Promise<[WindowProperties](#windowproperties)> | 以Promise形式返回结果,返回窗口属性。 | -**示例:** +**示例:** ```js let promise = windowClass.getProperties(); @@ -936,18 +936,18 @@ getProperties(): Promise<WindowProperties> getAvoidArea(type: AvoidAreaType, callback: AsyncCallback<AvoidArea>): void -获取窗口内容规避的区域,如系统的系统栏区域、凹凸区域。使用callback方式作为异步方法。 +获取窗口内容规避的区域,如系统的系统栏区域、凹凸区域。使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------------------------------------------- | ---- | ------------------------------------------------------------ | - | type | [AvoidAreaType](#avoidareatype) | 是 | 表示规避区类型。type为TYPE_SYSTEM,表示系统默认区域。type为TYPE_CUTOUT,表示刘海屏区域。 | - | callback | AsyncCallback<[AvoidArea](#avoidarea)> | 是 | 回调返回窗口内容规避区域。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------------------------- | ---- | ------------------------------------------------------------ | +| type | [AvoidAreaType](#avoidareatype) | 是 | 表示规避区类型。type为TYPE_SYSTEM,表示系统默认区域。type为TYPE_CUTOUT,表示刘海屏区域。 | +| callback | AsyncCallback<[AvoidArea](#avoidarea)> | 是 | 回调返回窗口内容规避区域。 | -**示例:** +**示例:** ```js var type = window.AvoidAreaType.TYPE_SYSTEM; @@ -964,23 +964,23 @@ getAvoidArea(type: AvoidAreaType, callback: AsyncCallback<AvoidArea>): voi getAvoidArea(type: AvoidAreaType): Promise<AvoidArea> -获取窗口内容规避的区域,如系统的系统栏区域、凹凸区域。使用promise方式作为异步方法。 +获取窗口内容规避的区域,如系统的系统栏区域、凹凸区域。使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------ | ------------------------------- | ---- | ------------------------------------------------------------ | - | type | [AvoidAreaType](#avoidareatype) | 是 | 表示规避区类型。type为TYPE_SYSTEM,表示系统默认区域。type为TYPE_CUTOUT,表示刘海屏区域。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------------------------------- | ---- | ------------------------------------------------------------ | +| type | [AvoidAreaType](#avoidareatype) | 是 | 表示规避区类型。type为TYPE_SYSTEM,表示系统默认区域。type为TYPE_CUTOUT,表示刘海屏区域。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | -------------------------------------- | --------------------------------------------- | - | Promise<[AvoidArea](#avoidarea)> | 以Promise形式返回结果,返回窗口内容规避区域。 | +| 类型 | 说明 | +| -------------------------------------- | --------------------------------------------- | +| Promise<[AvoidArea](#avoidarea)> | 以Promise形式返回结果,返回窗口内容规避区域。 | -**示例:** +**示例:** ```js let promise = windowClass.getAvoidArea(); @@ -995,18 +995,18 @@ getAvoidArea(type: AvoidAreaType): Promise<AvoidArea> setFullScreen(isFullScreen: boolean, callback: AsyncCallback<void>): void -设置是否为全屏状态,使用callback方式作为异步方法。 +设置是否为全屏状态,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------------ | ------------------------- | ---- | ---------------------------------------------- | - | isFullScreen | boolean | 是 | 是否设为全屏状态,且全屏状态隐藏状态栏导航栏。 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------------ | ------------------------- | ---- | ---------------------------------------------- | +| isFullScreen | boolean | 是 | 是否设为全屏状态,且全屏状态隐藏状态栏导航栏。 | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js var isFullScreen = true; @@ -1023,23 +1023,23 @@ setFullScreen(isFullScreen: boolean, callback: AsyncCallback<void>): void setFullScreen(isFullScreen: boolean): Promise<void> -设置是否为全屏状态,使用Promise方式作为异步方法。 +设置是否为全屏状态,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------------ | ------- | ---- | ---------------------------------------------- | - | isFullScreen | boolean | 是 | 是否设为全屏状态,且全屏状态隐藏状态栏导航栏。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------------ | ------- | ---- | ---------------------------------------------- | +| isFullScreen | boolean | 是 | 是否设为全屏状态,且全屏状态隐藏状态栏导航栏。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js var isFullScreen = true; @@ -1055,18 +1055,18 @@ setFullScreen(isFullScreen: boolean): Promise<void> setLayoutFullScreen(isLayoutFullScreen: boolean, callback: AsyncCallback<void>): void -设置窗口的布局是否为全屏显示状态,使用callback方式作为异步方法。 +设置窗口的布局是否为全屏显示状态,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------------------ | ------------------------- | ---- | ------------------------------------------------------------ | - | isLayoutFullScreen | boolean | 是 | 窗口的布局是否为全屏显示状态,且全屏状态下状态栏、导航栏仍然显示。 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------------------ | ------------------------- | ---- | ------------------------------------------------------------ | +| isLayoutFullScreen | boolean | 是 | 窗口的布局是否为全屏显示状态,且全屏状态下状态栏、导航栏仍然显示。 | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js var isLayoutFullScreen= true; @@ -1083,23 +1083,23 @@ setLayoutFullScreen(isLayoutFullScreen: boolean, callback: AsyncCallback<void setLayoutFullScreen(isLayoutFullScreen: boolean): Promise<void> -设置窗口的布局是否为全屏显示状态,使用Promise方式作为异步方法。 +设置窗口的布局是否为全屏显示状态,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------------------ | ------- | ---- | ------------------------------------------------------------ | - | isLayoutFullScreen | boolean | 是 | 窗口的布局是否为全屏显示状态,且全屏状态下状态栏、导航栏仍然显示。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------------------ | ------- | ---- | ------------------------------------------------------------ | +| isLayoutFullScreen | boolean | 是 | 窗口的布局是否为全屏显示状态,且全屏状态下状态栏、导航栏仍然显示。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js var isLayoutFullScreen = true; @@ -1115,18 +1115,18 @@ setLayoutFullScreen(isLayoutFullScreen: boolean): Promise<void> setSystemBarEnable(names: Array<'status' | 'navigation'>, callback: AsyncCallback<void>): void -设置导航栏、状态栏的可见模式,使用callback方式作为异步方法。 +设置导航栏、状态栏的可见模式,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ------------------------- | ---- | ------------------------------------------------------------ | - | names | Array | 是 | 设置状态栏和导航栏是否显示。例如,需全部显示,该参数设置为["status", "navigation"], 不设置,则默认不显示。 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ------------------------------------------------------------ | +| names | Array | 是 | 设置状态栏和导航栏是否显示。例如,需全部显示,该参数设置为["status", "navigation"], 不设置,则默认不显示。 | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js var names = ["status", "navigation"]; @@ -1143,23 +1143,23 @@ setSystemBarEnable(names: Array<'status' | 'navigation'>, callback: AsyncCallbac setSystemBarEnable(names: Array<'status' | 'navigation'>): Promise<void> -设置导航栏、状态栏的可见模式,使用Promise方式作为异步方法。 +设置导航栏、状态栏的可见模式,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------ | ----- | ---- | ------------------------------------------------------------ | - | names | Array | 是 | 设置状态栏和导航栏是否显示。例如,需全部显示,该参数设置为["status", "navigation"], 不设置,则默认不显示。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ----- | ---- | ------------------------------------------------------------ | +| names | Array | 是 | 设置状态栏和导航栏是否显示。例如,需全部显示,该参数设置为["status", "navigation"], 不设置,则默认不显示。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js var names = ["status", "navigation"]; @@ -1175,18 +1175,18 @@ setSystemBarEnable(names: Array<'status' | 'navigation'>): Promise<void> setSystemBarProperties(systemBarProperties: SystemBarProperties, callback: AsyncCallback<void>): void -设置窗口内导航栏、状态栏的属性,使用callback方式作为异步方法。 +设置窗口内导航栏、状态栏的属性,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------------------- | ------------------------------------------- | ---- | -------------------- | - | SystemBarProperties | [SystemBarProperties](#systembarproperties) | 是 | 导航栏状态栏的属性。 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------------------- | ------------------------------------------- | ---- | -------------------- | +| SystemBarProperties | [SystemBarProperties](#systembarproperties) | 是 | 导航栏状态栏的属性。 | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js var SystemBarProperties={ @@ -1212,23 +1212,23 @@ setSystemBarProperties(systemBarProperties: SystemBarProperties, callback: Async setSystemBarProperties(systemBarProperties: SystemBarProperties): Promise<void> -设置窗口内导航栏、状态栏的属性,使用Promise方式作为异步方法。 +设置窗口内导航栏、状态栏的属性,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------------------- | ------------------------------------------- | ---- | -------------------- | - | SystemBarProperties | [SystemBarProperties](#systembarproperties) | 是 | 导航栏状态栏的属性。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------------------- | ------------------------------------------- | ---- | -------------------- | +| SystemBarProperties | [SystemBarProperties](#systembarproperties) | 是 | 导航栏状态栏的属性。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js var SystemBarProperties={ @@ -1253,18 +1253,18 @@ setSystemBarProperties(systemBarProperties: SystemBarProperties): Promise<voi loadContent(path: string, callback: AsyncCallback<void>): void -当前窗口加载具体页面内容,使用callback方式作为异步方法。 +当前窗口加载具体页面内容,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ------------------------- | ---- | -------------------- | - | path | string | 是 | 设置加载页面的路径。 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | -------------------- | +| path | string | 是 | 设置加载页面的路径。 | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js windowClass.loadContent("pages/page2/page2", (err, data) => { @@ -1280,23 +1280,23 @@ loadContent(path: string, callback: AsyncCallback<void>): void loadContent(path: string): Promise<void> -当前窗口加载具体页面内容,使用Promise方式作为异步方法。 +当前窗口加载具体页面内容,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------ | ------ | ---- | -------------------- | - | path | string | 是 | 设置加载页面的路径。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | -------------------- | +| path | string | 是 | 设置加载页面的路径。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js let promise = windowClass.loadContent("pages/page2/page2"); @@ -1311,17 +1311,17 @@ loadContent(path: string): Promise<void> isShowing(callback: AsyncCallback<boolean>): void -判断当前窗口是否已显示,使用callback方式作为异步方法。 +判断当前窗口是否已显示,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ---------------------------- | ---- | -------------------------------- | - | callback | AsyncCallback<boolean> | 是 | 回调函数返回是否显示子窗口结果。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------- | ---- | -------------------------------- | +| callback | AsyncCallback<boolean> | 是 | 回调函数返回是否显示子窗口结果。 | -**示例:** +**示例:** ```js windowClass.isShowing((err, data) => { @@ -1337,17 +1337,17 @@ isShowing(callback: AsyncCallback<boolean>): void isShowing(): Promise<boolean> -判断当前窗口是否已显示,使用Promise方式作为异步方法。 +判断当前窗口是否已显示,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**返回值:** +**返回值:** - | 类型 | 说明 | - | ---------------------- | ----------------------------------------------------- | - | Promise<boolean> | 以Promise形式返回结果,返回当前窗口是否已显示的结果。 | +| 类型 | 说明 | +| ---------------------- | ----------------------------------------------------- | +| Promise<boolean> | 以Promise形式返回结果,返回当前窗口是否已显示的结果。 | -**示例:** +**示例:** ```js let promise = windowClass.isShowing(); @@ -1366,14 +1366,14 @@ on(type: 'windowSizeChange', callback: Callback<Size>): void **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ----------------------------- | ---- | -------------------------------------------------------- | - | type | string | 是 | 监听事件,固定为'windowSizeChange',即窗口尺寸变化事件。 | - | callback | Callback<[Size](#size)> | 是 | 回调返回监听到的信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ----------------------------- | ---- | -------------------------------------------------------- | +| type | string | 是 | 监听事件,固定为'windowSizeChange',即窗口尺寸变化事件。 | +| callback | Callback<[Size](#size)> | 是 | 回调返回监听到的信息。 | -**示例:** +**示例:** ```js var type = 'windowSizeChange'; @@ -1390,14 +1390,14 @@ off(type: 'windowSizeChange', callback?: Callback<Size >): void **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ----------------------------- | ---- | -------------------------------------------------------- | - | type | string | 是 | 监听事件,固定为'windowSizeChange',即窗口尺寸变化事件。 | - | callback | Callback<[Size](#size)> | 否 | 回调返回监听到的信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ----------------------------- | ---- | -------------------------------------------------------- | +| type | string | 是 | 监听事件,固定为'windowSizeChange',即窗口尺寸变化事件。 | +| callback | Callback<[Size](#size)> | 否 | 回调返回监听到的信息。 | -**示例:** +**示例:** ```js var type = 'windowSizeChange'; @@ -1412,14 +1412,14 @@ on(type: 'systemAvoidAreaChange', callback: Callback<AvoidArea>): void **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | --------------------------------------- | ---- | ------------------------------------------------------------ | - | type | string | 是 | 监听事件,固定为'systemAvoidAreaChange',即系统窗口规避区变化事件。 | - | callback | Callback<[AvoidArea](#avoidarea)> | 是 | 回调返回监听到的信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------------------- | ---- | ------------------------------------------------------------ | +| type | string | 是 | 监听事件,固定为'systemAvoidAreaChange',即系统窗口规避区变化事件。 | +| callback | Callback<[AvoidArea](#avoidarea)> | 是 | 回调返回监听到的信息。 | -**示例:** +**示例:** ```js var type = 'systemAvoidAreaChange'; @@ -1436,14 +1436,14 @@ off(type: 'systemAvoidAreaChange', callback?: Callback<AvoidArea>): void **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | --------------------------------------- | ---- | ------------------------------------------------------------ | - | type | string | 是 | 监听事件,固定为'systemAvoidAreaChange',即系统窗口规避区变化事件。 | - | callback | Callback<[AvoidArea](#avoidarea)> | 否 | 回调返回监听到的信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------------------- | ---- | ------------------------------------------------------------ | +| type | string | 是 | 监听事件,固定为'systemAvoidAreaChange',即系统窗口规避区变化事件。 | +| callback | Callback<[AvoidArea](#avoidarea)> | 否 | 回调返回监听到的信息。 | -**示例:** +**示例:** ```js var type = 'systemAvoidAreaChange'; @@ -1456,18 +1456,16 @@ on(type: 'keyboardHeightChange', callback: Callback<number>): void 开启键盘高度变化的监听。 -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 - **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ------------------ | ---- | ------------------------------------------------------------ | - | type | string | 是 | 监听事件,固定为'keyboardHeightChange',即键盘高度变化事件。 | - | callback | Callbacknumber> | 是 | 回调返回监听到的信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------ | ---- | ------------------------------------------------------------ | +| type | string | 是 | 监听事件,固定为'keyboardHeightChange',即键盘高度变化事件。 | +| callback | Callbacknumber> | 是 | 回调返回监听到的信息。 | -**示例:** +**示例:** ```js var type = 'keyboardHeightChange'; @@ -1482,18 +1480,16 @@ off(type: 'keyboardHeightChange', callback?: Callback<number>): void 关闭键盘高度变化的监听。 -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 - **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ---------------------- | ---- | ------------------------------------------------------------ | - | type | string | 是 | 监听事件,固定为'keyboardHeightChange',即键盘高度变化事件。 | - | callback | Callback<number> | 否 | 回调返回监听到的信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------- | ---- | ------------------------------------------------------------ | +| type | string | 是 | 监听事件,固定为'keyboardHeightChange',即键盘高度变化事件。 | +| callback | Callback<number> | 否 | 回调返回监听到的信息。 | -**示例:** +**示例:** ```js var type = 'keyboardHeightChange'; @@ -1504,17 +1500,17 @@ off(type: 'keyboardHeightChange', callback?: Callback<number>): void isSupportWideGamut(callback: AsyncCallback<boolean>): void -判断当前窗口是否支持广色域模式,使用callback方式作为异步方法。 +判断当前窗口是否支持广色域模式,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ---------------------------- | ---- | -------------------------------- | - | callback | AsyncCallback<boolean> | 是 | 回调函数返回是否支持广色域模式。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------- | ---- | -------------------------------- | +| callback | AsyncCallback<boolean> | 是 | 回调函数返回是否支持广色域模式。 | -**示例:** +**示例:** ```js windowClass.isSupportWideGamut((err, data) => { @@ -1530,17 +1526,17 @@ isSupportWideGamut(callback: AsyncCallback<boolean>): void isSupportWideGamut(): Promise<boolean> -判断当前窗口是否支持广色域模式,使用Promise方式作为异步方法。 +判断当前窗口是否支持广色域模式,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**返回值:** +**返回值:** - | 类型 | 说明 | - | ---------------------- | ------------------------------------------------------------ | - | Promise<boolean> | 以Promise形式返回结果,返回当前窗口是否支持广色域模式的结果。 | +| 类型 | 说明 | +| ---------------------- | ------------------------------------------------------------ | +| Promise<boolean> | 以Promise形式返回结果,返回当前窗口是否支持广色域模式的结果。 | -**示例:** +**示例:** ```js let promise = windowClass.isSupportWideGamut(); @@ -1555,18 +1551,18 @@ isSupportWideGamut(): Promise<boolean> setColorSpace(colorSpace:ColorSpace, callback: AsyncCallback<void>): void -设置当前窗口为广色域模式或默认色域模式,使用callback方式作为异步方法。 +设置当前窗口为广色域模式或默认色域模式,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ---------- | ------------------------- | ---- | ------------ | - | colorSpace | [ColorSpace](#colorspace) | 是 | 设置色域模式 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------------------------- | ---- | ------------ | +| colorSpace | [ColorSpace](#colorspace) | 是 | 设置色域模式 | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js windowClass.setColorSpace(window.ColorSpace.WIDE_GAMUT, (err, data) => { @@ -1582,23 +1578,23 @@ setColorSpace(colorSpace:ColorSpace, callback: AsyncCallback<void>): void setColorSpace(colorSpace:ColorSpace): Promise<void> -设置当前窗口为广色域模式或默认色域模式,使用Promise方式作为异步方法。 +设置当前窗口为广色域模式或默认色域模式,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ---------- | ------------------------- | ---- | ------------ | - | colorSpace | [ColorSpace](#colorspace) | 是 | 设置色域模式 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------------------------- | ---- | ------------ | +| colorSpace | [ColorSpace](#colorspace) | 是 | 设置色域模式 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js let promise = windowClass.isSupportWideGamut(window.ColorSpace.WIDE_GAMUT); @@ -1613,17 +1609,17 @@ setColorSpace(colorSpace:ColorSpace): Promise<void> getColorSpace(callback: AsyncCallback<ColorSpace>): void -获取当前窗口色域模式,使用callback方式作为异步方法。 +获取当前窗口色域模式,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ---------------------------------------------- | ---- | -------------------------- | - | callback | AsyncCallback<[ColorSpace](#colorspace)> | 是 | 回调函数返回当前色域模式。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------------- | ---- | -------------------------- | +| callback | AsyncCallback<[ColorSpace](#colorspace)> | 是 | 回调函数返回当前色域模式。 | -**示例:** +**示例:** ```js windowClass.getColorSpace((err, data) => { @@ -1639,17 +1635,17 @@ getColorSpace(callback: AsyncCallback<ColorSpace>): void getColorSpace(): Promise<ColorSpace> -获取当前窗口色域模式,使用Promise方式作为异步方法。 +获取当前窗口色域模式,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**返回值:** +**返回值:** - | 类型 | 说明 | - | ---------------------------------------- | ----------------------------------------- | - | Promise<[ColorSpace](#colorspace)> | 以Promise形式返回结果,返回当前色域模式。 | +| 类型 | 说明 | +| ---------------------------------------- | ----------------------------------------- | +| Promise<[ColorSpace](#colorspace)> | 以Promise形式返回结果,返回当前色域模式。 | -**示例:** +**示例:** ```js let promise = windowClass.getColorSpace(); @@ -1664,20 +1660,18 @@ getColorSpace(): Promise<ColorSpace> setBackgroundColor(color: string, callback: AsyncCallback<void>): void -设置窗口的背景色,使用callback方式作为异步方法。 - -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 +设置窗口的背景色,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ------------------------- | ---- | ------------------------------------------------------------ | - | color | string | 是 | 需要设置的背景色,为16进制颜色,例如"#00FF00"或"#FF00FF00"。 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ------------------------------------------------------------ | +| color | string | 是 | 需要设置的背景色,为16进制颜色,例如"#00FF00"或"#FF00FF00"。 | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js var color = '#00ff33'; @@ -1694,25 +1688,23 @@ setBackgroundColor(color: string, callback: AsyncCallback<void>): void setBackgroundColor(color: string): Promise<void> -设置窗口的背景色,使用Promise方式作为异步方法。 - -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 +设置窗口的背景色,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------ | ------ | ---- | ------------------------------------------------------------ | - | color | string | 是 | 需要设置的背景色,为16进制颜色,例如"#00FF00"或"#FF00FF00"。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ------------------------------------------------------------ | +| color | string | 是 | 需要设置的背景色,为16进制颜色,例如"#00FF00"或"#FF00FF00"。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js var color = '#00ff33'; @@ -1728,20 +1720,18 @@ setBackgroundColor(color: string): Promise<void> setBrightness(brightness: number, callback: AsyncCallback<void>): void -设置屏幕亮度值,使用callback方式作为异步方法。 - -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 +设置屏幕亮度值,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ---------- | ------------------------- | ---- | ------------------------------------ | - | brightness | number | 是 | 屏幕亮度值,值为0-1之间。1表示最亮。 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------------------------- | ---- | ------------------------------------ | +| brightness | number | 是 | 屏幕亮度值,值为0-1之间。1表示最亮。 | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js var brightness = 1; @@ -1758,25 +1748,23 @@ setBrightness(brightness: number, callback: AsyncCallback<void>): void setBrightness(brightness: number): Promise<void> -设置屏幕亮度值,使用Promise方式作为异步方法。 - -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 +设置屏幕亮度值,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ---------- | ------ | ---- | ------------------------------------ | - | brightness | number | 是 | 屏幕亮度值,值为0-1之间。1表示最亮。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------ | ---- | ------------------------------------ | +| brightness | number | 是 | 屏幕亮度值,值为0-1之间。1表示最亮。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js var brightness = 1; @@ -1788,86 +1776,22 @@ setBrightness(brightness: number): Promise<void> }); ``` -### setDimBehind7+ - -setDimBehind(dimBehindValue: number, callback: AsyncCallback<void>): void - -窗口叠加时,设备有子窗口的情况下设置靠后的窗口的暗度值,使用callback方式作为异步方法。 - -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 - -**系统能力:** SystemCapability.WindowManager.WindowManager.Core - -**参数:** - - | 参数名 | 类型 | 必填 | 说明 | - | -------------- | ------------------------- | ---- | -------------------------------------------------- | - | dimBehindValue | number | 是 | 表示靠后的窗口的暗度值,取值范围为0-1,1表示最暗。 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | - -**示例:** - - ```js - windowClass.setDimBehind(0.5, (err, data) => { - if (err.code) { - console.error('Failed to set the dimness. Cause: ' + JSON.stringify(err)); - return; - } - console.info('Succeeded in setting the dimness. Data:' + JSON.stringify(data)); - }); - ``` - -### setDimBehind7+ - -setDimBehind(dimBehindValue: number): Promise<void> - -窗口叠加时,设备有子窗口的情况下设置靠后的窗口的暗度值,使用Promise方式作为异步方法。 - -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 - -**系统能力:** SystemCapability.WindowManager.WindowManager.Core - -**参数:** - - | 参数名 | 类型 | 必填 | 说明 | - | -------------- | ------ | ---- | -------------------------------------------------- | - | dimBehindValue | number | 是 | 表示靠后的窗口的暗度值,取值范围为0-1,1表示最暗。 | - -**返回值:** - - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | - -**示例:** - - ```js - let promise = windowClass.setDimBehind(0.5); - promise.then((data)=> { - console.info('Succeeded in setting the dimness. Data: ' + JSON.stringify(data)) - }).catch((err)=>{ - console.error('Failed to set the dimness. Cause: ' + JSON.stringify(err)); - }); - ``` - ### setFocusable7+ setFocusable(isFocusable: boolean, callback: AsyncCallback<void>): void -设置点击时是否支持切换焦点窗口,使用callback方式作为异步方法。 - -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 +设置点击时是否支持切换焦点窗口,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ----------- | ------------------------- | ---- | ---------------------------- | - | isFocusable | boolean | 是 | 点击时是否支持切换焦点窗口。 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----------- | ------------------------- | ---- | ---------------------------- | +| isFocusable | boolean | 是 | 点击时是否支持切换焦点窗口。 | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js var isFocusable= true; @@ -1884,25 +1808,23 @@ setFocusable(isFocusable: boolean, callback: AsyncCallback<void>): void setFocusable(isFocusable: boolean): Promise<void> -设置点击时是否支持切换焦点窗口,使用Promise方式作为异步方法。 - -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 +设置点击时是否支持切换焦点窗口,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ----------- | ------- | ---- | ---------------------------- | - | isFocusable | boolean | 是 | 点击时是否支持切换焦点窗口。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----------- | ------- | ---- | ---------------------------- | +| isFocusable | boolean | 是 | 点击时是否支持切换焦点窗口。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js var isFocusable= true; @@ -1918,20 +1840,18 @@ setFocusable(isFocusable: boolean): Promise<void> setKeepScreenOn(isKeepScreenOn: boolean, callback: AsyncCallback<void>): void -设置屏幕是否为常亮状态,使用callback方式作为异步方法。 - -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 +设置屏幕是否为常亮状态,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------------- | ------------------------- | ---- | ------------------------ | - | isKeepScreenOn | boolean | 是 | 是否设置为屏幕常亮状态。 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------- | ------------------------- | ---- | ------------------------ | +| isKeepScreenOn | boolean | 是 | 是否设置为屏幕常亮状态。 | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js var isKeepScreenOn = true; @@ -1948,25 +1868,23 @@ setKeepScreenOn(isKeepScreenOn: boolean, callback: AsyncCallback<void>): v setKeepScreenOn(isKeepScreenOn: boolean): Promise<void> -设置屏幕是否为常亮状态,使用Promise方式作为异步方法。 - -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 +设置屏幕是否为常亮状态,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------------- | ------- | ---- | ------------------------ | - | isKeepScreenOn | boolean | 是 | 是否设置为屏幕常亮状态。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------- | ------- | ---- | ------------------------ | +| isKeepScreenOn | boolean | 是 | 是否设置为屏幕常亮状态。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js var isKeepScreenOn= true; @@ -1978,86 +1896,22 @@ setKeepScreenOn(isKeepScreenOn: boolean): Promise<void> }); ``` -### setOutsideTouchable7+ - -setOutsideTouchable(touchable: boolean, callback: AsyncCallback<void>): void - -设置是否允许可点击子窗口以外的区域,使用callback方式作为异步方法。 - -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 - -**系统能力:** SystemCapability.WindowManager.WindowManager.Core - -**参数:** - - | 参数名 | 类型 | 必填 | 说明 | - | --------- | ------------------------- | ---- | ---------------- | - | touchable | boolean | 是 | 设置是否可点击。 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | - -**示例:** - - ```js - windowClass.setOutsideTouchable(true, (err, data) => { - if (err.code) { - console.error('Failed to set the area to be touchable. Cause: ' + JSON.stringify(err)); - return; - } - console.info('Succeeded in setting the area to be touchable. Data: ' + JSON.stringify(data)) - }) - ``` - -### setOutsideTouchable7+ - -setOutsideTouchable(touchable: boolean): Promise<void> - -设置是否允许可点击子窗口以外的区域,使用Promise方式作为异步方法。 - -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 - -**系统能力:** SystemCapability.WindowManager.WindowManager.Core - -**参数:** - - | 参数名 | 类型 | 必填 | 说明 | - | --------- | ------- | ---- | ---------------- | - | touchable | boolean | 是 | 设置是否可点击。 | - -**返回值:** - - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | - -**示例:** - - ```js - let promise = windowClass.setOutsideTouchable(true); - promise.then((data)=> { - console.info('Succeeded in setting the area to be touchable. Data: ' + JSON.stringify(data)) - }).catch((err)=>{ - console.error('Failed to set the area to be touchable. Cause: ' + JSON.stringify(err)); - }); - ``` - ### setPrivacyMode7+ setPrivacyMode(isPrivacyMode: boolean, callback: AsyncCallback<void>): void -设置窗口是否为隐私模式,使用callback方式作为异步方法。 - -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 +设置窗口是否为隐私模式,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------------- | ------------------------- | ---- | -------------------- | - | isPrivacyMode | boolean | 是 | 窗口是否为隐私模式。 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------------- | ------------------------- | ---- | -------------------- | +| isPrivacyMode | boolean | 是 | 窗口是否为隐私模式。 | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js var isPrivacyMode = true; @@ -2075,25 +1929,23 @@ setPrivacyMode(isPrivacyMode: boolean, callback: AsyncCallback<void>): voi setPrivacyMode(isPrivacyMode: boolean): Promise<void> -设置窗口是否为隐私模式,使用Promise方式作为异步方法。 - -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 +设置窗口是否为隐私模式,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------------- | ------- | ---- | -------------------- | - | isPrivacyMode | boolean | 是 | 窗口是否为隐私模式。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------------- | ------- | ---- | -------------------- | +| isPrivacyMode | boolean | 是 | 窗口是否为隐私模式。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js var isPrivacyMode = true; @@ -2109,20 +1961,18 @@ setPrivacyMode(isPrivacyMode: boolean): Promise<void> setTouchable(isTouchable: boolean, callback: AsyncCallback<void>): void -设置窗口是否为可触状态,使用callback方式作为异步方法。 - -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 +设置窗口是否为可触状态,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ----------- | ------------------------- | ---- | -------------------- | - | isTouchable | boolean | 是 | 窗口是否为可触状态。 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----------- | ------------------------- | ---- | -------------------- | +| isTouchable | boolean | 是 | 窗口是否为可触状态。 | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```js var isTouchable = true; @@ -2140,25 +1990,23 @@ setTouchable(isTouchable: boolean, callback: AsyncCallback<void>): void setTouchable(isTouchable: boolean): Promise<void> -设置窗口是否为可触状态,使用Promise方式作为异步方法。 - -本接口在OpenHarmony 3.1 Release版本仅为接口定义,暂不支持使用。接口将在OpenHarmony 3.1 MR版本中提供使用支持。 +设置窗口是否为可触状态,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ----------- | ------- | ---- | -------------------- | - | isTouchable | boolean | 是 | 窗口是否为可触状态。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----------- | ------- | ---- | -------------------- | +| isTouchable | boolean | 是 | 窗口是否为可触状态。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | ------------------- | ----------------------------------------------- | - | Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------------- | +| Promise<void> | 以Promise形式返回结果,返回当前函数执行的结果。 | -**示例:** +**示例:** ```js var isTouchable = true; @@ -2191,17 +2039,17 @@ WindowStage生命周期。 getMainWindow(): Promise<Window> -获取该WindowStage实例下的主窗口,使用Promise方式作为异步方法。 +获取该WindowStage实例下的主窗口,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**返回值:** +**返回值:** - | 类型 | 说明 | - | -------------------------------- | ---------------------------------------------------------- | - | Promise<[Window](#window)> | 以Promise形式返回结果,返回当前WindowStage下的主窗口对象。 | +| 类型 | 说明 | +| -------------------------------- | ---------------------------------------------------------- | +| Promise<[Window](#window)> | 以Promise形式返回结果,返回当前WindowStage下的主窗口对象。 | -**示例:** +**示例:** ```ts class myAbility extends Ability { @@ -2223,17 +2071,17 @@ getMainWindow(): Promise<Window> getMainWindow(callback: AsyncCallback<Window>): void -获取该WindowStage实例下的主窗口,使用callback方式作为异步方法。 +获取该WindowStage实例下的主窗口,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------------------------------------- | ---- | --------------------------------------- | - | callback | AsyncCallback<[Window](#window)> | 是 | 回调返回当前WindowStage下的主窗口对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------------------- | ---- | --------------------------------------- | +| callback | AsyncCallback<[Window](#window)> | 是 | 回调返回当前WindowStage下的主窗口对象。 | -**示例:** +**示例:** ```ts class myAbility extends Ability { @@ -2256,23 +2104,23 @@ getMainWindow(callback: AsyncCallback<Window>): void createSubWindow(name: string): Promise<Window> -创建该WindowStage实例下的子窗口,使用Promise方式作为异步方法。 +创建该WindowStage实例下的子窗口,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------ | ------ | ---- | -------------- | - | name | String | 是 | 子窗口的名字。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | -------------- | +| name | String | 是 | 子窗口的名字。 | -**返回值:** +**返回值:** - | 类型 | 说明 | - | -------------------------------- | ------------------------------------------------- | - | Promise<[Window](#window)> | 以Promise形式返回结果,返回当前创建的子窗口对象。 | +| 类型 | 说明 | +| -------------------------------- | ------------------------------------------------- | +| Promise<[Window](#window)> | 以Promise形式返回结果,返回当前创建的子窗口对象。 | -**示例:** +**示例:** ```ts class myAbility extends Ability { @@ -2294,18 +2142,18 @@ createSubWindow(name: string): Promise<Window> createSubWindow(name: string, callback: AsyncCallback<Window>): void -创建该WindowStage实例下的子窗口,使用callback方式作为异步方法。 +创建该WindowStage实例下的子窗口,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------------------------------------- | ---- | ------------------------------ | - | name | String | 是 | 子窗口的名字。 | - | callback | AsyncCallback<[Window](#window)> | 是 | 回调返回当前创建的子窗口对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------------------- | ---- | ------------------------------ | +| name | String | 是 | 子窗口的名字。 | +| callback | AsyncCallback<[Window](#window)> | 是 | 回调返回当前创建的子窗口对象。 | -**示例:** +**示例:** ```ts class myAbility extends Ability { @@ -2329,17 +2177,17 @@ createSubWindow(name: string, callback: AsyncCallback<Window>): void getSubWindow(): Promise<Array<Window>> -获取该WindowStage实例下的所有子窗口,使用Promise方式作为异步方法。 +获取该WindowStage实例下的所有子窗口,使用Promise异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**返回值:** +**返回值:** - | 类型 | 说明 | - | --------------------------------------------- | ------------------------------------------------------------ | - | Promise<Array<[Window](#window)>> | 以Promise形式返回结果,返回当前WindowStage下的所有子窗口对象。 | +| 类型 | 说明 | +| --------------------------------------------- | ------------------------------------------------------------ | +| Promise<Array<[Window](#window)>> | 以Promise形式返回结果,返回当前WindowStage下的所有子窗口对象。 | -**示例:** +**示例:** ```ts class myAbility extends Ability { @@ -2361,17 +2209,17 @@ getSubWindow(): Promise<Array<Window>> getSubWindow(callback: AsyncCallback<Array<Window>>): void -获取该WindowStage实例下的所有子窗口,使用callback方式作为异步方法。 +获取该WindowStage实例下的所有子窗口,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | --------------------------------------------------- | ---- | ------------------------------------------- | - | callback | AsyncCallback<Array<[Window](#window)>> | 是 | 回调返回当前WindowStage下的所有子窗口对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------------------------------- | ---- | ------------------------------------------- | +| callback | AsyncCallback<Array<[Window](#window)>> | 是 | 回调返回当前WindowStage下的所有子窗口对象。 | -**示例:** +**示例:** ```ts class myAbility extends Ability { @@ -2394,18 +2242,18 @@ getSubWindow(callback: AsyncCallback<Array<Window>>): void loadContent(path: string, callback: AsyncCallback<void>): void -为当前WindowStage的主窗口加载具体页面内容,使用callback方式作为异步方法。 +为当前WindowStage的主窗口加载具体页面内容,使用callback异步回调。 **系统能力:** SystemCapability.WindowManager.WindowManager.Coretype为'windowSizeChange' -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ------------------------- | ---- | -------------------- | - | path | string | 是 | 设置加载页面的路径。 | - | callback | AsyncCallback<void> | 是 | 回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | -------------------- | +| path | string | 是 | 设置加载页面的路径。 | +| callback | AsyncCallback<void> | 是 | 回调函数。 | -**示例:** +**示例:** ```ts class myAbility extends Ability { @@ -2430,14 +2278,14 @@ on(eventType: 'windowStageEvent', callback: Callback<WindowStageEventType> **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | - | type | string | 是 | 监听事件,固定为'windowStageEvent',即WindowStage生命周期变化事件。 | - | callback | Callback<[WindowStageEventType](#windowstageeventtype9)> | 是 | 回调返回监听到的信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | +| type | string | 是 | 监听事件,固定为'windowStageEvent',即WindowStage生命周期变化事件。 | +| callback | Callback<[WindowStageEventType](#windowstageeventtype9)> | 是 | 回调返回监听到的信息。 | -**示例:** +**示例:** ```ts class myAbility extends Ability { @@ -2459,14 +2307,14 @@ off(eventType: 'windowStageEvent', callback?: Callback<WindowStageEventType&g **系统能力:** SystemCapability.WindowManager.WindowManager.Core -**参数:** +**参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | - | type | string | 是 | 监听事件,固定为'windowStageEvent',即WindowStage生命周期变化事件。 | - | callback | Callback<[WindowStageEventType](#windowstageeventtype9)> | 否 | 回调返回监听到的信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | +| type | string | 是 | 监听事件,固定为'windowStageEvent',即WindowStage生命周期变化事件。 | +| callback | Callback<[WindowStageEventType](#windowstageeventtype9)> | 否 | 回调返回监听到的信息。 | -**示例:** +**示例:** ```ts class myAbility extends Ability { diff --git a/zh-cn/contribute/OpenHarmony-hdf-coding-guide.md b/zh-cn/contribute/OpenHarmony-hdf-coding-guide.md index c21029e4cd794d80c10d2477920eb27a442d8ad0..1e41a3fc45774e9c6ee93d68e1d7706de932561b 100755 --- a/zh-cn/contribute/OpenHarmony-hdf-coding-guide.md +++ b/zh-cn/contribute/OpenHarmony-hdf-coding-guide.md @@ -139,10 +139,10 @@ HDF框架加载驱动所需要的信息来源于HDF框架定义的驱动设备 ```bash $openharmony_src_root/vendor/hisilicon/hispark_taurus/hdf_config # 内核态配置文件目录,无用户态 -$openharmony_src_root/vendor/hisilicon/Hi3516DV300/hdf_config/khdf # 内核态配置文件目录 -$openharmony_src_root/vendor/hisilicon/Hi3516DV300/hdf_config/uhdf # 用户态配置文件目录 -$openharmony_src_root/vendor/hisilicon/Hi3516DV300/hdf_config/khdf/device_info/device_info.hcs # 内核态驱动设备描述配置文件 -$openharmony_src_root/vendor/hisilicon/Hi3516DV300/hdf_config/khdf/lcd/lcd_config.hcs # 内核态驱动私有配置文件 +$openharmony_src_root/vendor/hisilicon/hispark_taurus_standard/hdf_config/khdf # 内核态配置文件目录 +$openharmony_src_root/vendor/hisilicon/hispark_taurus_standard/hdf_config/uhdf # 用户态配置文件目录 +$openharmony_src_root/vendor/hisilicon/hispark_taurus_standard/hdf_config/khdf/device_info/device_info.hcs # 内核态驱动设备描述配置文件 +$openharmony_src_root/vendor/hisilicon/hispark_taurus_standard/hdf_config/khdf/lcd/lcd_config.hcs # 内核态驱动私有配置文件 ``` #### 【规则】驱动设备在配置时,应当充分使用已有的配置信息,继承已有的配置模板 @@ -373,9 +373,9 @@ root { 【样例】 ```bash -$openharmony_src_root/vendor/hisilicon/Hi3516DV300/hdf_config/khdf/sample/sample_config.hcs # 正确,将私有配置文件放置在了sample目录下 +$openharmony_src_root/vendor/hisilicon/hispark_taurus_standard/hdf_config/khdf/sample/sample_config.hcs # 正确,将私有配置文件放置在了sample目录下 -$openharmony_src_root/vendor/hisilicon/Hi3516DV300/hdf_config/khdf/sample_config.hcs # 错误,将私有配置文件放置在了配置根目录下 +$openharmony_src_root/vendor/hisilicon/hispark_taurus_standard/hdf_config/khdf/sample_config.hcs # 错误,将私有配置文件放置在了配置根目录下 ``` #### 【规则】应当将驱动私有配置文件包含到hdf_config配置目录下的hdf.hcs文件中 diff --git a/zh-cn/device-dev/driver/driver-peripherals-audio-des.md b/zh-cn/device-dev/driver/driver-peripherals-audio-des.md index 094404d5afab19413eb36d06bd7fe6853cef4b17..8d2b352893f75acd32776c9457f9f51b205bf5a3 100644 --- a/zh-cn/device-dev/driver/driver-peripherals-audio-des.md +++ b/zh-cn/device-dev/driver/driver-peripherals-audio-des.md @@ -335,7 +335,7 @@ hcs中配置驱动节点、加载顺序、服务名称等。hcs语法可参考HD 标准系统配置文件路径: -vendor/hisilicon/Hi3516DV300/hdf_config/khdf/ +vendor/hisilicon/hispark_taurus_standard/hdf_config/khdf/ 小型系统配置文件路径: @@ -1215,7 +1215,7 @@ hcs文件与目录 ``` 标准系统: -vendor/hisilicon/Hi3516DV300/ +vendor/hisilicon/hispark_taurus_standard/ └── hdf_config └── khdf ├── audio @@ -1365,4 +1365,4 @@ static void *hal_main() ## 总结 -以上就是基于Audio驱动框架进行移植开发过程中,所涉及的所有关键适配点。重点介绍了 Audio驱动适配方法、HDI层接口使用方法。开发者可以根据不同芯片进行适配,方便简单。希望通过本次的文档,您能初步掌握基于HDF框架的Audio驱动开发。 \ No newline at end of file +以上就是基于Audio驱动框架进行移植开发过程中,所涉及的所有关键适配点。重点介绍了 Audio驱动适配方法、HDI层接口使用方法。开发者可以根据不同芯片进行适配,方便简单。希望通过本次的文档,您能初步掌握基于HDF框架的Audio驱动开发。 diff --git a/zh-cn/device-dev/get-code/gettools-acquire.md b/zh-cn/device-dev/get-code/gettools-acquire.md index 3b5c82b55082f62c9b29cc78207c2fbc40326a5a..bd3d14f5a744a751c71a988d3b52f3c4bbc0892e 100644 --- a/zh-cn/device-dev/get-code/gettools-acquire.md +++ b/zh-cn/device-dev/get-code/gettools-acquire.md @@ -110,7 +110,7 @@ hb set ./build.sh --product-name {product_name} --ccache ``` -{product_name}为当前版本支持的平台。比如:Hi3516DV300和rk3568等。 +{product_name}为当前版本支持的平台。比如:hispark_taurus_standard和rk3568等。 编译所生成的文件都归档在out/{device_name}/目录下,结果镜像输出在 out/{device_name}/packages/phone/images/ 目录下。 diff --git a/zh-cn/device-dev/kernel/Readme-CN.md b/zh-cn/device-dev/kernel/Readme-CN.md index 444a65bd4f0fa070d6e3486d9aeacc71d78760e6..caa9de8f41dc531cd9801bfa5da1f0a67bb8a219 100755 --- a/zh-cn/device-dev/kernel/Readme-CN.md +++ b/zh-cn/device-dev/kernel/Readme-CN.md @@ -27,14 +27,14 @@ - 内核调测 - [内存调测](kernel-mini-memory-debug.md) - [内存信息统计](kernel-mini-memory-debug-mes.md) - - [内存泄漏检测](kernel-mini-imemory-debug-det.md) + - [内存泄漏检测](kernel-mini-memory-debug-det.md) - [踩内存检测](kernel-mini-memory-debug-cet.md) - [异常调测](kernel-mini-memory-exception.md) - [Trace调测](kernel-mini-memory-trace.md) - [LMS调测](kernel-mini-memory-lms.md) - 附录 - [内核编码规范](kernel-mini-appx-code.md) - - [基本数据结构](kernel-mini-appx-data-list.md) + - [双向链表](kernel-mini-appx-data-list.md) - 标准库支持 - [CMSIS支持](kernel-mini-appx-lib-cmsis.md) - [POSIX支持](kernel-mini-appx-lib-posix.md) diff --git a/zh-cn/device-dev/kernel/kernel-mini-appx-data-list.md b/zh-cn/device-dev/kernel/kernel-mini-appx-data-list.md index 41afa363c592b3eded5fe30603a16fd860a9cc22..f0c0d1cbea02488cccc34c8959d348ef15ad7ed5 100644 --- a/zh-cn/device-dev/kernel/kernel-mini-appx-data-list.md +++ b/zh-cn/device-dev/kernel/kernel-mini-appx-data-list.md @@ -1,4 +1,4 @@ -# 基本数据结构 +# 双向链表 ## 基本概念 diff --git a/zh-cn/device-dev/kernel/kernel-mini-imemory-debug-det.md b/zh-cn/device-dev/kernel/kernel-mini-memory-debug-det.md similarity index 100% rename from zh-cn/device-dev/kernel/kernel-mini-imemory-debug-det.md rename to zh-cn/device-dev/kernel/kernel-mini-memory-debug-det.md diff --git a/zh-cn/device-dev/kernel/kernel-mini-memory-debug.md b/zh-cn/device-dev/kernel/kernel-mini-memory-debug.md index 5f9fc38eb4110569e4980f49a46b3b0e09c2cd4e..625990100c08618f1beef05b71bf496e67f2d42a 100644 --- a/zh-cn/device-dev/kernel/kernel-mini-memory-debug.md +++ b/zh-cn/device-dev/kernel/kernel-mini-memory-debug.md @@ -6,6 +6,6 @@ - **[内存信息统计](kernel-mini-memory-debug-mes.md)** -- **[内存泄漏检测](kernel-mini-imemory-debug-det.md)** +- **[内存泄漏检测](kernel-mini-memory-debug-det.md)** - **[踩内存检测](kernel-mini-memory-debug-cet.md)** \ No newline at end of file diff --git a/zh-cn/device-dev/porting/porting-linux-kernel.md b/zh-cn/device-dev/porting/porting-linux-kernel.md index 2dee67659185b5cef8ae4b0559c362f4dd21d46a..f6a70a86789003859076cf0bc2c7e89d87244b65 100644 --- a/zh-cn/device-dev/porting/porting-linux-kernel.md +++ b/zh-cn/device-dev/porting/porting-linux-kernel.md @@ -96,7 +96,7 @@ OH内核态层 = OH Linux内核 + OH内核态特性(可选特性或者必选 # 配置编译环境,使用工程项目自带的clang export PATH=$PROJ_ROOT/prebuilts/clang/ohos/linux-x86_64/llvm/bin:$PROJ_ROOT/prebuilts/gcc/linux-x86/arm/gcc-linaro-7.5.0-arm-linux-gnueabi/bin/:$PATH export MAKE_OPTIONS="ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- CC=clang HOSTCC=clang" - export PRODUCT_PATH=vendor/hisilicon/Hi3516DV300 + export PRODUCT_PATH=vendor/hisilicon/hispark_taurus_standard ``` 3. 注释掉clang不识别的flag。 diff --git a/zh-cn/device-dev/quick-start/quickstart-ide-standard-running-hi3516-burning.md b/zh-cn/device-dev/quick-start/quickstart-ide-standard-running-hi3516-burning.md index 17b61de0288457cc4f556cb5b47563b936bdc2f4..1953920dcafed9b8722b59b55c951b0ed57462ca 100644 --- a/zh-cn/device-dev/quick-start/quickstart-ide-standard-running-hi3516-burning.md +++ b/zh-cn/device-dev/quick-start/quickstart-ide-standard-running-hi3516-burning.md @@ -1,5 +1,8 @@ # 烧录 +> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** +> - 如您使用的是master分支2022年5月9日及之后的源码,请使用HiTool工具进行烧录。 +> - 当前版本的DevEco Device Tool暂不支持上述日期后的源码烧录,将在下个版本中适配。 在Windows下采用USB烧录方式进行Hi3516DV300的烧录。 diff --git a/zh-cn/device-dev/quick-start/quickstart-ide-standard-running-rk3568-burning.md b/zh-cn/device-dev/quick-start/quickstart-ide-standard-running-rk3568-burning.md index 83affae376dbd43d4a146ef477046fa5dc1ef741..788cfae169ec0127466410fd744de06cbc459f11 100644 --- a/zh-cn/device-dev/quick-start/quickstart-ide-standard-running-rk3568-burning.md +++ b/zh-cn/device-dev/quick-start/quickstart-ide-standard-running-rk3568-burning.md @@ -1,5 +1,8 @@ # 烧录 +> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** +> - 如您使用的是master分支2022年5月9日及之后的源码,请使用RKDevTool工具进行烧录,请参考《[HiHope-DAYU200烧录指导](https://gitee.com/hihope_iot/docs/tree/master/HiHope_DAYU200/%E7%83%A7%E5%86%99%E5%B7%A5%E5%85%B7%E5%8F%8A%E6%8C%87%E5%8D%97)》进行操作。 +> - 当前版本的DevEco Device Tool暂不支持上述日期后的源码烧录,将在下个版本中适配。 1. [下载](https://gitee.com/hihope_iot/docs/blob/master/HiHope_DAYU200/%E7%83%A7%E5%86%99%E5%B7%A5%E5%85%B7%E5%8F%8A%E6%8C%87%E5%8D%97/windows/DriverAssitant_v5.1.1.zip)并安装驱动DriverInstall.exe,双击DriverInstall.exe打开安装程序,点击“驱动安装”按钮,按提示安装USB驱动。 diff --git a/zh-cn/device-dev/quick-start/quickstart-lite-reference.md b/zh-cn/device-dev/quick-start/quickstart-lite-reference.md index d8a7f6dfaed2d4b7755224d10d1d971740a40d5b..2823f956a30c7c1dfcf3efc4c10395912b0986e4 100644 --- a/zh-cn/device-dev/quick-start/quickstart-lite-reference.md +++ b/zh-cn/device-dev/quick-start/quickstart-lite-reference.md @@ -11,7 +11,7 @@ ``` > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** - > _name_为产品名称,例如Hi3516DV300、rk3568等。 + > _name_为产品名称,例如hispark_taurus_standard、rk3568等。 2. 检查编译结果。编译完成后,log中显示如下: diff --git a/zh-cn/device-dev/quick-start/quickstart-standard-reference.md b/zh-cn/device-dev/quick-start/quickstart-standard-reference.md index d8a7f6dfaed2d4b7755224d10d1d971740a40d5b..2823f956a30c7c1dfcf3efc4c10395912b0986e4 100644 --- a/zh-cn/device-dev/quick-start/quickstart-standard-reference.md +++ b/zh-cn/device-dev/quick-start/quickstart-standard-reference.md @@ -11,7 +11,7 @@ ``` > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** - > _name_为产品名称,例如Hi3516DV300、rk3568等。 + > _name_为产品名称,例如hispark_taurus_standard、rk3568等。 2. 检查编译结果。编译完成后,log中显示如下: diff --git a/zh-cn/device-dev/quick-start/quickstart-standard-running-hi3516-burning.md b/zh-cn/device-dev/quick-start/quickstart-standard-running-hi3516-burning.md index 30d91c07ebc4a6f3a30e44a6ef76d14e6553586d..6a1b883ef818e5f65ca0adf230821d470959c2f3 100644 --- a/zh-cn/device-dev/quick-start/quickstart-standard-running-hi3516-burning.md +++ b/zh-cn/device-dev/quick-start/quickstart-standard-running-hi3516-burning.md @@ -1,5 +1,8 @@ # 烧录 +> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** +> - 如您使用的是master分支2022年5月9日及之后的源码,请使用HiTool工具进行烧录。 +> - 当前版本的DevEco Device Tool暂不支持上述日期后的源码烧录,将在下个版本中适配。 在Windows下采用USB烧录方式进行Hi3516DV300的烧录,具体步骤如下: diff --git a/zh-cn/device-dev/quick-start/quickstart-standard-running-rk3568-burning.md b/zh-cn/device-dev/quick-start/quickstart-standard-running-rk3568-burning.md index 180e0f6125673433f9d85a84aa0fe76ab5788df7..31c1eb24257fe3cf0702ee9c85c919dd8664b850 100644 --- a/zh-cn/device-dev/quick-start/quickstart-standard-running-rk3568-burning.md +++ b/zh-cn/device-dev/quick-start/quickstart-standard-running-rk3568-burning.md @@ -1,5 +1,8 @@ # 烧录 +> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** +> - 如您使用的是master分支2022年5月9日及之后的源码,请使用RKDevTool工具进行烧录,请参考《[HiHope-DAYU200烧录指导](https://gitee.com/hihope_iot/docs/tree/master/HiHope_DAYU200/%E7%83%A7%E5%86%99%E5%B7%A5%E5%85%B7%E5%8F%8A%E6%8C%87%E5%8D%97)》进行操作。 +> - 当前版本的DevEco Device Tool暂不支持上述日期后的源码烧录,将在下个版本中适配。 在Windows环境下通过以下步骤进行RK3568的烧录: diff --git a/zh-cn/device-dev/subsystems/subsys-build-standard-large.md b/zh-cn/device-dev/subsystems/subsys-build-standard-large.md index ed6ba67128b5c128c06ac75f76aa3b68ba05c5e7..b336a0b69d3cc04974b68d173f7d2f5a56847a46 100644 --- a/zh-cn/device-dev/subsystems/subsys-build-standard-large.md +++ b/zh-cn/device-dev/subsystems/subsys-build-standard-large.md @@ -5,7 +5,7 @@ 编译构建子系统提供了一个基于gn和ninja的编译构建框架。主要提供以下功能: -- 构建不同芯片平台的产品。如:Hi3516DV300平台。 +- 构建不同芯片平台的产品。如:hispark_taurus_standard平台。 - 根据产品配置,按照组件组装并打包产品特性的能力。 @@ -89,14 +89,14 @@ OpenHarmony侧的编译构建流程主要包括编译命令行解析,调用gn ./build.sh --product-name {product_name} ``` - {product_name}为当前版本支持的平台。比如:Hi3516DV300等。 + {product_name}为当前版本支持的平台。比如:hispark_taurus_standard等。 编译完成后,结果镜像保存在 out/{device_name}/packages/phone/images/ 目录下。 - 编译命令支持选项: ``` - --product-name # 必须 编译的产品名称,如:Hi3516DV300 + --product-name # 必须 编译的产品名称,如:hispark_taurus_standard --build-target # 可选 指定编译目标,可以指定多个 --gn-args # 可选 gn参数,支持指定多个 --ccache # 可选 编译使用ccache,需要本地安装ccache @@ -400,7 +400,7 @@ ohos_shared_library("module2") { 该文件定义了有哪些子系统以及这些子系统所在文件夹路径,添加子系统时需要说明子系统path与name,分别表示子系统路径和子系统名。 -4. 在//vendor/{product_company}/{product-name}目录下的产品配置如product-name是Hi3516DV300时,在config.json中添加对应的部件,直接添加到原有部件后即可。 +4. 在//vendor/{product_company}/{product-name}目录下的产品配置如product-name是hispark_taurus_standard时,在config.json中添加对应的部件,直接添加到原有部件后即可。 ``` { diff --git "a/zh-cn/readme/\345\233\276\345\275\242\345\255\220\347\263\273\347\273\237.md" "b/zh-cn/readme/\345\233\276\345\275\242\345\255\220\347\263\273\347\273\237.md" index 2249591b094733a00e0c11be529dc07430832e9d..c8faaa306d859bfccf8d9069d1691848c4c6c21d 100644 --- "a/zh-cn/readme/\345\233\276\345\275\242\345\255\220\347\263\273\347\273\237.md" +++ "b/zh-cn/readme/\345\233\276\345\275\242\345\255\220\347\263\273\347\273\237.md" @@ -84,12 +84,12 @@ OpenHarmony 图形栈的分层说明如下: -• 接口层:提供图形的 NDK(native development kit,原生开发包)能力,包括:WebGL、Native Drawing的绘制能力、OpenGL 指令级的绘制能力支撑等。 +• 接口层:提供图形的 Native API能力,包括:WebGL、Native Drawing的绘制能力、OpenGL 指令级的绘制能力支撑等。 • 框架层:分为 Render Service、Drawing、Animation、Effect、显示与内存管理五个模块。 | 模块 | 能力描述 | |------------------------|--------------------------------------------------------------------------------------------| -| Render Servicel (渲染服务) | 提供UI框架的绘制能力,其核心职责是将ArkUI的控件描述转换成绘制树信息,根据对应的渲染策略,进行最佳路径渲染。同时,负责多窗口流畅和空间态下UI共享的核心底层机制。 | +| Render Service (渲染服务) | 提供UI框架的绘制能力,其核心职责是将ArkUI的控件描述转换成绘制树信息,根据对应的渲染策略,进行最佳路径渲染。同时,负责多窗口流畅和空间态下UI共享的核心底层机制。 | | Drawing (绘制) | 提供图形子系统内部的标准化接口,主要完成2D渲染、3D渲染和渲染引擎的管理等基本功能。 | | Animation (动画) | 提供动画引擎的相关能力。 | | Effect (效果) | 主要完成图片效果、渲染特效等效果处理的能力,包括:多效果的串联、并联处理,在布局时加入渲染特效、控件交互特效等相关能力。 |