The Socket Connection module allows an application to transmit data over a Socket connection through the TCP, UDP, or TLS protocol.
The Socket Connection module allows an application to transmit data over a socket connection through the TCP, UDP, or TLS protocol.
## Basic Concepts
...
...
@@ -13,10 +13,11 @@ The Socket Connection module allows an application to transmit data over a Socke
## When to Use
Applications transmit data over TCP, UDP, or TLS Socket connections. The main application scenarios are as follows:
Applications transmit data over TCP, UDP, or TLS socket connections. The main application scenarios are as follows:
- Implementing data transmission over TCP/UDP Socket connections
- Implementing encrypted data transmission over TLS Socket connections
- Implementing data transmission over TCP socket or UDP socket connections
- Implementing data transmission over TCP socket server connections
- Implementing encrypted data transmission over TLS socket connections
## Available APIs
...
...
@@ -28,72 +29,75 @@ Socket connection functions are mainly implemented by the **socket** module. The
| -------- | -------- |
| constructUDPSocketInstance() | Creates a **UDPSocket** object.|
| constructTCPSocketInstance() | Creates a **TCPSocket** object.|
| constructTCPSocketServerInstance() | Creates a **TCPSocketServer** object.|
| listen() | Listens for and accepts TCP socket connections established over the socket. (This API is applicable only to TCP.)|
| bind() | Binds the IP address and port number.|
| send() | Sends data.|
| close() | Closes a Socket connection.|
| getState() | Obtains the Socket connection status.|
| close() | Closes a socket connection.|
| getState() | Obtains the socket connection status.|
| connect() | Connects to the specified IP address and port. This function is supported only for TCP.|
| getRemoteAddress() | Obtains the peer address of the Socket connection. This function is supported only for TCP. The **connect** API must have been called before you use this API.|
| on(type: 'message') | Subscribes to **message** events of the Socket connection.|
| off(type: 'message') | Unsubscribes from **message** events of the Socket connection.|
| on(type: 'close') | Subscribes to **close** events of the Socket connection.|
| off(type: 'close') | Unsubscribes from **close** events of the Socket connection.|
| on(type: 'error') | Subscribes to **error** events of the Socket connection.|
| off(type: 'error') | Unsubscribes from **error** events of the Socket connection.|
| on(type: 'listening') | Subscribes to **listening** events of the UDP Socket connection. |
| off(type: 'listening') | Unsubscribes from **listening** events of the UDP Socket connection. |
| on(type: 'connect') | Subscribes to **connect** events of the TCP Socket connection. |
| off(type: 'connect') | Unsubscribes from **connect** events of the TCP Socket connection.|
TLS Socket connection functions are mainly provided by the **tls_socket** module. The following table describes the related APIs.
| getRemoteAddress() | Obtains the peer address of the socket connection. This function is supported only for TCP. The **connect** API must have been called before you use this API.|
| setExtraOptions() | Sets other properties of the socket connection.|
| on(type: 'message') | Subscribes to **message** events of the socket connection.|
| off(type: 'message') | Unsubscribes from **message** events of the socket connection.|
| on(type: 'close') | Subscribes to **close** events of the socket connection.|
| off(type: 'close') | Unsubscribes from **close** events of the socket connection.|
| on(type: 'error') | Subscribes to **error** events of the socket connection.|
| off(type: 'error') | Unsubscribes from **error** events of the socket connection.|
| on(type: 'listening') | Subscribes to **listening** events of the UDP socket connection. |
| off(type: 'listening') | Unsubscribes from **listening** events of the UDP socket connection. |
| on(type: 'connect') | Subscribes to **connect** events of the TCP socket connection. |
| off(type: 'connect') | Unsubscribes from **connect** events of the TCP socket connection.|
TLS socket connection functions are mainly provided by the **tls_socket** module. The following table describes the related APIs.
| API| Description|
| -------- | -------- |
| constructTLSSocketInstance() | Creates a **TLSSocket** object.|
| bind() | Binds the IP address and port number.|
| close(type: 'error') | Closes a Socket connection.|
| close(type: 'error') | Closes a socket connection.|
| connect() | Sets up a connection to the specified IP address and port number.|
| getCertificate() | Obtains an object representing the local certificate.|
| getCipherSuite() | Obtains a list containing information about the negotiated cipher suite.|
| getProtocol() | Obtains a string containing the SSL/TLS protocol version negotiated for the current connection.|
| getRemoteAddress() | Obtains the peer address of the TLS Socket connection.|
| getRemoteAddress() | Obtains the peer address of the TLS socket connection.|
| getRemoteCertificate() | Obtains an object representing a peer certificate.|
| getSignatureAlgorithms() | Obtains a list containing signature algorithms shared between the server and client, in descending order of priority.|
| getState() | Obtains the TLS Socket connection status.|
| off(type: 'close') | Unsubscribes from **close** events of the TLS Socket connection.|
| off(type: 'error') | Unsubscribes from **error** events of the TLS Socket connection.|
| off(type: 'message') | Unsubscribes from **message** events of the TLS Socket connection.|
| on(type: 'close') | Subscribes to **close** events of the TLS Socket connection.|
| on(type: 'error') | Subscribes to **error** events of the TLS Socket connection.|
| on(type: 'message') | Subscribes to **message** events of the TLS Socket connection.|
| getState() | Obtains the TLS socket connection status.|
| off(type: 'close') | Unsubscribes from **close** events of the TLS socket connection.|
| off(type: 'error') | Unsubscribes from **error** events of the TLS socket connection.|
| off(type: 'message') | Unsubscribes from **message** events of the TLS socket connection.|
| on(type: 'close') | Subscribes to **close** events of the TLS socket connection.|
| on(type: 'error') | Subscribes to **error** events of the TLS socket connection.|
| on(type: 'message') | Subscribes to **message** events of the TLS socket connection.|
| send() | Sends data.|
| setExtraOptions() | Sets other properties of the TLS Socket connection.|
| setExtraOptions() | Sets other properties of the TLS socket connection.|
## Transmitting Data over TCP/UDP Socket Connections
## Transmitting Data over TCP Socket or UDP Socket Connections
The implementation is similar for UDP Socket and TCP Socket connections. The following uses data transmission over a TCP Socket connection as an example.
The implementation is similar for UDP socket and TCP socket connections. The following uses data transmission over a TCP socket connection as an example.
1. Import the required **socket** module.
2. Create a **TCPSocket** object.
2. Create a TCP socket connection. A **TCPSocket** object is returned.
3. (Optional) Subscribe to TCP Socket connection events.
3. (Optional) Subscribe to TCP socket connection events.
4. Bind the IP address and port number. The port number can be specified or randomly allocated by the system.
5. Set up a connection to the specified IP address and port number.
6. Send data.
6. Send data over the connection.
7. Enable the TCP Socket connection to be automatically closed after use.
7. Enable the TCP socket connection to be automatically closed after use.
```js
importsocketfrom'@ohos.net.socket'
// Create a TCPSocket object.
// Create a TCP socket connection. A TCPSocket object is returned.
MindSpore Lite is an AI engine that implements AI model inference for different hardware devices. It has been used in a wide range of fields, such as image classification, target recognition, facial recognition, and character recognition.
The **mindSporeLite** module provides APIs for the MindSpore Lite inference engine to implment model inference.
The **mindSporeLite** module provides APIs for the MindSpore Lite inference engine to implement model inference.
> **NOTE**
>
...
...
@@ -48,7 +48,7 @@ Defines the CPU backend device option.
| threadNum | number | Yes | Yes | Number of runtime threads. The default value is **2**. |
| threadAffinityMode | [ThreadAffinityMode](#threadaffinitymode) | Yes | Yes | Affinity mode for binding runtime threads to CPU cores. The default value is **mindSporeLite.ThreadAffinityMode.NO_AFFINITIES**.|
| threadAffinityCoreList | number[] | Yes | Yes | List of CPU cores bound to runtime threads. Set this parameter only when **threadAffinityMode** is set. If **threadAffinityMode** is set to **mindSporeLite.ThreadAffinityMode.NO_AFFINITIES**, this parameter is empty. The number in the list indicates the SN of the CPU core. The default value is **[]**.|
| precisionMode | string | Yes | Yes | Whether to enable the Float16 inference mode. The value **preferred_fp16** means to enable half-precision inference and the default value **force_fp32** means to disable half-precision inference. Other settings are not supported.|
| precisionMode | string | Yes | Yes | Whether to enable the Float16 inference mode. The value **preferred_fp16** means to enable half-precision inference and the default value **enforce_fp32** means to disable half-precision inference. Other settings are not supported.|
**Float16 inference mode**: a mode that uses half-precision inference. Float16 uses 16 bits to represent a number and therefore it is also called half-precision.
...
...
@@ -125,7 +125,7 @@ Loads the input model from the full path for model inference. This API uses an a
Executes the inference model. This API uses an asynchronous callback to return the result.
Executes the inference model. This API uses an asynchronous callback to return the result. Ensure that the model object is not reclaimed when being invoked.
@@ -69,14 +69,6 @@ Creates a **RunningLock** object.
| type | [RunningLockType](#runninglocktype) | Yes | Type of the **RunningLock** object to be created. |
| callback | AsyncCallback<[RunningLock](#runninglock)> | Yes | Callback used to return the result. If a lock is successfully created, **err** is **undefined** and **data** is the created **RunningLock**. Otherwise, **err** is an error object.|
**Error codes**
For details about the error codes, see [RunningLock Error Codes](../errorcodes/errorcode-runninglock.md).
| ID | Error Message |
|---------|----------|
| 4900101 | If connecting to the service failed. |
**Example**
```js
...
...
@@ -106,20 +98,12 @@ Creates a **RunningLock** object.
| name | string | Yes | Name of the **RunningLock** object. |
| type | [RunningLockType](#runninglocktype) | Yes | Type of the **RunningLock** object to be created.|
> **NOTE**<br>This API is deprecated since API version 9. You are advised to use [runningLock.isSupported](#runninglockissupported9).
Checks whether the specified type of **RunningLock** is supported. This API uses an asynchronous callback to return the result. This API uses an asynchronous callback to return the result.
Checks whether the specified type of **RunningLock** is supported. This API uses an asynchronous callback to return the result.
> **NOTE**<br>This API is deprecated since API version 9. You are advised to use [runningLock.isSupported](#runninglockissupported9).
Checks whether the specified type of **RunningLock** is supported. This API uses an asynchronous callback to return the result. This API uses a promise to return the result.
Checks whether the specified type of **RunningLock** is supported. This API uses a promise to return the result.
| boolean | The value **true** indicates that the **Runninglock** object is held; and the value **false** indicates that the **Runninglock** object is released.|
...
...
@@ -478,5 +462,5 @@ Enumerates the types of **RunningLock** objects.
| BACKGROUND<sup>(deprecated)</sup> | 1 | A lock that prevents the system from hibernating when the screen is off.<br>**NOTE**<br>This parameter is supported since API version 7 and deprecated since API version 10.|
| BACKGROUND<sup>(deprecated)</sup> | 1 | A lock that prevents the system from hibernating when the screen is off.<br>**NOTE**<br/>This parameter is supported since API version 7 and deprecated since API version 10.|
| PROXIMITY_SCREEN_CONTROL | 2 | A lock that determines whether to turn on or off the screen based on the distance away from the screen. |
The AI subsystem is the part of OpenHarmony that provides native distributed AI capabilities. At the heart of the subsystem is a unified AI engine framework, which implements quick integration of AI algorithm plug-ins.
The framework consists of the plug-in management, module management, and communication management modules, fulfilling lifecycle management and on-demand deployment of AI algorithms. Specifically, plug-in management implements lifecycle management, on-demand deployment, and quick integration of AI algorithm plug-ins; module management implements task scheduling and client instance management; communication management manages inter-process communication (IPC) between the client and server and data transmission between the AI engine and plug-ins.
Under this framework, AI algorithm APIs will be standardized to facilitate distributed calling of AI capabilities. In addition, unified inference APIs will be provided to adapt to different inference framework hierarchies.
The AI subsystem is the part of OpenHarmony that provides native distributed AI capabilities. At the heart of the subsystem is a unified AI engine framework, which implements quick integration of AI algorithm plug-ins.
The framework consists of the plug-in management, module management, and communication management modules, fulfilling lifecycle management and on-demand deployment of AI algorithms. Specifically, plug-in management implements lifecycle management, on-demand deployment, and quick integration of AI algorithm plug-ins; module management implements task scheduling and client instance management; communication management manages inter-process communication (IPC) between the client and server and data transmission between the AI engine and plug-ins. Under this framework, AI algorithm APIs will be standardized to facilitate distributed calling of AI capabilities. In addition, unified inference APIs will be provided to adapt to different inference framework hierarchies.
The following figure shows the AI engine framework.
@@ -22,11 +19,11 @@ The following figure shows the AI engine framework.
2.[Download the source code.](../get-code/sourcecode-acquire.md)
## Technical specifications
## Technical Specifications
### Code Management
The AI engine framework consists of three modules: **client**, **server**, and **common**. The client module provides the server connection management function. The SDK needs to encapsulate and call the public APIs provided by the client in the algorithm's external APIs. The server module provides functions such as plug-in loading and task management. Plug-ins are integrated using the plug-in APIs provided by the server. The common module provides platform-related operation methods, engine protocols, and tool classes for other modules.
The AI engine framework consists of three modules: **client**, **server**, and **common**. The client module provides the server connection management function. An OpenHarmony SDK needs to encapsulate and call the public APIs provided by the client in the algorithm's external APIs. The server module provides functions such as plug-in loading and task management. Plug-ins are integrated using the plug-in APIs provided by the server. The common module provides platform-related operation methods, engine protocols, and tool classes for other modules.
The following figure shows the code dependency between modules of the AI engine framework.
...
...
@@ -34,12 +31,12 @@ The following figure shows the code dependency between modules of the AI engine
#### Recommendation: Develop plug-ins and SDKs in the directories specified by the AI engine.
#### Recommendation: Develop plug-ins and OpenHarmony SDKs in the directories specified by the AI engine.
In the overall planning of the AI engine framework, SDKs are a part of the client, and plug-ins are called by the server and are considered a part of the server. Therefore, the following directories have been planned for plug-in and SDK development in the AI engine framework:
In the overall planning of the AI engine framework, OpenHarmony SDKs are a part of the client, and plug-ins are called by the server and are considered a part of the server. Therefore, the following directories have been planned for plug-in and OpenHarmony SDK development in the AI engine framework:
@@ -56,7 +53,7 @@ In the overall planning of the AI engine framework, SDKs are a part of the clien
#### Rule: Store all external APIs provided by plug-ins in the **interfaces/kits** directory of the AI subsystem.
The AI subsystem exposes its capabilities through external APIs of SDKs. According to API management requirements of OpenHarmony, store all external APIs of SDKs in the **interfaces/kits** directory of the subsystem. Currently, the external APIs of plug-ins of the AI subsystem are stored in the **//foundation/ai/engine/interfaces/kits** directory. You can add a sub-directory for each newly added plug-in in this directory. For example, if you add a CV plug-in, then store its external APIs in the **//foundation/ai/engine/interfaces/kits/cv** directory.
The AI subsystem exposes its capabilities through external APIs of OpenHarmony SDKs. According to API management requirements of OpenHarmony, store all external APIs of the SDK in the **interfaces/kits** directory of the subsystem. Currently, the external APIs of plug-ins of the AI subsystem are stored in the **//foundation/ai/engine/interfaces/kits** directory. You can add a sub-directory for each newly added plug-in in this directory. For example, if you add a CV plug-in, then store its external APIs in the **//foundation/ai/engine/interfaces/kits/cv** directory.
#### Rule: Make sure that plug-in build results are stored in the **/usr/lib** directory.
...
...
@@ -65,14 +62,14 @@ Plug-in loading on the server uses the dlopen mode and can only be performed in
### Naming rule
#### Rule: Name an SDK in the format of **domain\_keyword<*other information 1*\_*other information 2*\_…>\_sdk.so**.
#### Rule: Name an SDK in the format of **domain_keyword<_other information 1_other information 2_...>_sdk.so**.
You are advised to use the commonly known abbreviations for domains. For example, use **cv** for image and video, **asr** for voice recognition, and **translation** for text translation. Add one if there is no available abbreviation for a domain. Use keywords that accurately describe the algorithm capability of the plug-in. For example, use **keyword\_spotting** for wakeup keyword spotting (KWS). Add other information, such as the supported chip type and applicable region, between **keyword** and **sdk**, with each of them separated by an underscore (\_). Note that the name of a SDK must end with **\_sdk**.
You are advised to use the commonly known abbreviations for domains. For example, use **cv** for image and video, **asr** for voice recognition, and **translation** for text translation. Add one if there is no available abbreviation for a domain. Use keywords that accurately describe the algorithm capability of the plug-in. For example, use **keyword\_spotting** for wakeup keyword spotting (KWS). Add other information, such as the supported chip type and applicable region, between **keyword** and **sdk**, with each of them separated by an underscore (\_). Note that the name of an SDK must end with **\_sdk**.
For example, if the SDK for the KWS plug-in supports only the Kirin 9000 chipset and is applicable only in China, then name the SDK as follows: **asr\_keyword\_spotting\_kirin9000\_china\_sdk.so**.
#### Rule: Name a plug-in in the format of **domain\_keyword<*other information 1*\_*other information 2*\_…>.so**.
#### Rule: Name a plug-in in the format of **domain_keyword<_other information 1_other information 2_...>.so**.
There is a one-to-one mapping between plug-ins and SDKs. Therefore, the definitions and requirements of terms such as the domain, keyword, and other information in plug-in names are the same as those in SDK names. The only difference is that the name of the SDK ends with **\_sdk** additionally. For example, if the plug-in is named **asr\_keyword\_spotting.so**, the corresponding SDK is named **asr\_keyword\_spotting\_sdk.so**.
...
...
@@ -151,14 +148,19 @@ retCode = ProcessEncode(dataInfo, arg1, arg2, arg3) // The number of parameters
retCode = ProcessDecode(dataInfo, arg1, arg2, arg3) // The number of parameters can be flexible.
```
> **NOTE**
>
> - The sequence of parameters must be the same during encoding and decoding.
> - After encoding, the memory used by **dataInfo** needs to be manually released by the caller.
> - The memory is managed and released separately on the server and the client.
> - If a pointer contains the shared memory, no extra processing is required.
> - If other types of pointers are used, you need to dereference them before using **ProcessEncode** or **ProcessDecode**.
> - The codec module has not been adapted to the **class** data type and therefore it is not recommended.
Note:
- The sequence of parameters must be the same during encoding and decoding.
- After encoding, the memory used by **dataInfo** needs to be manually released by the caller.
- The memory is managed and released separately on the server and the client.
- If a pointer contains the shared memory, no extra processing is required.
- If other types of pointers are used, you need to dereference them before using **ProcessEncode** or **ProcessDecode**.
- The codec module has not been adapted to the **class** data type and therefore it is not recommended.
#### Rule: Release the memory used by the encoded or decoded parameters in the SDK. Otherwise, a memory leakage occurs.
...
...
@@ -249,7 +251,7 @@ The following table describes the data structure of **ConfigInfo**, **ClientInfo
| ConfigInfo | Algorithm configuration item information| **const char \*description**: body of configuration item information. |
| ClientInfo | Client information.| **long long clientVersion**: client version number. This parameter is not used currently.<br>**int clientId**: client ID.<br>**int sessionId**: session ID.<br>**uid\_t serverUid**: server UID.<br>**uid\_t clientUid**: client UID.<br>**int extendLen**: length of the extended information (**extendMsg**).<br>**unsigned char \*extendMsg**: body of the extended information. |
| AlgorithmInfo | Algorithm information| **long long clientVersion**: client version number. This parameter is not used currently.<br>**bool isAsync**: whether asynchronous execution is used.<br>**int algorithmType**: algorithm type ID allocated by the AI engine framework based on the plug-in loading sequence.<br>**long long algorithmVersion**: algorithm version number.<br>**bool isCloud**: whether to migrate data to the cloud. This parameter is not used currently.<br>**int operateId**: execution ID. This parameter is not used currently.<br>**int requestId**: request ID, which identifies each request and corresponds to the execution result.<br>**int extendLen**: length of the extended information (**extendMsg**).<br>**unsigned char \*extendMsg**: body of the extended information. |
| DataInfo | Algorithm input parameter configuration information (**inputInfo**)and output parameter configuration information (**outputInfo**)| **unsigned char \*data**: data subject.<br>**int length**: data length. |
| DataInfo | Algorithm input parameter configuration information (**inputInfo**)<br>and output parameter configuration information (**outputInfo**)| **unsigned char \*data**: data subject.<br>**int length**: data length. |
For details about the development process, see the development example of the [KWS SDK](#kws-sdk).
...
...
@@ -313,7 +315,7 @@ The following table describes the attributes of the **Response** class.
@@ -454,10 +456,11 @@ The preceding code implements the **IPlugin** APIs provided by the server. The f
| AieClientGetOption | GetOption | Obtains algorithm-related configuration items. For KWS, this API can obtain the input and output scale of the KWS model. The input scale is the MFCC feature (fixed value: **4000**) required by the KWS model, and the output scale is the confidence (fixed value: **2**) of the result.|
| AieClientRelease | Release | Releases the algorithm model. For KWS, this API releases the specified algorithm model and clears the dynamic memory in the feature processor.|
> **NOTE**
>
> - The **AieClientInit** and **AieClientDestroy** APIs are used to connect to and disconnect from the server, respectively. They are not called in the plug-in algorithm and therefore do not need to be defined in the plug-in.
> - The KWS plug-in needs to use the **PLUGIN\_INTERFACE\_IMPL** statement to expose the function pointer. Otherwise, the plug-in cannot be properly loaded.
Note:
1. The **AieClientInit** and **AieClientDestroy** APIs are used to connect to and disconnect from the server, respectively. They are not called in the plug-in algorithm and therefore do not need to be defined in the plug-in.
2. The KWS plug-in needs to use the **PLUGIN\_INTERFACE\_IMPL** statement to expose the function pointer. Otherwise, the plug-in cannot be properly loaded.
@@ -88,7 +88,7 @@ The following uses [DAYU200](https://gitee.com/openharmony/vendor_hihope/tree/ma
"subsystem": "product_hihope"
}
```
In the preceding code, `//vendor/hihope/rk3568/thermal/` is the folder path, `profile` is the folder name, and `thermal_hdf_config` is the build target.
In the preceding code, `//vendor/hihope/rk3568/thermal/` is the folder path, `profile` is the folder name, and `thermal_service_config` is the build target.
6. Build the customized version by referring to [Quick Start](../quick-start/quickstart-overview.md).
@@ -106,7 +106,7 @@ The following uses [DAYU200](https://gitee.com/openharmony/vendor_hihope/tree/ma
"subsystem": "product_hihope"
}
```
In the preceding code, `//vendor/hihope/rk3568/thermal/` is the folder path, `profile` is the folder name, and `thermal_hdf_config` is the build target.
In the preceding code, `//vendor/hihope/rk3568/thermal/` is the folder path, `profile` is the folder name, and `thermal_service_config` is the build target.
6. Build the customized version by referring to [Quick Start](../quick-start/quickstart-overview.md).
...
...
@@ -150,7 +150,6 @@ The following uses [DAYU200](https://gitee.com/openharmony/vendor_hihope/tree/ma
```
## Reference
During development, you can refer to the [default thermal control configuration](https://gitee.com/openharmony/powermgr_thermal_manager/blob/master/services/native/profile/thermal_service_config.xml).
@@ -144,6 +144,6 @@ The following uses [DAYU200](https://gitee.com/openharmony/vendor_hihope/tree/ma
```
## Reference
During development, you can refer to the [default thermal detection configuration](https://gitee.com/openharmony/drivers_peripheral/blob/master/thermal/interfaces/hdi_service/profile/thermal_hdi_config.xml).
During development, you can refer to the [default thermal detection configuration](https://gitee.com/openharmony/drivers_peripheral/tree/master/thermal/interfaces/hdi_service/profile/thermal_hdf_config.xml).
@@ -111,7 +111,7 @@ The following uses [DAYU200](https://gitee.com/openharmony/vendor_hihope/tree/ma
"subsystem": "product_hihope"
}
```
In the preceding code, `//vendor/hihope/rk3568/thermal/` is the folder path, `profile` is the folder name, and `thermal_hdf_config` is the build target.
In the preceding code, `//vendor/hihope/rk3568/thermal/` is the folder path, `profile` is the folder name, and `thermal_service_config` is the build target.
6. Build the customized version by referring to [Quick Start](../quick-start/quickstart-overview.md).
@@ -26,7 +26,7 @@ For details about the requirements on the Linux environment, see [Quick Start](.
The following uses [DAYU200](https://gitee.com/openharmony/vendor_hihope/tree/master/rk3568) as an example to illustrate thermal log customization.
1. Create the thermal folder in the product directory [/vendor/hihope/rk3568](https://gitee.com/openharmony/vendor_hihope/tree/master/rk3568).
1. Create the `thermal` folder in the product directory [/vendor/hihope/rk3568](https://gitee.com/openharmony/vendor_hihope/tree/master/rk3568).
2. Create a target folder by referring to the [default thermal log configuration folder](https://gitee.com/openharmony/drivers_peripheral/tree/master/thermal/interfaces/hdi_service/profile), and install it in `//vendor/hihope/rk3568/thermal`. The content is as follows:
...
...
@@ -50,6 +50,8 @@ The following uses [DAYU200](https://gitee.com/openharmony/vendor_hihope/tree/ma
| Configuration Item| Description| Data Type| Value Range|
| -------- | -------- | -------- | -------- |
| interval | Interval for recording temperature tracing logs, in ms.| int | >0 |
| width | Width of the temperature tracing log, in characters.| int | >0 |
| outpath | Path for storing temperature tracing logs.| string | N/A|
**Table 2** Description of the node configuration
...
...
@@ -61,7 +63,7 @@ The following uses [DAYU200](https://gitee.com/openharmony/vendor_hihope/tree/ma
| value | path | Path for obtaining the thermal zone temperature.|
6. Write the `BUILD.gn` file by referring to the [BUILD.gn](https://gitee.com/openharmony/drivers_peripheral/blob/master/thermal/interfaces/hdi_service/profile/BUILD.gn) file in the default thermal log configuration folder to pack the thermal_hdi_config.xml file to the `//vendor/etc/thermal_config/hdf` directory. The configuration is as follows:
6. Write the `BUILD.gn` file by referring to the [BUILD.gn](https://gitee.com/openharmony/drivers_peripheral/blob/master/thermal/interfaces/hdi_service/profile/BUILD.gn) file in the default thermal log configuration folder to pack the `thermal_hdi_config.xml` file to the `//vendor/etc/thermal_config/hdf` directory. The configuration is as follows:
```shell
import("//build/ohos.gni")
...
...
@@ -95,7 +97,7 @@ The following uses [DAYU200](https://gitee.com/openharmony/vendor_hihope/tree/ma
ohos_prebuilt_etc("thermal_hdf_config") {
source = "thermal_hdi_config.xml"
relative_install_dir = "thermal_config/hdf"
install_images = [ chipset_base_dir ] # Required configuration for installing the thermal_service_config.xml file in the vendor directory.
install_images = [ chipset_base_dir ] # Required configuration for installing the thermal_hdi_config.xml file in the vendor directory.
part_name = "product_rk3568" # Set part_name to product_rk3568 for subsequent build. You can change it as required.
}
```
...
...
@@ -149,7 +151,7 @@ The following uses [DAYU200](https://gitee.com/openharmony/vendor_hihope/tree/ma
"subsystem": "product_hihope"
}
```
In the preceding code, //vendor/hihope/rk3568/thermal/ is the folder path, profile and etc are folder names, and thermal_hdf_config and param_files are the build targets.
In the preceding code, `//vendor/hihope/rk3568/thermal/` is the folder path, `profile` and `etc` are folder names, and `thermal_hdf_config` and `param_files` are the build targets.
9. Build the customized version by referring to [Quick Start](../quick-start/quickstart-overview.md).
@@ -150,7 +150,7 @@ The following uses [DAYU200](https://gitee.com/openharmony/vendor_hihope/tree/ma
"subsystem": "product_hihope"
}
```
In the preceding code, `//vendor/hihope/rk3568/thermal/` is the folder path, `profile` is the folder name, and `thermal_hdf_config` is the build target.
In the preceding code, `//vendor/hihope/rk3568/thermal/` is the folder path, `profile` is the folder name, and `thermal_service_config` is the build target.
6. Build the customized version by referring to [Quick Start](../quick-start/quickstart-overview.md).
@@ -86,7 +86,7 @@ The following uses [DAYU200](https://gitee.com/openharmony/vendor_hihope/tree/ma
"subsystem": "product_hihope"
}
```
In the preceding code, `//vendor/hihope/rk3568/thermal/` is the folder path, `profile` is the folder name, and `thermal_hdf_config` is the build target.
In the preceding code, `//vendor/hihope/rk3568/thermal/` is the folder path, `profile` is the folder name, and `thermal_service_config` is the build target.
6. Build the customized version by referring to [Quick Start](../quick-start/quickstart-overview.md).