Audio and video- One voice input
- One mono (AC_L) output, connected to a 3 W power amplifier (LM4871)
- Micro-HDMI (one HDMI 1.4)
+- Ethernet port
- Audio and video
- One voice input
- One mono output (AC_L), connected to a 3 W power amplifier (LM4871)
- Micro-HDMI (one HDMI 1.4)
- Cameras
- Sensor IMX335
- M12 lens with a focal length of 4 mm and an aperture of 1.8
- Display
- 2.35-inch LCD connector
- 5.5-inch LCD connector
- External components and interfaces
- microSD card interface
- JTAG/I2S interface
- ADC interface
- Steer gear interface
- Grove connector
- USB 2.0 (Type C)
- Three function keys: two custom keys and one update key
- LED indicator (including green and red)
diff --git a/en/device-dev/quick-start/quickstart-standard-package-environment.md b/en/device-dev/quick-start/quickstart-standard-package-environment.md
index fcfe369fefdcae2c148e879ff5a8fa5628a3c662..8e0b4e69770cd43df8eb390cb138eb98b618410b 100644
--- a/en/device-dev/quick-start/quickstart-standard-package-environment.md
+++ b/en/device-dev/quick-start/quickstart-standard-package-environment.md
@@ -1,4 +1,4 @@
-# Setting Up Ubuntu Development Environment with Installation Package
+# Setting Up a Ubuntu Development Environment Using the Installation Package
- [Installing Dependent Tools](#section18431165519244)
- [Obtaining Standard-System Source Code](#section113751052102517)
@@ -25,7 +25,7 @@ sudo apt-get update && sudo apt-get install binutils git git-lfs gnupg flex biso
1. Register your account with Gitee.
2. Register an SSH public key for access to Gitee.
-3. Install the [git client](http://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading), and configure basic user information.
+3. Install the [git client](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading), and configure basic user information.
```
git config --global user.name "yourname"
@@ -44,6 +44,8 @@ sudo apt-get update && sudo apt-get install binutils git git-lfs gnupg flex biso
### Procedure
+Two methods are provided for you to obtain the OpenHarmony master code. You are advised to create a new folder and run the related commands in this folder to download the source code. This folder will then be the root directory of the source code.
+
Method 1 \(recommended\): Use the **repo** tool to download the source code over SSH. \(You must have registered an SSH public key for access to Gitee.\)
```
diff --git a/en/device-dev/quick-start/quickstart-standard-running.md b/en/device-dev/quick-start/quickstart-standard-running.md
index 5ee6df5ffaa8846b0f3ae4670d8ef8c590fe8f72..8375204a05f4c8b0cf46030ccb89996ba3a8f3bd 100644
--- a/en/device-dev/quick-start/quickstart-standard-running.md
+++ b/en/device-dev/quick-start/quickstart-standard-running.md
@@ -1,6 +1,9 @@
# Running an Image
-## Running an Image
+- [Running an Image](#section153991115191314)
+- [Next](#section5600113114323)
+
+## Running an Image
After the image burning is complete, perform the following steps to run the system:
@@ -9,23 +12,23 @@ After the image burning is complete, perform the following steps to run the syst
1. In DevEco Device Tool, click **Monitor** to open the serial port tool.
- 
+ 
2. Restart the development board. Before the autoboot countdown ends, press any key to enter the system.
- 
+ 
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 androidboot.selinux=permissive skip_initramfs rootdelay=5 init=/init root=/dev/mmcblk0p5 rootfstype=ext4 rw blkdevparts=mmcblk0:1M(boot),15M(kernel),20M(updater),1M(misc),3307M(system),256M(vendor),-(userdata)'
+ 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 0x80000000 0x800 0x4800; bootm 0x80000000";
+ setenv bootcmd 'mmc read 0x0 0x82000000 0x800 0x4800; bootm 0x82000000'
```
- 
+ 
4. Save the parameter settings.
@@ -33,7 +36,7 @@ After the image burning is complete, perform the following steps to run the syst
save
```
- 
+ 
5. Restart the development board to start the system.
@@ -41,8 +44,10 @@ After the image burning is complete, perform the following steps to run the syst
reset
```
- 
+ 
+
+
+## Next
-## Next
+Congratulations! You have completed the quick start for the standard system. Get yourself familiar with OpenHarmony by a [Development Example for Clock App](../guide/device-clock-guide.md).
-Congratulations! You have completed the quick start for the standard system. Get yourself familiar with OpenHarmony by a [Development Example for Clock App](../guide/device-clock-guide.md).
diff --git a/en/device-dev/quick-start/quickstart-standard-windows-environment.md b/en/device-dev/quick-start/quickstart-standard-windows-environment.md
index 2367d7b0784499dfea575b3a83be13cf270c262a..2a91d675138760f1ee33ff0f34374a384144a061 100644
--- a/en/device-dev/quick-start/quickstart-standard-windows-environment.md
+++ b/en/device-dev/quick-start/quickstart-standard-windows-environment.md
@@ -1,190 +1,65 @@
-# Setting Up Windows Development Environment
+# Setting Up a Windows Development Environment
-- [Obtaining the Software](#en-us_topic_0000001058091994_section1483143015558)
-- [Installing Visual Studio Code](#en-us_topic_0000001058091994_section71401018163318)
-- [Installing Python](#en-us_topic_0000001058091994_section16266553175320)
-- [Installing Node.js](#en-us_topic_0000001058091994_section5353233124511)
-- [Installing HPM](#en-us_topic_0000001058091994_section173054793610)
-- [Installing the DevEco Device Tool Plug-in](#en-us_topic_0000001058091994_section4336315185716)
+- [Installing DevEco Device Tool](#en-us_topic_0000001058091994_section10761564496)
System requirements:
- OS: 64-bit Windows 10
- User name: cannot contain Chinese characters
-DevEco Device Tool is a plug-in for Visual Studio Code. The installation procedure includes five parts:
-
-1. Installing Visual Studio Code
-2. Installing Python
-3. Installing Node.js
-4. Installing HPM
-5. Installing the DevEco Device Tool Plug-in
-
-## Obtaining the Software
-
-
-
-
-## Installing Visual Studio Code
+## Installing DevEco Device Tool
-> **NOTE:**
->If you have installed Visual Studio Code, open the CLT and run **code --version** to check whether the version is 1.53 or later. If the version number is returned, it indicates that the environment variables are set correctly.
-
-1. Double-click the Visual Studio Code package to install it. During the installation, select **Add to PATH \(requires shell restart\)**.
-
- 
-
-2. After the installation is complete, open the CLT and run **code --version**. If the version number can be displayed, it indicates that the installation is successful.
-
-## Installing Python
-
-1. Double-click the Python software package, select **Add Python 3.8 to PATH**, and click **Install Now**.
-
- 
-
-2. After the installation is complete, click **Close**.
+DevEco Device Tool is installed in Visual Studio Code as a plug-in and depends on Python, Node.js, and HPM for running.
- 
-
-3. Open the CLT, and run **python --version** to check the installation result.
-
- 
-
-4. In the CLT, run the following commands to set the pip source for downloading the dependencies required for later installation:
-
- ```
- pip config set global.trusted-host repo.huaweicloud.com
- pip config set global.index-url https://repo.huaweicloud.com/repository/pypi/simple
- pip config set global.timeout 120
- ```
-
-
-## Installing Node.js
+DevEco Device Tool supports integrated installation. The DevEco Device Tool setup wizard checks whether the adaptation versions of Visual Studio Code, Python, Node.js and HPM tools have been installed. If any of the tools is not installed, you'll be prompted to select the tool to be automatically installed.
> **NOTE:**
->If you have installed Node.js, open the CLT and run **node -v** to check whether the version is 12.0.0 or later.
-
-1. Run the downloaded software package to install. Use the default settings when following the installation wizard, and click **Next** until **Finish** is displayed. During the installation, Node.js will automatically set the system Path environment variable to the installation directory of **node.exe**.
-2. Open the CLT and run **node -v**. If the version number of Node.js is displayed, it indicates that Node.js has been successfully installed.
+>Before installing DevEco Device Tool, make sure the user name of the host does not contain Chinese characters. Otherwise, the **DevEco Home** page will be stuck loading and the DevEco Device Tool cannot work.
-## Installing HPM
+1. Log in to the [HarmonyOS Device website](https://device.harmonyos.com/cn/ide#download_beta) with your HUAWEI ID and download DevEco Device Tool V3.0 Beta1 or a later version. If you do not have a HUAWEI ID, [register](https://developer.huawei.com/consumer/en/doc/start/registration-and-verification-0000001053628148) one first.
+2. Decompress the DevEco Device Tool package, double-click the installer, and then click **Next**.
+3. Set the installation path of DevEco Device Tool and click **Next**.
+4. When prompted, select the tools to be automatically installed and click **Next**.
-Before installing HPM, ensure that Node.js has been installed
+ 
-and that your network can access the Internet. If your network requires a proxy to access the Internet, [set up the npm proxy](https://device.harmonyos.com/en/docs/ide/user-guides/npm_proxy-0000001054491032) first.
-
-> **NOTE:**
->If HPM has been installed, run **npm update -g @ohos/hpm-cli** to update it to the latest version.
-
-1. You are advised to set the npm source to an image in China, for example, a HUAWEI CLOUD image source.
-
- ```
- npm config set registry https://repo.huaweicloud.com/repository/npm/
- ```
-
-2. Open the CLT and run the following command to install the latest version of HPM:
-
- ```
- npm install -g @ohos/hpm-cli
- ```
-
- 
-
-3. After the installation is complete, run the following command to obtain the installation result:
+ > **NOTE:**
+ >When the setup wizard detects that a compatible Python version has been installed, it prompts you to select the installed Python version or download the recommended Python version.
- ```
- hpm -V
- ```
+5. In the dialog box shown below, click **Next** to download and install the tools.
+ 
-## Installing the DevEco Device Tool Plug-in
+6. In the displayed Python setup wizard, select **Add Python 3.8 to PATH** and click **Install Now**. After the installation is complete, click **Close**.
-Before installing DevEco Device Tool, make sure the user name of the host does not contain Chinese characters. Otherwise, the **DevEco Home** page will be stuck loading and the DevEco Device Tool cannot work.
+ > **NOTE:**
+ >If you have selected the compatible Python version installed on your device, the Python setup wizard will not be displayed. In this case, you skip this step.
+ >If DevEco Device Tool 2.1 Release is installed, the Python version must be 3.8.x. If DevEco Device Tool V3.0 Beta1 or a later version is installed, the Python version must be 3.8.x or 3.9.x.
-DevEco Device Tool will automatically download and install the C/C++ and CodeLLDB plug-ins from the Visual Studio Code Marketplace during the installation process. Therefore, make sure Visual Studio Code can access the Internet. If your network requires a proxy to access the Internet, [set up the Visual Studio Code proxy](https://device.harmonyos.com/en/docs/ide/user-guides/vscode_proxy-0000001074231144) first.
+ 
-> **NOTE:**
->Before installing DevEco Device Tool, ensure that Visual Studio Code is closed.
-
-1. Decompress the DevEco Device Tool plug-in package and double-click the installer to install.
-2. DevEco Device Tool checks whether the toolkit on which the installation depends meets the requirements. If the requirements are not met, follow the preceding installation instructions in this section.
+7. In the Visual Studio Code setup wizard, install Visual Studio Code as prompted. During the installation, select **Add to PATH \(requires shell restart\)**.
> **NOTE:**
- >If Visual Studio Code has been installed but fails to be detected, restart your computer.
+ >If you are using the correct version of Visual Studio Code, the Visual Studio Code setup wizard will not be displayed. In this case, you skip this step.
- 
+ 
-3. Click **Install**.
+8. In the Node.js setup wizard, retain the default settings and click **Next** until **Finish** is displayed. During the installation, Node.js will automatically set the system Path environment variable to the installation directory of **node.exe**.
- 
+ > **NOTE:**
+ >If you are using the correct version of Node.js, the Node.js setup wizard will not be displayed. In this case, you skip this step.
-4. After the installation is complete, click **Close**.
+9. Wait for the DevEco Device Tool setup wizard to automatically install the HPM and DevEco Device Tool. After the installation is complete, click **Finish** to close the setup wizard.
- 
+ > **NOTE:**
+ >If you are using the correct version of HPM, the setup wizard does not download or install HPM.
-5. Start Visual Studio Code. The C/C++ and CodeLLDB plug-ins on which DevEco Device Tool depends will be automatically installed. After the installation is complete, click on the left of Visual Studio Code to check whether C/C++, CodeLLDB, and DevEco Device Tool are included in the INSTALLED list.
+10. Start Visual Studio Code. The C/C++ and CodeLLDB plug-ins on which DevEco Device Tool depends will be automatically installed. After the installation is complete, click  on the left of Visual Studio Code to check whether C/C++, CodeLLDB, and DevEco Device Tool are included in the **INSTALLED** list.
> **NOTE:**
>If the C/C++ and CodeLLDB plug-ins fail to be installed, DevEco Device Tool cannot run properly. To solve the issue, see [Installing the C/C++ and CodeLLDB Plug-ins Offline](https://device.harmonyos.com/en/docs/ide/user-guides/offline_plugin_install-0000001074376846).
- 
+ 
diff --git a/en/device-dev/quick-start/quickstart-standard.md b/en/device-dev/quick-start/quickstart-standard.md
index a464c3dc670ed78a5631b62380839dbee0873e7a..e939227a4b3f8d152ec892f06ee37bc1b816e45b 100644
--- a/en/device-dev/quick-start/quickstart-standard.md
+++ b/en/device-dev/quick-start/quickstart-standard.md
@@ -2,11 +2,11 @@
- **[Introduction](quickstart-standard-overview.md)**
-- **[Setting Up Windows Development Environment](quickstart-standard-windows-environment.md)**
+- **[Setting Up a Windows Development Environment](quickstart-standard-windows-environment.md)**
-- **[Setting Up Ubuntu Development Environment in Docker Mode](quickstart-standard-docker-environment.md)**
+- **[Setting Up a Ubuntu Development Environment in Docker Mode](quickstart-standard-docker-environment.md)**
-- **[Setting Up Ubuntu Development Environment with Installation Package](quickstart-standard-package-environment.md)**
+- **[Setting Up a Ubuntu Development Environment Using the Installation Package](quickstart-standard-package-environment.md)**
- **[Burning Images](quickstart-standard-burn.md)**
diff --git a/en/device-dev/subsystems/Readme-EN.md b/en/device-dev/subsystems/Readme-EN.md
index 443fc64a65979c301836ab0cca38856d7cf3aa59..90d19a51f44f7845c2ae865d43a43f23fedcc8ed 100644
--- a/en/device-dev/subsystems/Readme-EN.md
+++ b/en/device-dev/subsystems/Readme-EN.md
@@ -49,6 +49,9 @@
- [Development Guidelines](subsys-application-framework-guide.md)
- [Development Example](subsys-application-framework-demo.md)
- [OTA Upgrade](subsys-ota-guide.md)
+- [Telephony Service ](subsys-tel.md)
+ - [Telephony Service](telephony-service.md)
+ - [Development Guidelines](development-guidelines.md)
- [Security](subsys-security.md)
- [Overview](subsys-security-overview.md)
- [Development Guidelines on Application Signature Verification](subsys-security-sigverify.md)
diff --git a/en/device-dev/subsystems/development-guidelines.md b/en/device-dev/subsystems/development-guidelines.md
new file mode 100644
index 0000000000000000000000000000000000000000..1f930477fe690212dfe6107d353628da2ff5931e
--- /dev/null
+++ b/en/device-dev/subsystems/development-guidelines.md
@@ -0,0 +1,616 @@
+# Development Guidelines
+
+- [Initializing a Modem Vendor Library](#section211mcpsimp)
+ - [When to Use](#section213mcpsimp)
+ - [Available APIs](#section811343241215)
+ - [How to Develop](#section51031144122)
+ - [Debugging and Verification](#section5351151517132)
+
+- [Responding to Modem Service Requests](#section295mcpsimp)
+ - [When to Use](#section297mcpsimp)
+ - [Available APIs](#section9503155219134)
+ - [How to Develop](#section17190412101414)
+ - [Debugging and Verification](#section10207938171413)
+
+- [Reporting Modem Events](#section390mcpsimp)
+ - [When to Use](#section401mcpsimp)
+ - [Available APIs](#section191193791518)
+ - [How to Develop](#section16394112401512)
+ - [Debugging and Verification](#section16999174401516)
+ - [Development Examples](#section33444350167)
+
+- [Integrating Modem Vendor Libraries](#section590mcpsimp)
+ - [Configuring Compilation Information](#section592mcpsimp)
+ - [Debugging and Verification](#section620mcpsimp)
+
+
+## Initializing a Modem Vendor Library
+
+### When to Use
+
+Initializing a modem vendor library means to implement **const HRilOps \*RilInitOps\(const struct HRilReport \*reportOps\)** function in the vendor library. This function is mainly used to:
+
+- Receive function pointers to event callbacks of RIL Adapter. When a service event needs to be reported, the target pointer will be called to report the event to RIL Adapter.
+- Create a thread for reading modem nodes. In this thread, the data reported by the modem is read cyclically and parsed as a specific service event for reporting.
+- Return the function pointer of the service request API to RIL Adapter.
+
+### Available APIs
+
+The following table describes the API for initializing a modem vendor library.
+
+**Table 1** API for initializing a modem vendor library
+
+
+API
+ |
+Description
+ |
+
+
+const HRilOps *RilInitOps(const struct HRilReport * reportOps)
+ |
+Function: Provides an entry for running a modem vendor library.
+Input parameter:
+reportOps: Specifies the pointer to the event callback function, which is passed by RIL Adapter.
+Return result: function pointer of the service request API.
+ |
+
+
+
+
+### How to Develop
+
+1. Set the event callback function pointers passed by RIL Adapter through **RilInitOps**.
+
+ ```
+ // Define the callback function pointers of the modem vendor library.
+ static struct HRilReport g_reportOps = {
+ OnCallReport, // Callback function for call services
+ OnDataReport, // Callback function for cellular data services
+ OnModemReport, // Callback function for modem services
+ OnNetworkReport, // Callback function for network search services
+ OnSimReport, // Callback function for SIM card services
+ OnSmsReport // Callback function for SMS services
+ };
+ ```
+
+
+1. Create the **g\_reader** main thread to enable message looping.
+
+ ```
+ pthread_attr_t t;
+ pthread_attr_init(&t);
+ pthread_attr_setdetachstate(&t, PTHREAD_CREATE_DETACHED);
+ ret = pthread_create(&g_reader, &t, ReaderLoop, &t); // Create the g_reader thread.
+ ```
+
+
+1. In the **g\_eventListeners** thread, use **open\(\)** to open a modem node and then create the **g\_reader** thread to read and process messages reported by the modem.
+
+ ```
+ g_fd = open(g_devicePath, O_RDWR); // Open the device node specified by g_devicePath.
+ pthread_attr_init(&attr);
+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+ ret = pthread_create(&g_eventListeners, &attr, EventListeners, NULL);
+ ```
+
+
+1. Return the function pointer of the service request API.
+
+ ```
+ // Structure for the service request API of the call module
+ typedef struct {
+ // Obtain the call list.
+ void (*GetCallList)(ReqDataInfo *requestInfo, const void *data, size_t dataLen);
+ // Make a call.
+ void (*Dial)(ReqDataInfo *requestInfo, const void *data, size_t dataLen);
+ // Disconnect a call.
+ void (*Hangup)(ReqDataInfo *requestInfo, const void *data, size_t dataLen);
+ // Reject a call.
+ void (*Reject)(ReqDataInfo *requestInfo, const void *data, size_t dataLen);
+ // Answer a call.
+ void (*Answer)(ReqDataInfo *requestInfo, const void *data, size_t dataLen);
+ } HRilCallReq;
+
+ // Callback function pointers of the call module
+ static const HRilCallReq g_callReqOps = {
+ .GetCallList = ReqGetCallList, // Obtain the call list.
+ .Dial = ReqDial, // Make a call.
+ .Hangup = ReqHangup, // Disconnect a call.
+ .Reject = ReqReject, // Reject a call.
+ .Answer = ReqAnswer, // Answer a call.
+ };
+
+ // Service request structure
+ typedef struct {
+ const HRilCallReq *callOps; // Pointer to the structure of call service requests
+ const HRilSimReq *simOps; // Pointer to the structure of SIM card service requests
+ const HRilSmsReq *smsOps; // Pointer to the structure of SMS and MMS service requests
+ const HRilDataReq *dataOps; // Pointer to the structure of cellular data service requests
+ const HRilNetworkReq *networkOps; // Pointer to the structure of network search service requests
+ const HRilModemReq *modemOps; // Pointer to the structure of modem service requests
+ } HRilOps;
+
+ // Service request APIs
+ HRilOps g_hrilOps = {
+ .callOps = &g_callReqOps, // API for call service requests
+ .simOps = &g_simReqOps, // API for SIM card service requests
+ .smsOps = &g_smsReqOps, // API for SMS and MMS service requests
+ .networkOps = &g_networkReqOps, // API for cellular data service requests
+ .dataOps = &g_dataReqOps, // API for network search service requests
+ .modemOps = &g_modemReqOps, // API for modem service requests
+ };
+ ```
+
+
+### Debugging and Verification
+
+1. Use the [hdc\_std](en-us_topic_0000001080478129.md#section05992022154916) tool to connect to a debugging device. Then, run the following command to send the generated **libril\_vendor.z.so** library file to the **/system/lib/** directory of the device. For details about how to integrate a library file, see [Integrating Modem Vendor Libraries](#section590mcpsimp).
+
+ ```
+ hdc_std file send libril_vendor.z.so /system/lib/
+ ```
+
+2. Reboot the debugging device.
+
+ ```
+ hdc_std shell sync
+ hdc_std shell reboot
+ ```
+
+3. Run the **hdc\_std shell hilog** command to view the debug log, and check whether the **RilInitOps\(\)** function is successfully executed. The following debug log is for reference:
+
+ ```
+ 01-01 05:13:23.071 136 2319 D 00000/RilAdapterInit: [RilAdapterDispatch-(hril_hdf.c:55)] sbuf IPC obtain test success!
+ 01-01 05:13:23.071 136 2319 D 00000/RilAdapterInit: [LoadVendor-(hril_hdf.c:33)] RilInit rilInit start
+ 01-01 05:13:23.071 136 2319 D 00000/RilAdapterInit: [LoadVendor -(hril_hdf.c:45)] RilInit rilInit completed
+ ```
+
+
+## Responding to Modem Service Requests
+
+### When to Use
+
+After receiving a specific telephony service request, RIL Adapter calls the target function pointer obtained in modem vendor library initialization to send a specific service request to the vendor library. Then, the vendor library processes the request based on the request ID.
+
+### Available APIs
+
+The following table describes the APIs for responding to modem service requests, with the dial module as an example.
+
+**Table 2** APIs for responding to modem service requests
+
+
+API
+ |
+Description
+ |
+
+
+void ReqDial(ReqDataInfo *requestInfo, const void *data, size_t dataLen);
+ |
+Function: Processes number dial requests.
+Input parameters:
+- requestInfo: request type
+
+
+Return value: none
+ |
+
+void (*OnCallReport)(struct ReportInfo reportInfo, const void *data, size_t dataLen);
+ |
+Function: Reports the execution result of a service request to RIL Adapter.
+Input parameters:
+
+
+
+Return value: none
+ |
+
+
+
+
+### How to Develop
+
+1. Implement processing of dial requests in the **ReqDial\(\)** API.
+
+ ```
+ // Implement the API for processing dial requests.
+ void ReqDial(ReqDataInfo *requestInfo, const void *data, size_t dataLen)
+ {
+ HRilDial *pDial = NULL;
+ char cmd[MAX_BUFF_SIZE] = {0};
+ const char *clir = NULL;
+ int ret;
+ int err = HRIL_ERR_SUCCESS;
+ struct ReportInfo reportInfo = {};
+ ResponseInfo *pResponse = NULL;
+ if (data == NULL) {
+ TELEPHONY_LOGE("data is null!!!");
+ err = HRIL_ERR_INVALID_PARAMETER;
+ reportInfo = CreateReportInfo(requestInfo, err, HRIL_RESPONSE, 0);
+ OnCallReport(reportInfo, NULL, 0);
+ return;
+ }
+ pDial = (HRilDial *)data;
+ switch (pDial->clir) {
+ case CALL_CLIR_INVOCATION:
+ clir = "I";
+ break; /* invocation */
+ case CALL_CLIR_SUPPRESSION:
+ clir = "i";
+ break; /* suppression */
+ case CALL_CLIR_SUBSCRIPTION_DEFUALT:
+ default:
+ clir = "";
+ break; /* subscription default */
+ }
+ (void)sprintf_s(cmd, MAX_BUFF_SIZE, "ATD%s%s;", pDial->address, clir);
+ ret = SendCommandLock(cmd, NULL, 0, &pResponse); // Send the AT command.
+ ......
+ }
+ ```
+
+2. After the modem executes the dial command, report the execution result to RIL Adapter via **OnCallReport\(\)**.
+
+ ```
+ ret = SendCommandLock(cmd, NULL, 0, &pResponse);
+ if (ret != 0 || (pResponse != NULL && pResponse->success == 0)) {
+ TELEPHONY_LOGE("ATD send failed");
+ err = HRIL_ERR_GENERIC_FAILURE;
+ }
+ reportInfo = CreateReportInfo(requestInfo, err, HRIL_RESPONSE, 0);
+ OnCallReport(reportInfo, NULL, 0); // Invoke the callback function of the call service.
+ ```
+
+
+### Debugging and Verification
+
+1. Use the [hdc\_std](en-us_topic_0000001080478129.md#section05992022154916) tool to connect to a debugging device. Then, run the following command to send the generated **libril\_vendor.z.so** library file to the **/system/lib/** directory of the device.
+
+ ```
+ hdc_std file send libril_vendor.z.so /system/lib/
+ ```
+
+2. Reboot the debugging device.
+
+ ```
+ hdc_std shell sync
+ hdc_std shell reboot
+ ```
+
+3. Run the **hdc\_std shell** command. Then, run the **./system/bin/ril\_adapter\_test** command, type **1**, and enter the phone number as prompted to test the call function.
+
+ ```
+ hdc_std shell
+ # ./system/bin/ril_adapter_test
+ ----> Test Enter --------->Call---------------------
+
+ 1----> RilUnitTest::OnRequestCallDialTest
+ 2----> RilUnitTest:: OnRequestCallHangupTest
+ 3----> RilUnitTest:: OnRequestCallAnswerTest
+ 4----> RilUnitTest::OnRequestCallGetCurrentCallsStatusTest
+ 5----> RilUnitTest::OnRequestRefusedCallTest
+
+ 1
+ ```
+
+4. Open another terminal window, and run the **hdc\_std shell hilog** command. Then, view the log to check whether **ReqDial\(\)** is successfully executed. The following debug log is for reference:
+
+ ```
+ 01-01 05:27:27.419 136 408 D 02b01/Rilvendor: [SendCommandLock-(at_support.c:210)] SendCommandLock enter, cmd: ATD17620373527
+ 01-01 05:27:27.419 136 408 D 02b01/Rilvendor: [SendCommandLock-(at_support.c:231)] SendCommandLock() command ATD17620373527
+ 01-01 05:27:27.419 136 408 D 02b01/Rilvendor: [WriteATCommand-(channel.c:115)] WriteATCommand enter, cmd:ATD17620373527
+ 01-01 05:27:27.421 136 187 D 02b01/Rilvendor: [ReadResponse-(channel.c:94)] g_bufferCur :
+ 01-01 05:27:27.421 136 187 D 02b01/Rilvendor: OK
+ 01-01 05:27:27.422 136 187 D 02b01/Rilvendor: [ProcessResponse-(at_support.c:144)] processLine line = OK
+ 01-01 05:27:27.422 136 187 D 02b01/Rilvendor: [ReadResponse-(channel.c:81)] ReadResponse enter
+ 01-01 05:27:27.422 136 187 D 02b01/Rilvendor: [ProcessLastResponse-(channel.c:37)] last data more than one line , FindEndOfLine g_bufferCur:
+ 01-01 05:27:27.422 136 187 E 02b01/Rilvendor: [ProcessLastResponse-(channel.c:39)] g_bufferCur endLine is null
+ 01-01 05:27:27.422 136 187 E 02b01/Rilvendor:^ORIG:1,0
+ 01-01 05:27:27.422 136 408 E 02b01/Rilvendor: [SendCommandLock-(at_support.c:234)] processLine line = ^ORIG:1,0
+ 01-01 05:27:27.422 136 408 E 02b01/Rilvendor: [SendCommandLock-(vendor_report.c:234)] enter to [^ORIG:1,0]: (null)
+ 01-01 05:27:27.422 136 408 E 02b01/Rilvendor: [SendCommandLock-(at_support.c:264)] err = 0, cmd:ADT17620373527
+ ```
+
+
+## Reporting Modem Events
+
+### When to Use
+
+A modem node thread reads the messages reported by the modem cyclically, parses the messages into specific events, and then reports the events to RIL Adapter.
+
+### Available APIs
+
+The following table describes the API for reporting modem events.
+
+**Table 3** API for reporting modem events
+
+
+API
+ |
+Description
+ |
+
+
+void OnNotifyOps(const char *s, const char *smsPdu)
+ |
+Function: Distributes the events reported by the modem.
+Input parameters:
+
+- smsPdu: PDU of the SMS message
+Return value: none
+ |
+
+
+
+
+### How to Develop
+
+1. Call **OnNotifyOps\(\)** in the g\_reader thread of the modem device node to parse reported modem events. On determining the command type, call **OnXxxReport\(\)** to report the parsed module events to the hril layer.
+
+ ```
+ // Parse the data reported by the modem as events proactively reported by the corresponding module.
+ void OnNotifyOps(const char *s, const char *smsPdu)
+ {
+ int ret = 0;
+ struct ReportInfo reportInfo = {0};
+ reportInfo.error = HRIL_ERR_SUCCESS;
+ reportInfo.type = HRIL_NOTIFICATION;
+ if (GetRadioState() == HRIL_RADIO_POWER_STATE_UNAVAILABLE) {
+ return;
+ }
+ TELEPHONY_LOGD("enter to [%{public}s]:%{public}s", s, smsPdu);
+ // Determine the type of the proactively reported events based on the AT command.
+ if (ReportStrWith(s, "+CRING:") || ReportStrWith(s, "RING") || ReportStrWith(s, "IRING") ||
+ ReportStrWith(s, "NO CARRIER") || ReportStrWith(s, "+CCWA") || ReportStrWith(s, "^CCALLSTATE") ||
+ ReportStrWith(s, "^CEND") || ReportStrWith(s, "^CCWA")) {
+ reportInfo.notifyId = HNOTI_CALL_STATE_UPDATED;
+ OnCallReport(reportInfo, NULL, 0);
+ } else if (ReportStrWith(s, "+CMT:")) {
+ reportInfo.notifyId = HNOTI_SMS_NEW_SMS;
+ OnSmsReport(reportInfo, (void *)smsPdu, strlen(smsPdu));
+ }
+ // Report the events of each module to the hril layer.
+ ...
+ }
+ ```
+
+
+1. Distribute the reported events from the **hril** layer to the Telephony Service layer.
+
+ ```
+ // Report the call status proactively.
+ int32_t HRilCall::CallStateUpdated(
+ int32_t slotId, int32_t notifyType, const HRilErrno e, const void *response, size_t responseLen)
+ {
+ struct HdfSBuf *dataSbuf = HdfSBufTypedObtain(SBUF_IPC);
+ if (serviceCallbackNotify_ == nullptr) {
+ TELEPHONY_LOGE("RilAdapter serviceCallbackNotify_ is null");
+ HdfSBufRecycle(dataSbuf);
+ return HDF_FAILURE;
+ }
+ // Distribute events.
+ int32_t ret = serviceCallbackNotify_->dispatcher->Dispatch(
+ serviceCallbackNotify_, HNOTI_CALL_STATE_UPDATED, dataSbuf, nullptr);
+ if (ret != HDF_SUCCESS) {
+ HdfSBufRecycle(dataSbuf);
+ return HDF_FAILURE;
+ }
+ HdfSBufRecycle(dataSbuf);
+ return HDF_SUCCESS;
+ }
+ ```
+
+
+### Debugging and Verification
+
+1. Use the [hdc\_std](en-us_topic_0000001080478129.md#section05992022154916) tool to connect to a debugging device. Then, run the following command to send the generated **libril\_vendor.z.so** library file to the **/system/lib/** directory of the device.
+
+ ```
+ hdc_std file send libril_vendor.z.so /system/lib/
+ ```
+
+2. Reboot the debugging device.
+
+ ```
+ hdc_std shell sync
+ hdc_std shell reboot
+ ```
+
+3. Run the **hdc\_std shell** command. Then, run the **./system/bin/ril\_adapter\_test** command, type **1**, and enter the phone number as prompted to test the call function.
+
+ ```
+ hdc_std shell
+ # ./system/bin/ril_adapter_test
+ ----> Test Enter --------->Call---------------------
+
+ 1----> RilUnitTest::OnRequestCallDialTest
+ 2----> RilUnitTest:: OnRequestCallHangupTest
+ 3----> RilUnitTest:: OnRequestCallAnswerTest
+ 4----> RilUnitTest::OnRequestCallGetCurrentCallsStatusTest
+ 5----> RilUnitTest::OnRequestRefusedCallTest
+
+ 1
+ ```
+
+4. Open another terminal window, and run the **hdc\_std shell hilog** command. Then, view the log to check whether **OnNotifyOps\(\)** is successfully executed. The following debug log is for reference:
+
+ ```
+ 01-01 00:08:01.334 546 551 D 02b01/TelRilTest: [DialResponse-(tel_ril_call.cpp:280)] DialResponse --> radioResponseInfo->serial:2, radioResponseInfo->error:0
+ 01-01 00:08:01.334 546 557 D 02b01/TelRilTest: [ProcessEvent-(tel_ril_test.cpp:1262)] TelRilTest::DemoHandler::ProcessEvent --> eventId:101
+ 01-01 00:08:01.334 143 512 D 02b01/Rilvendor: [ReadResponse-(channel.c:93)] g_bufferCur :
+ 01-01 00:08:01.334 143 512 D 02b01/Rilvendor: ^ORIG:1,0
+ 01-01 00:08:01.334 143 512 D 02b01/Rilvendor: [ReadResponse-(channel.c:108)] AT< ^ORIG:1,0
+ 01-01 00:08:01.334 143 512 D 02b01/Rilvendor: [ProcessResponse-(at_support.c:137)] processLine line = ^ORIG:1,0
+ 01-01 00:08:01.334 143 512 D 02b01/Rilvendor: [OnNotifyOps-(vendor_report.c:126)] enter to [^ORIG:1,0]:(null)
+ 01-01 00:08:01.335 143 512 W 02b01/Rilvendor: [OnNotifyOps-(vendor_report.c:167)] enter to is unrecognized command: ^ORIG:1,0
+ 01-01 00:08:01.335 143 512 D 02b01/Rilvendor: [ProcessLastResponse-(channel.c:37)] last data more than one line , FindEndOfLine g_bufferCur:
+ 01-01 00:08:01.335 143 512 E 02b01/Rilvendor: [ProcessLastResponse-(channel.c:39)] g_bufferCur endLine is null
+ 01-01 00:08:01.336 143 512 D 02b01/Rilvendor: [ReadResponse-(channel.c:93)] g_bufferCur :
+ 01-01 00:08:01.336 143 512 D 02b01/Rilvendor: ^CCALLSTATE: 1,0,1
+ 01-01 00:08:01.336 143 512 D 02b01/Rilvendor: [ReadResponse-(channel.c:108)] AT< ^CCALLSTATE: 1,0,1
+ 01-01 00:08:01.336 143 512 D 02b01/Rilvendor: [ProcessResponse-(at_support.c:137)] processLine line = ^CCALLSTATE: 1,0,1
+ 01-01 00:08:01.336 143 512 D 02b01/Rilvendor: [OnNotifyOps-(vendor_report.c:126)] enter to [^CCALLSTATE: 1,0,1]:(null)
+ 01-01 00:08:01.336 546 551 D 02b01/CoreService: [OnRemoteRequest-(tel_ril_manager.cpp:80)] RilManager OnRemoteRequest code:1001
+ 01-01 00:08:01.336 546 551 D 02b01/CoreService: [NotifyObserver-(observer_handler.cpp:76)] handler->SendEvent:8
+ ```
+
+
+### Development Examples
+
+- **Outgoing Call**
+
+ The following figure shows the API calling for an outgoing call.
+
+ **Figure 1** Time sequence of API calling for an outgoing call
+
+
+ 
+
+ When an application initiates an outgoing call, RIL Adapter receives a call request, and the **hril** layer invokes the **ReqDial\(\)** function. In **ReqDial\(\)**, the data passed by the Telephony Service is encapsulated as an AT command and sent to the modem. After executing the dial command, the modem reports the execution result to RIL Adapter through **OnCallReport\(\)**.
+
+ ```
+ // Callback function pointer of the call module
+ static const HRilCallReq g_callReqOps = {
+ .GetCallList = ReqGetCallList, // Obtain the call list.
+ .Dial = ReqDial, // Make a call.
+ .Hangup = ReqHangup, // Disconnect a call.
+ .Reject = ReqReject, // Reject a call.
+ .Answer = ReqAnswer, // Answer a call.
+ };
+
+ // Service request APIs
+ HRilOps g_hrilOps = {
+ .callOps = &g_callReqOps, // API for call service requests
+ .simOps = &g_simReqOps, // API for SIM card service requests
+ .smsOps = &g_smsReqOps, // API for SMS and MMS service requests
+ .networkOps = &g_networkReqOps, // API for cellular data service requests
+ .dataOps = &g_dataReqOps, // API for network search service requests
+ .modemOps = &g_modemReqOps, // API for modem service requests
+ };
+
+ // Implement the API for processing dial requests.
+ void ReqDial(ReqDataInfo *requestInfo, const void *data, size_t dataLen)
+ {
+ HRilDial *pDial = NULL;
+ char cmd[MAX_BUFF_SIZE] = {0};
+ const char *clir = NULL;
+ int ret;
+ int err = HRIL_ERR_SUCCESS;
+ struct ReportInfo reportInfo = {};
+ ResponseInfo *pResponse = NULL;
+ if (data == NULL) {
+ TELEPHONY_LOGE("data is null!!!");
+ err = HRIL_ERR_INVALID_PARAMETER;
+ reportInfo = CreateReportInfo(requestInfo, err, HRIL_RESPONSE, 0);
+ OnCallReport(reportInfo, NULL, 0);
+ return;
+ }
+ pDial = (HRilDial *)data;
+ switch (pDial->clir) {
+ case CALL_CLIR_INVOCATION:
+ clir = "I";
+ break; /* invocation */
+ case CALL_CLIR_SUPPRESSION:
+ clir = "i";
+ break; /* suppression */
+ case CALL_CLIR_SUBSCRIPTION_DEFUALT:
+ default:
+ clir = "";
+ break; /* subscription default */
+ }
+ (void)sprintf_s(cmd, MAX_BUFF_SIZE, "ATD%s%s;", pDial->address, clir);
+ ret = SendCommandLock(cmd, NULL, 0, &pResponse); // Send the AT command.
+ if (ret != 0) {
+ err = HRIL_ERR_CMD_SEND_FAILURE;
+ TELEPHONY_LOGE("ATD send failed");
+ } else {
+ if (pResponse != NULL && pResponse->success == 0) {
+ TELEPHONY_LOGE("ReqDial return ERROR");
+ err = HRIL_ERR_CMD_NO_CARRIER;
+ }
+ }
+ reportInfo = CreateReportInfo(requestInfo, err, HRIL_RESPONSE, 0);
+ OnCallReport(reportInfo, NULL, 0); // Invoke the callback function of the call service.
+ FreeResponseInfo(pResponse);
+ }
+ ```
+
+
+- **Incoming Call**
+
+ The following figure shows the API calling of an incoming call.
+
+ **Figure 2** Time sequence of API calling for an incoming call
+
+
+ 
+
+ The **g\_reader** thread cyclically reads the messages reported by the modem. When the modem receives an incoming call event, it actively reports the information about the incoming call.
+
+ The **g\_reader** thread calls **OnNotifyOps\(\)** to parse the reported information. If the parsed data reported by the modem starts with characters such as **+CRING** or **RING**, it indicates that an incoming call event exists. In this case, the event is reported to RIL Adapter through **OnCallReport\(reportInfo, NULL, 0\)**.
+
+ ```
+ // Parse the data reported by the modem as events proactively reported by the corresponding module.
+ void OnNotifyOps(const char *s, const char *smsPdu)
+ {
+ int ret = 0;
+ struct ReportInfo reportInfo = {0};
+ reportInfo.error = HRIL_ERR_SUCCESS;
+ reportInfo.type = HRIL_NOTIFICATION;
+ if (GetRadioState() == HRIL_RADIO_POWER_STATE_UNAVAILABLE) {
+ return;
+ }
+ TELEPHONY_LOGD("enter to [%{public}s]:%{public}s", s, smsPdu);
+ // Determine the type of the proactively reported events based on the AT command.
+ if (ReportStrWith(s, "+CRING:") || ReportStrWith(s, "RING") || ReportStrWith(s, "IRING") ||
+ ReportStrWith(s, "NO CARRIER") || ReportStrWith(s, "+CCWA") || ReportStrWith(s, "^CCALLSTATE") ||
+ ReportStrWith(s, "^CEND") || ReportStrWith(s, "^CCWA")) {
+ reportInfo.notifyId = HNOTI_CALL_STATE_UPDATED;
+ OnCallReport(reportInfo, NULL, 0); // Invoke the callback function of the call service.
+ } else if (ReportStrWith(s, "+CMT:")) {
+ reportInfo.notifyId = HNOTI_SMS_NEW_SMS;
+ OnSmsReport(reportInfo, (void *)smsPdu, strlen(smsPdu));
+ }
+ // add your codes
+ ......
+ }
+ ```
+
+
+## Integrating Modem Vendor Libraries
+
+### Configuring Compilation Information
+
+Compile the modem vendor library into a dynamic library by using **BUILD.gn**. Upon startup, RIL Adapter loads the dynamic library to the system in dlopen mode and then initializes the library. For details about how to implement vendor library initialization, see [Initializing a Modem Vendor Library](#section211mcpsimp). The following is an example of **BUILD.gn**:
+
+```
+import("//build/ohos.gni")
+RIL_ADAPTER = "//base/telephony"
+ohos_shared_library("ril_vendor") { // Modem vendor library
+ sources = [ // Source files to compile
+ "at_call.c",
+ "at_data.c",
+ "xxx.c",
+ ]
+ include_dirs = [ // Header files
+ "$RIL_ADAPTER/ril_adapter/vendor/include",
+ "$RIL_ADAPTER/ril_adapter/interfaces/innerkits",
+ "include",
+ ]
+ deps = [ // Internal dependencies
+ "//drivers/adapter/uhdf2/osal:libhdf_utils",
+ "//base/telephony/core_service/utils:libtelephony_common",
+ ]
+ external_deps = [ "hilog:libhilog" ] // External dependencies
+
+ part_name = "ril_adapter" // Part name
+ subsystem_name = "telephony" // Subsystem name
+}
+```
+
+### Debugging and Verification
+
+1. Compile the code.
+2. Check whether **libril\_vendor.z.so** exists in the **/out/ohos-arm-release/telephony/ril\_adapter** directory. If yes, the integration is successful. Otherwise, correct the error and perform debugging and verification again.
+
diff --git a/en/device-dev/subsystems/figure/The-following-figure-shows-the-context-structure-of-the-Startup-subsystem.png b/en/device-dev/subsystems/figure/The-following-figure-shows-the-context-structure-of-the-Startup-subsystem.png
new file mode 100644
index 0000000000000000000000000000000000000000..10619e78af9ac158497eea260dfdc623788fd810
Binary files /dev/null and b/en/device-dev/subsystems/figure/The-following-figure-shows-the-context-structure-of-the-Startup-subsystem.png differ
diff --git a/en/device-dev/subsystems/figure/en-us_image_0000001171507146.png b/en/device-dev/subsystems/figure/en-us_image_0000001171507146.png
new file mode 100644
index 0000000000000000000000000000000000000000..529f4561b0fa18d68e4463ebc74e6b1911b589c9
Binary files /dev/null and b/en/device-dev/subsystems/figure/en-us_image_0000001171507146.png differ
diff --git a/en/device-dev/subsystems/figure/en-us_image_0000001210683929.png b/en/device-dev/subsystems/figure/en-us_image_0000001210683929.png
new file mode 100644
index 0000000000000000000000000000000000000000..741f53d3654db337ea8bc2bc4ef793e3135c83ee
Binary files /dev/null and b/en/device-dev/subsystems/figure/en-us_image_0000001210683929.png differ
diff --git a/en/device-dev/subsystems/figure/en-us_image_0000001214727595.png b/en/device-dev/subsystems/figure/en-us_image_0000001214727595.png
new file mode 100644
index 0000000000000000000000000000000000000000..5383e32ce2a16c5271debea44f40c6dfb2a79fd1
Binary files /dev/null and b/en/device-dev/subsystems/figure/en-us_image_0000001214727595.png differ
diff --git a/en/device-dev/subsystems/subsys-boot-overview.md b/en/device-dev/subsystems/subsys-boot-overview.md
index 0f33270e686ae27a5218f174960dd9069d35c285..5fe25a4c8d8066041da0b2b5f48590de06bed9df 100644
--- a/en/device-dev/subsystems/subsys-boot-overview.md
+++ b/en/device-dev/subsystems/subsys-boot-overview.md
@@ -7,7 +7,7 @@
The following figure shows the context structure of the Startup subsystem.
-
+
Upon completion of system power-on and kernel loading, system services and applications are started as follows:
@@ -35,7 +35,7 @@ The Startup subsystem consists of the following modules:
- bootstrap module
- This module provides entry identifiers for starting services and features. When samgr is started, the entry function identified by boostrap is called and system services are started.
+ This module provides entry identifiers for starting services and features. When samgr is started, the entry function identified by bootstrap is called and system services are started.
- syspara module
diff --git a/en/device-dev/subsystems/subsys-boot-syspara.md b/en/device-dev/subsystems/subsys-boot-syspara.md
index c0c51a6a8239d9ce6e5ff92c7c5fe42a50ac4e4e..07658bcaa74355d09259c492036aa0ef3f08327f 100644
--- a/en/device-dev/subsystems/subsys-boot-syspara.md
+++ b/en/device-dev/subsystems/subsys-boot-syspara.md
@@ -16,7 +16,7 @@
This module provides an easy-to-use key-value pair access interface for system services to configure service functions based on their own system parameters. The following figure shows the basic primitives used to access and operate system parameters.
**Figure 1** Operation primitives for system parameters
-
+
**Table 1** Description of operation primitives
@@ -207,7 +207,7 @@ As shown above, we can use **parameter directory** to define the same access p
The following figure shows the structure of the UGO rule information.
**Figure 2** Rule information
-
+
### Installation of the System Parameter Definition File
@@ -260,7 +260,7 @@ The following table provides the sequence of loading system parameter value defi
|
/vendor/etc/param/*.para
|
-The definition file containing system parameters in the vendor directory is loaded with the secondary priority. It can overwrite the definition file containing system parrameters in the system directory.
+ | The definition file containing system parameters in the vendor directory is loaded with the secondary priority. It can overwrite the definition file containing system parameters in the system directory.
|