diff --git a/contribute/OpenHarmony-cpp-coding-style-guide.md b/contribute/OpenHarmony-cpp-coding-style-guide.md index 9eaeb589e8aaa5b757d3672757685777ead3226b..5094d63aba99cdbc80386337d1bf41a22206bcd3 100755 --- a/contribute/OpenHarmony-cpp-coding-style-guide.md +++ b/contribute/OpenHarmony-cpp-coding-style-guide.md @@ -143,7 +143,7 @@ std::string path; // Good: 只有一个单词时,小驼峰为全小写 ``` ### 规则2.5.1 全局变量应增加 'g_' 前缀,静态变量命名不需要加特殊前缀 -全局变量是应当尽量少使用的,使用时应特别注意,所以加上前缀用于视觉上的突出,促使开发人员对这些变量的使用更加小心。 +全局变量应当尽量少使用,使用时应特别注意,所以加上前缀用于视觉上的突出,促使开发人员对这些变量的使用更加小心。 - 全局静态变量命名与全局变量相同。 - 函数内的静态变量命名与普通局部变量相同。 - 类的静态成员变量和普通成员变量相同。 @@ -261,7 +261,7 @@ private: ## 函数声明和定义 -### 规则3.4.1 函数声明和定义的返回类型和函数名在同一行;函数参数列表超出行宽时要换行并合理对齐 +### 规则3.4.1 函数声明、定义的返回类型和函数名在同一行;函数参数列表超出行宽时要换行并合理对齐 在声明和定义函数的时候,函数的返回值类型应该和函数名在同一行;如果行宽度允许,函数参数也应该放在一行;否则,函数参数应该换行,并进行合理对齐。 参数列表的左圆括号总是和函数名在同一行,不要单独一行;右圆括号总是跟随最后一个参数。 @@ -506,7 +506,6 @@ int&p = i; // Bad ### 规则3.13.1 编译预处理的"#"统一放在行首,嵌套编译预处理语句时,"#"可以进行缩进 编译预处理的"#"统一放在行首,即使编译预处理的代码是嵌入在函数体中的,"#"也应该放在行首。 - ## 空格和空行 ### 规则3.14.1 水平空格应该突出关键字和重要信息,避免不必要的留白 水平空格应该突出关键字和重要信息,每行代码尾部不要加空格。总体规则如下: @@ -519,7 +518,7 @@ int&p = i; // Bad - 三目运算符(? :)符号两侧均需要空格 - 前置和后置的自增、自减(++ --)和变量之间不加空格 - 结构体成员操作符(. ->)前后不加空格 -- 逗号(,)前面不加空格,后面增加空格 +- 逗号(,)前面不加空格,后面加空格 - 对于模板和类型转换(<>)和类型之间不要添加空格 - 域操作符(::)前后不要添加空格 - 冒号(:)前后根据情况来判断是否要添加空格 @@ -658,7 +657,7 @@ switch (value) 减少不必要的空行,可以显示更多的代码,方便代码阅读。下面有一些建议遵守的规则: - 根据上下内容的相关程度,合理安排空行; - 函数内部、类型定义内部、宏内部、初始化表达式内部,不使用连续空行 -- 不使用连续 **3** 个空行,或更多 +- 不使用连续 **3** 个空行,或更多空行 - 大括号内的代码块行首之前和行尾之后不要加空行,但namespace的大括号内不作要求。 ```cpp @@ -949,7 +948,7 @@ void Foo::Fun() 头文件循环依赖,指 a.h 包含 b.h,b.h 包含 c.h,c.h 包含 a.h, 导致任何一个头文件修改,都导致所有包含了a.h/b.h/c.h的代码全部重新编译一遍。 而如果是单向依赖,如a.h包含b.h,b.h包含c.h,而c.h不包含任何头文件,则修改a.h不会导致包含了b.h/c.h的源代码重新编译。 -头文件循环依赖直接体现了架构设计上的不合理,可通过优化架构去避免。 +头文件循环依赖直接体现了架构设计上的不合理,可通过架构优化来避免。 ### 规则5.2.2 头文件必须编写`#define`保护,防止重复包含 @@ -1593,14 +1592,14 @@ base->Fun(); // 调用父类的Fun ## 多重继承 在实际开发过程中使用多重继承的场景是比较少的,因为多重继承使用过程中有下面的典型问题: 1. 菱形继承所带来的数据重复,以及名字二义性。因此,C++引入了virtual继承来解决这类问题; -2. 即便不是菱形继承,多个父类之间的名字也可能存在冲突,从而导致的二义性; +2. 即便不是菱形继承,多个父类之间的名字也可能存在冲突,从而导致二义性; 3. 如果子类需要扩展或改写多个父类的方法时,造成子类的职责不明,语义混乱; 4. 相对于委托,继承是一种白盒复用,即子类可以访问父类的protected成员, 这会导致更强的耦合。而多重继承,由于耦合了多个父类,相对于单根继承,这会产生更强的耦合关系。 多重继承具有下面的优点: 多重继承提供了一种更简单的组合来实现多种接口或者类的组装与复用。 -所以,对于多重继承的只有下面几种情况下面才允许使用多重继承。 +所以,只有下面几种情况才允许使用多重继承。 ### 建议7.3.1 使用多重继承来实现接口分离与多角色组合 如果某个类需要实现多重接口,可以通过多重继承把多个分离的接口组合起来,类似 scala 语言的 traits 混入。 @@ -1883,7 +1882,7 @@ string name("zhangsan"); // 调用构造函数 ## 表达式 ### 规则9.2.1 含有变量自增或自减运算的表达式中禁止再次引用该变量 含有变量自增或自减运算的表达式中,如果再引用该变量,其结果在C++标准中未明确定义。各个编译器或者同一个编译器不同版本实现可能会不一致。 -为了更好的可移植性,不应该对标准未定义的运算次序做任何假设。 +为了实现更好的可移植性,不应该对标准未定义的运算次序做任何假设。 注意,运算次序的问题不能使用括号来解决,因为这不是优先级的问题。 @@ -1911,7 +1910,7 @@ x = Func(i, i); ### 规则9.2.2 switch语句要有default分支 大部分情况下,switch语句中要有default分支,保证在遗漏case标签处理时能够有一个缺省的处理行为。 -特例: +例外: 如果switch条件变量是枚举类型,并且 case 分支覆盖了所有取值,则加上default分支处理有些多余。 现代编译器都具备检查是否在switch语句中遗漏了某些枚举值的case分支的能力,会有相应的warning提示。 @@ -1973,7 +1972,7 @@ x = (a == b) ? a : (a – b); /* 操作符不同,需要括号 */ 但是我们无法禁止使用类型转换,因为C++语言是一门面向机器编程的语言,涉及到指针地址,并且我们会与各种第三方或者底层API交互,他们的类型设计不一定是合理的,在这个适配的过程中很容易出现类型转换。 -例外:在调用某个函数的时候,如果我们不想处理函数结果,首先要考虑这个是否是你的最好的选择。如果确实不想处理函数的返回值,那么可以使用(void)转换来解决。 +例外:在调用某个函数的时候,如果我们不想处理函数结果,首先要考虑这个是否是你最好的选择。如果确实不想处理函数的返回值,那么可以使用(void)转换来解决。 ### 规则9.3.1 如果确定要使用类型转换,请使用由C++提供的类型转换,而不是C风格的类型转换 diff --git a/contribute/faq-template.md b/contribute/faq-template.md new file mode 100644 index 0000000000000000000000000000000000000000..6ded2b7b48211d84ebbaa554c0a8329b6c540071 --- /dev/null +++ b/contribute/faq-template.md @@ -0,0 +1,36 @@ +# FAQ:标题(简要描述问题关键信息) + +FAQ页面介绍开发过程中遇到的各类问题及解决方法,帮助更多开发者快速消除此类开发障碍。 + +## 简单类问题写作模板 + +简要描述在完成哪些操作时,遇到的问题现象,以及解决方法。 + +## 复杂类问题写作模板 + +**现象描述** + +- 使用的系统软件、硬件版本? +- 在完成哪些操作时,遇到了什么样的问题? + +- 可能显示什么错误消息? + +- 如果可能,请提供屏幕截图。 + + +**可能原因** + +分析哪些原因导致此问题,如果有多个原因,请使用项目列表一一列举。 + +1. XXX +2. XXX + +**处理步骤** + +- 如果有多个解决方案,请按照复杂性排序,并提供什么场景下选择哪种解决方案。 +- 如果可能,请提供屏幕截图,帮助理解步骤完成标准。 +- 代码如有打印输出,请提示打印输出内容_,帮助理解步骤完成标准_。 + +1. XXX +2. XXX + diff --git a/contribute/tutorial-title-task-name.md b/contribute/tutorial-title-task-name.md new file mode 100644 index 0000000000000000000000000000000000000000..c3d29f63c70dc14424a3607a462e5e55899eca06 --- /dev/null +++ b/contribute/tutorial-title-task-name.md @@ -0,0 +1,48 @@ +# 教程:标题(对应的任务名称) + +教程页面介绍如何完成一个复杂的任务开发、功能开发、APP开发。通常教程页面会将开发过程拆解为多个小节,每个小节由一系列步骤组成。同时,教程中一般需要提供代码示例并进行介绍,便于用户了解具体的功能实现。 + +对于教程中可能涉及到的基本概念,简单的概念可以直接介绍,更深度的概念和主题推荐查阅文档对应专题。 + +撰写教程页面时,在“others“目录下面创建新的MarkDown文件。 + +## 总览 + +_写作内容:介绍开发者学习本教程后将完成什么样的任务,实现什么样的功能和效果。__例如,可以是移植教程、实现一个功能开发教程等。_如果可实现多个目标,建议使用项目符号列表。 + +_如果可能,请提供图片或短视频展示实现效果。_ + +## 开发准备 + +- _完成该功能需要的软件、硬件、工具及对应版本信息。_ +- _需要获取的相关权限说明。_ + +## XXX(关键任务一) + +_将教程分解为几个顺序的关键任务或并列不同的场景任务。_ + +1. XXXX。 + + ``` + //代码示例 + ``` + +2. XXXX。 + +_所有的操作步骤,遵循如下写作要求:_ + +1. _步骤明确操作场景和目的,__步骤中执行的主体要描述清楚。_ +2. _步骤中如果涉及接口调用,需要清晰给出使用的接口及其使用说明,示例代码。_ +3. _涉及到工具界面的步骤,可以提供界面截图,帮助理解步骤完成标准。_ +4. _保证代码的逻辑和语法的正确性。_ +5. _代码中关键步骤要有注释说明。_ +6. 代码如有打印输出,请单独提示打印输出内容_,帮助理解步骤完成标准_。 + +## XXX(关键任务二) + +1. XXXX。 + +## 下一步 + +介绍本教程可能关联的后续开发任务,如果没有请删除此内容。 + diff --git "a/contribute/\350\264\241\347\214\256\346\226\207\346\241\243.md" "b/contribute/\350\264\241\347\214\256\346\226\207\346\241\243.md" index ac49b6960ac35237492da5b6c2815be57e378714..ce6d44c138c302186c604bdbbe4502142b1a1ff8 100755 --- "a/contribute/\350\264\241\347\214\256\346\226\207\346\241\243.md" +++ "b/contribute/\350\264\241\347\214\256\346\226\207\346\241\243.md" @@ -52,8 +52,8 @@ 鼓励开发者在学习、开发过程中,总结经验并创建技术内容帮助更多开发者快速上手。推荐输出各类How to教程、常见问题FAQ等。请参考如下写作模板: -- [How to教程](zh-cn_topic_0000001050785644.md) -- [FAQ](FAQ.md) +- [How to教程](tutorial-title-task-name.md) +- [FAQ](faq-template.md) 内容写作模板归档在Docs文档仓下contribute文件夹中。 diff --git a/docs-en/get-code/source-code-acquisition.md b/docs-en/get-code/source-code-acquisition.md index fdd4154d06f41b75c26baba33cbebcc75dde7055..b9441f2126b16977e3c2a4bef866dee834630c81 100755 --- a/docs-en/get-code/source-code-acquisition.md +++ b/docs-en/get-code/source-code-acquisition.md @@ -36,16 +36,16 @@ You can download the source code or the corresponding solutions from the image l

1.0

-

Site 1, Site 2

+

Site

-

SHA-256 Verification Code

+

SHA-256 Verification Code

Hi3861 solutions (binary)

1.0

-

Site 1, Site 2

+

Site

SHA-256 Verification Code

@@ -54,25 +54,25 @@ You can download the source code or the corresponding solutions from the image l

1.0

-

Site 1, Site 2

+

Site

-

SHA-256 Verification Code

+

SHA-256 Verification Code

Hi3516 solutions (binary)

1.0

-

Site 1, Site 2

+

Site

-

SHA-256 Verification Code

+

SHA-256 Verification Code

RELEASE-NOTES

1.0

-

Site 1

+

Site

-

@@ -234,7 +234,7 @@ Add the bundle \(**@ohos/demo** as an example\) to your project as follows: Method 1 \(recommended\): Use the **repo** tool to download source code. ``` -repo init -u https://gitee.com/openharmony/manifest.git -b master +repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify repo sync -c ``` diff --git a/docs-en/get-code/tool-acquisition.md b/docs-en/get-code/tool-acquisition.md index 5fa7b5267ec77e9c5113d0a073d90ea4f29ddf68..90ed477644c39785b999bd1112b1a638967af480 100755 --- a/docs-en/get-code/tool-acquisition.md +++ b/docs-en/get-code/tool-acquisition.md @@ -21,7 +21,7 @@ Download the compilation toolchain from image sites listed in the following tabl

9.0.0-34042

-

Site 1 Site 2

+

Site

64a518b50422b6f1ba8f6f56a5e303fb8448a311211ba10c385ad307a1d2546f

@@ -30,7 +30,7 @@ Download the compilation toolchain from image sites listed in the following tabl

7.3.0

-

Site 1 Site 2

+

Site

614ee086ead1a4fd7384332b85dd62707801f323de60dfdb61503f473d470a24

@@ -39,7 +39,7 @@ Download the compilation toolchain from image sites listed in the following tabl

1523

-

Site 1 Site 2

+

Site

50a5a5ba5877dd0ec8afcb23d3dd4d966a16403c29cd80a4002230241d32ef34

@@ -48,7 +48,7 @@ Download the compilation toolchain from image sites listed in the following tabl

1.9.0

-

Site 1 Site 2

+

Site

b4a4ba21e94ff77634e1f88697a00b6f498fdbc0b40d7649df1b246b285874f9

@@ -57,7 +57,7 @@ Download the compilation toolchain from image sites listed in the following tabl

0.65

-

Site 1 Site 2

+

Site

fcfee489371947a464fe41a4b45a897b9a44155891a957f15bad2e157c750162

diff --git a/docs-en/quick-start/developing-the-first-driver-running-on-hi3516.md b/docs-en/quick-start/developing-the-first-driver-running-on-hi3516.md index 1d64e5ebbea49f5cce47f106ae5492a4a8988aa3..3fe79a1f4923ea2ff121e00fa50cc67d2a338291 100755 --- a/docs-en/quick-start/developing-the-first-driver-running-on-hi3516.md +++ b/docs-en/quick-start/developing-the-first-driver-running-on-hi3516.md @@ -419,6 +419,9 @@ Compile and burn images by referring to [Compiling Code](developing-the-first-e 1. Connect to a serial port. + >![](public_sys-resources/icon-notice.gif) **NOTICE:** + >If the sconnection fails, rectify the fault by referring to problem 5 in the [FAQs](faqs-0.md) section. + **Figure 1** Serial port connection @@ -428,12 +431,12 @@ Compile and burn images by referring to [Compiling Code](developing-the-first-e 2. Enter the serial port number "com11" and press **Enter** until **hisillicon** is displayed. 3. Go to step 2 if the board is started for the first time or the startup parameters need to be modified; go to step 3 otherwise. -2. \(Mandatory when the board is started for the first time\) Modify the bootcmd and bootargs parameters of U-Boot. You need to perform this step only once if the parameters need not to be modified during the operation. The board automatically starts after it is reset. +2. \(Mandatory when the board is started for the first time\) Modify the bootcmd and bootargs parameters of U-boot. You need to perform this step only once if the parameters need not to be modified during the operation. The board automatically starts after it is reset. >![](public_sys-resources/icon-notice.gif) **NOTICE:** - >The default waiting time in the U-Boot is 2s. You can press **Enter** to interrupt the waiting and run the **reset** command to restart the system after "hisillicon" is displayed. + >The default waiting time in the U-boot is 2s. You can press **Enter** to interrupt the waiting and run the **reset** command to restart the system after "hisillicon" is displayed. - **Table 1** Startup parameters of the U-Boot + **Table 1** Startup parameters of the U-boot diff --git a/docs-en/quick-start/developing-the-first-example-program-running-on-hi3516.md b/docs-en/quick-start/developing-the-first-example-program-running-on-hi3516.md index 024eb2b7153fd47ab2107c191c55a79a3905f870..428ced4f97d8daa3df587577b48a3d3de585faa9 100755 --- a/docs-en/quick-start/developing-the-first-example-program-running-on-hi3516.md +++ b/docs-en/quick-start/developing-the-first-example-program-running-on-hi3516.md @@ -4,7 +4,7 @@ This section describes how to modify, compile, burn, and run the first program, ## Acquiring Source Code -You need to acquire [Hi3516 source code](http://tools.harmonyos.com/mirrors/os/1.0/code-1.0.tar.gz) and download it on a Linux server. For more obtaining methods, see [Source Code Acquisition](../get-code/source-code-acquisition.md). +You need to acquire [Hi3516 source code](https://repo.huaweicloud.com/harmonyos/os/1.0/code-1.0.tar.gz) and download it on a Linux server. For more obtaining methods, see [Source Code Acquisition](../get-code/source-code-acquisition.md). ## Modifying a Program @@ -114,6 +114,9 @@ This method applies only to development boards that have network ports, for exam 1. Connect to a serial port. + >![](public_sys-resources/icon-notice.gif) **NOTICE:** + >If the sconnection fails, rectify the fault by referring to problem 5 in the [FAQs](faqs-0.md) section. + **Figure 9** Serial port connection @@ -123,12 +126,12 @@ This method applies only to development boards that have network ports, for exam 2. Enter the serial port number "com11" and press **Enter** until **hisillicon** is displayed. 3. Go to step 2 if the board is started for the first time or the startup parameters need to be modified; go to step 3 otherwise. -2. \(Mandatory when the board is started for the first time\) Modify the bootcmd and bootargs parameters of U-Boot. You need to perform this step only once if the parameters need not to be modified during the operation. The board automatically starts after it is reset. +2. \(Mandatory when the board is started for the first time\) Modify the bootcmd and bootargs parameters of U-boot. You need to perform this step only once if the parameters need not to be modified during the operation. The board automatically starts after it is reset. >![](public_sys-resources/icon-notice.gif) **NOTICE:** - >The default waiting time in the U-Boot is 2s. You can press **Enter** to interrupt the waiting and run the **reset** command to restart the system after "hisillicon" is displayed. + >The default waiting time in the U-boot is 2s. You can press **Enter** to interrupt the waiting and run the **reset** command to restart the system after "hisillicon" is displayed. - **Table 1** Startup parameters of the U-Boot + **Table 1** Startup parameters of the U-boot

Command

@@ -453,7 +456,7 @@ Compile and burn images by referring to [Compiling Code](developing-the-first-e

rootaddr=10 M, rootsize=15 M rw indicates the start address and size of the rootfs.img file to be burnt, respectively. The file size must be the same as that of the compiled file in the IDE.

saveenv means to save the current configuration.

reset means to reset the board.

-

(Optional) go 0x80000000 indicates that the command is fixed in the startup parameters by default and the board automatically starts after it is reset. If you want to manually start the board, press Enter in the countdown phase of the U-Boot startup to interrupt the automatic startup.

+

(Optional) go 0x80000000 indicates that the command is fixed in the startup parameters by default and the board automatically starts after it is reset. If you want to manually start the board, press Enter in the countdown phase of the U-boot startup to interrupt the automatic startup.

@@ -162,7 +165,7 @@ This method applies only to development boards that have network ports, for exam ![](figures/qi1.png) -## Run a Program +## Running a Program In the root directory, run the **./bin/camera\_app** command to operate the demo program. The following figure shows the compilation result. diff --git a/docs-en/quick-start/developing-the-first-example-program-running-on-hi3518.md b/docs-en/quick-start/developing-the-first-example-program-running-on-hi3518.md index 9aebee65819eb0cd804e7bd6afd9db8a4c1ac822..c089ebe8c505fb96a49ec77e69acec50e21f255c 100755 --- a/docs-en/quick-start/developing-the-first-example-program-running-on-hi3518.md +++ b/docs-en/quick-start/developing-the-first-example-program-running-on-hi3518.md @@ -4,7 +4,7 @@ This section describes how to modify, compile, burn, and run the first program o ## Acquiring Source Code -You need to acquire [Hi3518 source code](http://tools.harmonyos.com/mirrors/os/1.0/code-1.0.tar.gz) and download it on a Linux server. For details, see [Source Code Acquisition](../get-code/source-code-acquisition.md). +You need to acquire [Hi3518 source code](https://repo.huaweicloud.com/harmonyos/os/1.0/code-1.0.tar.gz) and download it on a Linux server. For details, see [Source Code Acquisition](../get-code/source-code-acquisition.md). ## Modifying a Program @@ -71,14 +71,14 @@ Burn images to the Hi3518EV300 board over the serial port. ## Running an Image -1. Connect to the serial port. After the images are burnt successfully, start the terminal, click **Settings**, set **View Title** to **Terminal 11** and **Port** to **COM7**, and click **OK** to open the serial port. You have logged in to the U-Boot if **hisilicon \#** is displayed. +1. Connect to the serial port. After the images are burnt successfully, start the terminal, click **Settings**, set **View Title** to **Terminal 11** and **Port** to **COM7**, and click **OK** to open the serial port. You have logged in to the U-boot if **hisilicon \#** is displayed. **Figure 6** Serial port connection ![](figures/serial-port-connection.png "serial-port-connection") -2. \(Mandatory for the first burning\) Modify the **bootcmd** and **bootargs** parameters of U-Boot. This step is a fixed operation and the result can be saved. However, you need to perform the following steps again if U-Boot needs to be reburnt. +2. \(Mandatory for the first burning\) Modify the **bootcmd** and **bootargs** parameters of U-boot. This step is a fixed operation and the result can be saved. However, you need to perform the following steps again if U-boot needs to be reburnt. - **Table 1** Parameters of the Hi3518EV300 U-Boot + **Table 1** Parameters of the Hi3518EV300 U-boot

Command

@@ -148,7 +151,7 @@ This method applies only to development boards that have network ports, for exam

rootaddr=10 M, rootsize=15 M rw indicates the start address and size of the rootfs.img file to be burnt, respectively. The file size must be the same as that of the compiled file in the IDE.

saveenv means to save the current configuration.

reset means to reset the board.

-

(Optional) go 0x80000000 indicates that the command is fixed in the startup parameters by default and the board automatically starts after it is reset. If you want to manually start the board, press Enter in the countdown phase of the U-Boot startup to interrupt the automatic startup.

+

(Optional) go 0x80000000 indicates that the command is fixed in the startup parameters by default and the board automatically starts after it is reset. If you want to manually start the board, press Enter in the countdown phase of the U-boot startup to interrupt the automatic startup.

diff --git a/docs-en/quick-start/setting-up-a-development-environment-1.md b/docs-en/quick-start/setting-up-a-development-environment-1.md index 1c66dcca365d8398495355965d01491689c117c8..1c51e40f99c7b67441dc81b2bc49f40c358ea3e3 100755 --- a/docs-en/quick-start/setting-up-a-development-environment-1.md +++ b/docs-en/quick-start/setting-up-a-development-environment-1.md @@ -58,61 +58,61 @@ The following table describes the common tools required for Linux and how to obt **Table 2** Development tools and obtaining methods -

Command

@@ -92,7 +92,7 @@ Burn images to the Hi3518EV300 board over the serial port.

setenv bootcmd "sf probe 0;sf read 0x40000000 0x100000 0x600000;go 0x40000000";

Run this command to set the content of bootcmd. Select the flash whose number is 0, and read content that has a size of 0x600000 and a start address of 0x100000 to memory address 0x40000000.

-

(Optional) go 0x40000000 indicates that the command is fixed in the startup parameters by default and the board automatically starts after it is reset. If you want to manually start the board, press Enter in the countdown phase of the U-Boot startup to interrupt the automatic startup.

+

(Optional) go 0x40000000 indicates that the command is fixed in the startup parameters by default and the board automatically starts after it is reset. If you want to manually start the board, press Enter in the countdown phase of the U-boot startup to interrupt the automatic startup.

setenv bootargs "console=ttyAMA0,115200n8 root=flash fstype=jffs2 rw rootaddr=7 M rootsize=8 M";

In this command, bootargs is set to the serial port output, the baud rate is 115200, the data bit is 8, and the rootfs is mounted to the flash memory. The file system type is set to jffs2 rw, which provides the read-write attribute for the JFFS2 file system.

rootaddr=7 M rootsize=8 M indicates the actual start address and length of the rootfs.img file to be burnt. The size must be the same as that of the compiled files in the HiTool.

@@ -115,5 +115,5 @@ Burn images to the Hi3518EV300 board over the serial port. ## Follow-up Learning -Congratulations! You have finished all steps! You are advised to go on learning how to develop [Cameras with a Screen](en-us_topic_0000001055366100.md). +Congratulations! You have finished all steps! You are advised to go on learning how to develop [Cameras with a Screen](../guide/camera-control.md). diff --git a/docs-en/quick-start/developing-the-first-example-program-running-on-hi3861.md b/docs-en/quick-start/developing-the-first-example-program-running-on-hi3861.md index 88734f1912abde6108a7ec38fb6738811a6973b2..2093cee18a07929ea7b2ff0480e6f880d4db9c76 100755 --- a/docs-en/quick-start/developing-the-first-example-program-running-on-hi3861.md +++ b/docs-en/quick-start/developing-the-first-example-program-running-on-hi3861.md @@ -4,7 +4,7 @@ This example shows how to use attention \(AT\) commands to complete WLAN module ## Acquiring Source Code -You need to acquire [Hi3861 source code](http://tools.harmonyos.com/mirrors/os/1.0/code-1.0.tar.gz) and download it on a Linux server. For more obtaining methods, see [Source Code Acquisition](../get-code/source-code-acquisition.md). +You need to acquire [Hi3861 source code](https://repo.huaweicloud.com/harmonyos/os/1.0/code-1.0.tar.gz) and download it on a Linux server. For more obtaining methods, see [Source Code Acquisition](en-us_topic_0000001050769927.md). ## Compiling Source Code diff --git a/docs-en/quick-start/developing-the-second-example-program-running-on-hi3861.md b/docs-en/quick-start/developing-the-second-example-program-running-on-hi3861.md index e8358ef045cd3c8fb9ba289fd5f28d2c743edcdc..31f1b5d87dba44252b069875b76c262dd1e7f5c3 100755 --- a/docs-en/quick-start/developing-the-second-example-program-running-on-hi3861.md +++ b/docs-en/quick-start/developing-the-second-example-program-running-on-hi3861.md @@ -144,5 +144,5 @@ wifi init success! ## Follow-up Learning -Congratulations! You have finished all steps! You are advised to go on learning how to develop [WLAN-connected products](../guide/overview.md). +Congratulations! You have finished all steps! You are advised to go on learning how to develop [WLAN-connected products](en-us_topic_0000001054530966.md). diff --git a/docs-en/quick-start/faqs-0.md b/docs-en/quick-start/faqs-0.md index f29b798342873d20273b181bff09caf8b2db0292..12610762aaa2b6fdc3817b3ee45220e1a65e6f91 100755 --- a/docs-en/quick-start/faqs-0.md +++ b/docs-en/quick-start/faqs-0.md @@ -117,3 +117,57 @@ ![](figures/en-us_image_0000001054875562.png) +**Problem 5:** **What should I do when no command output is displayed?** + +- **Symptom** + + The serial port shows that the connection has been established. After the board is restarted, nothing is displayed when you press **Enter**. + +- **Possible Causes** + - The serial port is connected incorrectly. + - The U-boot of the board is damaged. + +- **Solutions** + + **Solution 1: Change the serial port number.** + + Start **Device Manager** to check whether the serial port connected to the board is the same as that connected to the terminal device. If not, perform the following steps to change the serial port number. + + **Figure 10** Procedure for changing the serial port number + ![](figures/procedure-for-changing-the-serial-port-number.png "procedure-for-changing-the-serial-port-number") + + +1. Disconnect from the current serial port. +2. Click **Settings**. +3. Change the serial port number in the dialog box and click **OK**. +4. Press **Enter** in the dialog box to check whether any command output is displayed after the connection is established. + +**Solution 2: Burn the U-boot.** + +If the fault persists after you perform the preceding operations, the U-boot of the board may be damaged. You can burn the U-boot by performing the following steps: + +1. Obtain the U-boot file. + + >![](public_sys-resources/icon-notice.gif) **NOTICE:** + >The U-boot file of the board can be obtained from **vendor\\hisi\\hi35xx\\hi3516dv300\\uboot\\out\\boot\\u-boot-hi3516dv300.bin** in the open-source package. + +2. Use HiTool to burn the U-boot. + + **Figure 11** Procedure for burning the U-boot using HiTool + + + ![](figures/未命名图片11111.png) + + 1. Select the COM7 serial port. + 2. Select **Serial** for **Transfer Mode**. + 3. Select **Burn Fastboot**. + 4. Select **spi nor** for **Flash Type**. + 5. Click **Browse** and select the corresponding U-boot file. + 6. Click **Burn** to start burning. + +3. Power off the board and then power it on. Connect the serial port after the burning is complete. Serial ports shown in the following figure are displayed after the U-boot is burnt. + + **Figure 12** Serial port displayed after the U-boot is burnt + ![](figures/serial-port-displayed-after-the-u-boot-is-burnt.png "serial-port-displayed-after-the-u-boot-is-burnt") + + diff --git a/docs-en/quick-start/faqs-2.md b/docs-en/quick-start/faqs-2.md index ffc8060fc952ba6597b823b3074bac12e9e774ad..feb6b39d5cd0b5b64fa2ca606ae2921b739b9879 100755 --- a/docs-en/quick-start/faqs-2.md +++ b/docs-en/quick-start/faqs-2.md @@ -8,14 +8,16 @@ - **Possible Causes** - The serial port is connected incorrectly. - - The U-Boot of the board is damaged. + - The U-boot of the board is damaged. - **Solutions** + **Solution 1: Change the serial port number.** + Start **Device Manager** to check whether the serial port connected to the board is the same as that connected to the terminal device. If not, perform the following steps to change the serial port number. **Figure 1** Procedure for changing the serial port number - ![](figures/procedure-for-changing-the-serial-port-number.png "procedure-for-changing-the-serial-port-number") + ![](figures/procedure-for-changing-the-serial-port-number-4.png "procedure-for-changing-the-serial-port-number-4") 1. Disconnect from the current serial port. @@ -23,32 +25,34 @@ 3. Change the serial port number in the dialog box and click **OK**. 4. Press **Enter** in the dialog box to check whether any command output is displayed after the connection is established. -If the fault persists after you perform the preceding operations, the U-Boot of the board may be damaged. You can burn the U-Boot by performing the following steps: +**Solution 2: Burn the U-boot.** + +If the fault persists after you perform the preceding operations, the U-boot of the board may be damaged. You can burn the U-boot by performing the following steps: -1. Obtain the U-Boot file. +1. Obtain the U-boot file. >![](public_sys-resources/icon-notice.gif) **NOTICE:** - >The U-Boot file of the board can be obtained from **vendor\\hisi\\hi35xx\\hi3518ev300\\uboot\\out\\boot\\u-boot-hi3518ev300.bin** in the open-source package. + >The U-boot file of the board can be obtained from **vendor\\hisi\\hi35xx\\hi3518ev300\\uboot\\out\\boot\\u-boot-hi3518ev300.bin** in the open-source package. -2. Use HiTool to burn the U-Boot. +2. Use HiTool to burn the U-boot. - **Figure 2** Procedure for burning the U-Boot using HiTool + **Figure 2** Procedure for burning the U-boot using HiTool ![](figures/procedure-for-burning-the-u-boot-using-hitool.png "procedure-for-burning-the-u-boot-using-hitool") 1. Select the COM7 serial port. 2. Select **Serial** for **Transfer Mode**. 3. Select **Burn Fastboot**. 4. Select **spi nor** for **Flash Type**. - 5. Click **Browse** and select the corresponding U-Boot file. + 5. Click **Browse** and select the corresponding U-boot file. 6. Click **Burn** to start burning. -3. Power off the board and then power it on. Connect the serial port after the burning is complete. Serial ports shown in the following figure are displayed after the U-Boot is burnt. +3. Power off the board and then power it on. Connect the serial port after the burning is complete. Serial ports shown in the following figure are displayed after the U-boot is burnt. - **Figure 3** Serial port displayed after the U-Boot is burnt - ![](figures/serial-port-displayed-after-the-u-boot-is-burnt.png "serial-port-displayed-after-the-u-boot-is-burnt") + **Figure 3** Serial port displayed after the U-boot is burnt + ![](figures/serial-port-displayed-after-the-u-boot-is-burnt-5.png "serial-port-displayed-after-the-u-boot-is-burnt-5") -**Problem 2: What should I do when an error is reported when the U-Boot is burnt using HiTool?** +**Problem 2: What should I do when an error is reported when the U-boot is burnt using HiTool?** - **Symptom** diff --git a/docs-en/quick-start/figures/adding-the-hi3516dv300-board.png b/docs-en/quick-start/figures/adding-the-hi3516dv300-board.png index 81a2b496aacb056d6003d0fe440e9d1dfe8f96e8..2d807c348ffdb802b239e295abb7b7e079e213e5 100755 Binary files a/docs-en/quick-start/figures/adding-the-hi3516dv300-board.png and b/docs-en/quick-start/figures/adding-the-hi3516dv300-board.png differ diff --git a/docs-en/quick-start/figures/appearance-of-hi3861-wlan-module.png b/docs-en/quick-start/figures/appearance-of-hi3861-wlan-module.png index df3f85daabb08e137bafd8a098c6f882f1a5776b..ccc714eadc965fc4b29703c3156e730f84c97596 100755 Binary files a/docs-en/quick-start/figures/appearance-of-hi3861-wlan-module.png and b/docs-en/quick-start/figures/appearance-of-hi3861-wlan-module.png differ diff --git a/docs-en/quick-start/figures/procedure-for-changing-the-serial-port-number-4.png b/docs-en/quick-start/figures/procedure-for-changing-the-serial-port-number-4.png new file mode 100644 index 0000000000000000000000000000000000000000..f699204d10d39eb088c0ecc7aa08ba134ec4b6b6 Binary files /dev/null and b/docs-en/quick-start/figures/procedure-for-changing-the-serial-port-number-4.png differ diff --git a/docs-en/quick-start/figures/serial-port-displayed-after-the-u-boot-is-burnt-5.png b/docs-en/quick-start/figures/serial-port-displayed-after-the-u-boot-is-burnt-5.png new file mode 100644 index 0000000000000000000000000000000000000000..4e2a2794e63f64341e448313968b6f82d237543d Binary files /dev/null and b/docs-en/quick-start/figures/serial-port-displayed-after-the-u-boot-is-burnt-5.png differ diff --git a/docs-en/quick-start/figures/serial-port-displayed-after-the-u-boot-is-burnt.png b/docs-en/quick-start/figures/serial-port-displayed-after-the-u-boot-is-burnt.png index 4e2a2794e63f64341e448313968b6f82d237543d..ad4fd618860ca9f79e9bdc39436c3b2f9cdb72de 100755 Binary files a/docs-en/quick-start/figures/serial-port-displayed-after-the-u-boot-is-burnt.png and b/docs-en/quick-start/figures/serial-port-displayed-after-the-u-boot-is-burnt.png differ diff --git "a/docs-en/quick-start/figures/\346\234\252\345\221\275\345\220\215\345\233\276\347\211\20711111.png" "b/docs-en/quick-start/figures/\346\234\252\345\221\275\345\220\215\345\233\276\347\211\20711111.png" new file mode 100644 index 0000000000000000000000000000000000000000..4b8caa20e71b5a592b82a625d9f022a29667427d Binary files /dev/null and "b/docs-en/quick-start/figures/\346\234\252\345\221\275\345\220\215\345\233\276\347\211\20711111.png" differ diff --git a/docs-en/quick-start/introduction-to-the-hi3861-development-board.md b/docs-en/quick-start/introduction-to-the-hi3861-development-board.md index 0cbcbe583033866e300b75bd797b708e8b8a231c..8fb93d867301459da72cecec565d434d12411515 100755 --- a/docs-en/quick-start/introduction-to-the-hi3861-development-board.md +++ b/docs-en/quick-start/introduction-to-the-hi3861-development-board.md @@ -43,9 +43,9 @@ As the Hi3861 only offers 2 MB Flash and 352 KB RAM, use them efficiently when c

General specifications

  • Operates over 1×1 2.4 GHz frequency band (ch1-ch14).
  • The physical layer (PHY) complies with the IEEE 802.11b/g/n protocol.
  • The media access control (MAC) layer complies with the IEEE802.11 d/e/h/i/k/v/w protocol.
-
  • Includes the built-in public address (PA) and local area network (LAN); integrates transmit-receive (Tx/Rx) switch and Balun.
  • Supports the station (STA) and access point (AP) modes. When the Hi3861 WLAN module functions as an AP, a maximum of six STAs are supported.
  • Supports WPA and WPA2 from WFA (personal), and WPS 2.0.
  • Supports three kinds of packet traffic arbiter (PTA) (2- , 3- , or 4-wire PTA), each of which coexists with the BT or BLE chip.
  • The input voltage ranges from 2.3 V to 3.6 V.
+
  • Includes the built-in public address (PA) and local area network (LAN); integrates transmit-receive (Tx/Rx) switch and Balun.
  • Supports the station (STA) and access point (AP) modes. When the Hi3861 WLAN module functions as an AP, a maximum of six STAs are supported.
  • Supports WPA and WPA2 from WFA (personal), and WPS 2.0.
  • Supports three kinds of packet traffic arbiter (PTA) (2-, 3-, or 4-wire PTA), each of which coexists with the BT or BLE chip.
  • The input voltage ranges from 2.3 V to 3.6 V.
  • The input/output (I/O) power voltage can be 1.8 V or 3.3 V.
-
  • Supports self-calibration for RF hardware.
  • Performs with low power consumption:
    • Ultra deep sleep mode: 5 μA@3.3
    • VDTIM1: 1.5mA@3.3V
    • DTIM3: 0.8mA@3.3V
    +
    • Supports self-calibration for RF hardware.
    • Performs with low power consumption:
      • Ultra deep sleep mode: 5 μA @ 3.3 V
      • DTIM1: 1.5 mA @ 3.3 V
      • DTIM3: 0.8 mA @ 3.3 V
- - - - - - - @@ -310,7 +310,7 @@ sudo ln -s /bin/bash /bin/sh ## 安装gn 1. 打开Linux编译服务器终端。 -2. [下载gn工具](http://tools.harmonyos.com/mirrors/gn/1523/linux/gn.1523.tar)。 +2. [下载gn工具](https://repo.huaweicloud.com/harmonyos/compiler/gn/1523/linux/gn.1523.tar)。 3. 解压gn安装包至\~/gn路径下:"tar -xvf gn.1523.tar -C \~/"。 4. 设置环境变量:"vim \~/.bashrc", 新增:"export PATH=\~/gn:$PATH"。 5. 生效环境变量:"source \~/.bashrc"。 @@ -318,7 +318,7 @@ sudo ln -s /bin/bash /bin/sh ## 安装ninja 1. 打开Linux编译服务器终端 -2. [下载ninja工具](http://tools.harmonyos.com/mirrors/ninja/1.9.0/linux/ninja.1.9.0.tar)。 +2. [下载ninja工具](https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar)。 3. 解压ninja安装包至\~/ninja路径下:"tar -xvf ninja.1.9.0.tar -C \~/"。 4. 设置环境变量:"vim \~/.bashrc", 新增:"export PATH=\~/ninja:$PATH"。 5. 生效环境变量:"source \~/.bashrc"。 @@ -329,8 +329,8 @@ sudo ln -s /bin/bash /bin/sh >Hi3861平台仅支持使用libgcc运行时库的静态链接,**不建议开发者使用libgcc运行时库的动态链接,会导致商业分发时被GPL V3污染。** 1. 打开Linux编译服务器终端。 -2. [下载gcc\_riscv32工具](http://tools.harmonyos.com/mirrors/gcc_riscv32/7.3.0/linux/gcc_riscv32-linux-7.3.0.tar.gz)。 -3. 解压gcc\_riscv32安装包至/opt/gcc\_riscv32路径下:"tar -xvf gcc\_riscv32-linux-7.3.0.tar.gz -C \~/"。 +2. [下载gcc\_riscv32工具](https://repo.huaweicloud.com/harmonyos/compiler/gcc_riscv32/7.3.0/linux/gcc_riscv32-linux-7.3.0.tar.gz)。 +3. 解压gcc\_riscv32安装包至\~/gcc\_riscv32路径下:"tar -xvf gcc\_riscv32-linux-7.3.0.tar.gz -C \~/"。 4. 设置环境变量:"vim \~/.bashrc",新增:"export PATH=\~/gcc\_riscv32/bin:$PATH"。 5. 生效环境变量:"source \~/.bashrc"。 6. Shell命令行中输入“riscv32-unknown-elf-gcc -v”,如果能正确显示编译器版本号,表明编译器安装成功。 diff --git "a/readme/DFX\345\255\220\347\263\273\347\273\237README.md" "b/readme/DFX\345\255\220\347\263\273\347\273\237README.md" index 85fef3ad83bb4211394f8fa4096644393ffaa831..3e03ca4adaf45e57cc07b440175d2e1e0274059a 100755 --- "a/readme/DFX\345\255\220\347\263\273\347\273\237README.md" +++ "b/readme/DFX\345\255\220\347\263\273\347\273\237README.md" @@ -2,13 +2,13 @@ ## 简介 -该仓库用于存放DFX框架的代码。主要包含DFR(可靠性)和DFT(可测试性)特性。 +该仓库用于存放DFX框架的代码。主要包含DFR(Design for Reliability,可靠性)和DFT(Design for Testability,可测试性)特性。 由于芯片平台资源有限,且硬件平台多样,因此需要针对不同硬件架构和资源提供组件化且可定制的DFX框架。根据RISC-V、Cortex-M、Cortex-A不同硬件平台,提供两种不同的轻量级DFX框架,以下简称mini、featured。 - mini框架:针对处理架构为Cortex-M或同等处理能力的硬件平台,系统内存一般低于512KB,无文件系统或者仅提供一个可有限使用的轻量级文件系统,遵循CMSIS接口规范。 -- featured框架:处理架构为Cortex-A或同等处理能力的硬件平台,内存资源大于512KB,文件系统完善,可存储大量数据,遵循POSIX接口规范。 +- featured框架:处理架构为Cortex-A或同等处理能力的硬件平台,内存资源一般大于512KB,文件系统完善,可存储大量数据,遵循POSIX接口规范。 ## 目录 @@ -64,7 +64,7 @@ - - @@ -102,7 +102,7 @@ ## 约束 -mini框架整体代码使用标准C开发,对外的接口依赖统一通过util封装,如软硬件平台不同需要适配,需要在vendor下实现适配处理。 +mini框架整体代码使用标准C开发。 ## 使用-mini框架 @@ -130,20 +130,18 @@ DFX-mini是一套简单小巧的DFX设计,对外提供log功能: 在A模块的初始化流程中添加如下代码,注册模块到日志框架中: ``` - HiLogRegisterModule(HILOG_MODULE_SAMGR, "A"); + HiLogRegisterModule(HILOG_MODULE_A, "A"); ``` 1. **第三步调整DFX框架静态配置** - 根据需要调整 + 根据需要调整如下文件的g\_hiviewConfig全局参数配置。默认情况下不用修改,日志默认输出到串口。 ``` utils/lite/hiview_config.c ``` - 的g\_hiviewConfig全局参数配置。默认情况下不用修改,日志默认输出到串口。 -

Development Tool

+ - - - - - - - - - - - - - - - - - - - - - - - @@ -140,7 +140,7 @@ The following table describes the common tools required for Linux and how to obt - @@ -246,7 +246,7 @@ sudo ln -s /bin/bash /bin/sh ## Installing gn 1. Start a Linux server. -2. Download [gn](https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/latest). +2. Download [gn](https://repo.huaweicloud.com/harmonyos/compiler/gn/1523/linux/gn.1523.tar). 3. Decompress the **gn** installation package to the **tar -xvf gn.1523.tar -C \~/** in **\~/gn** directory. 4. Open the **\~/.bashrc** file in Vim and add a line of **export PATH=\~/gn:$PATH** to set an environment variable. 5. Run **source \~/.bashrc** to validate the environment variable. @@ -254,7 +254,7 @@ sudo ln -s /bin/bash /bin/sh ## Installing ninjah 1. Start a Linux server. -2. Download [ninja](https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-linux.zip). +2. Download [ninja](https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar). 3. Decompress the **ninja** installation package to **tar -xvf ninja.1.9.0.tar -C \~/** in **\~/ninja** directory. 4. Open the **\~/.bashrc** file in Vim and add a line of **export PATH=\~/ninja:$PATH** to set an environment variable. 5. Run **source \~/.bashrc** to validate the environment variable. @@ -262,7 +262,7 @@ sudo ln -s /bin/bash /bin/sh ## Installing the LLVM Toolchain 1. Start a Linux server. -2. Download [http://tools.harmonyos.com/mirrors/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar](http://tools.harmonyos.com/mirrors/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar). +2. Download [LLVM](http://tools.harmonyos.com/mirrors/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar). 3. Decompress the LLVM installation package to the **\~/llvm** path by running **"tar -xvf llvm-linux-9.0.0-34042.tar -C \~/"**. 4. Open the **\~/.bashrc** file in Vim and add a line of **export PATH=\~/llvm/bin:$PATH** to set an environment variable. 5. Run **source \~/.bashrc** to validate the environment variable. @@ -270,8 +270,8 @@ sudo ln -s /bin/bash /bin/sh ## Installing hc-gen 1. Start a Linux server. -2. Download [http://tools.harmonyos.com/mirrors/hc-gen/0.65/linux/hc-gen-0.65-linux.tar](http://tools.harmonyos.com/mirrors/hc-gen/0.65/linux/hc-gen-0.65-linux.tar). -3. Decompress the hc-gen installation package to the **\~/hc-gen** directory on the Linux server. +2. Download [hc-gen](https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar). +3. Decompress the hc-gen installation package to **tar -xvf hc-gen-0.65-linux.tar -C \~/** in **\~/hc-gen** on the Linux. 4. Open the **\~/.bashrc** file in Vim and add a line of **export PATH=\~/hc-gen:$PATH** to set an environment variable. 5. Run **source \~/.bashrc** to validate the environment variable. diff --git a/docs-en/quick-start/setting-up-a-development-environment.md b/docs-en/quick-start/setting-up-a-development-environment.md index 59c381943bc927389a9347ee8475a3c2ccf344e9..95e689004c9b0970d06ad93bdd0d70751855d4c6 100755 --- a/docs-en/quick-start/setting-up-a-development-environment.md +++ b/docs-en/quick-start/setting-up-a-development-environment.md @@ -67,7 +67,7 @@ The following table describes the tools required for setting up the general envi - - - @@ -298,7 +298,7 @@ sudo ln -s /bin/bash /bin/sh ## Installing gn 1. Start a Linux server. -2. Download [gn](https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/latest). +2. Download [gn](https://repo.huaweicloud.com/harmonyos/compiler/gn/1523/linux/gn.1523.tar). 3. Decompress the **gn** installation package to the **tar -xvf gn.1523.tar -C \~/** in **\~/gn** directory. 4. Open the **\~/.bashrc** file in Vim and add a line of **export PATH=\~/gn:$PATH** to set an environment variable. 5. Run **source \~/.bashrc** to validate the environment variable. @@ -306,7 +306,7 @@ sudo ln -s /bin/bash /bin/sh ## Installing ninjah 1. Start a Linux server. -2. Download [ninja](https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-linux.zip). +2. Download [ninja](https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar). 3. Decompress the **ninja** installation package to **tar -xvf ninja.1.9.0.tar -C \~/** in **\~/ninja** directory. 4. Open the **\~/.bashrc** file in Vim and add a line of **export PATH=\~/ninja:$PATH** to set an environment variable. 5. Run **source \~/.bashrc** to validate the environment variable. @@ -317,7 +317,7 @@ sudo ln -s /bin/bash /bin/sh >The Hi3861 platform supports only the static link of the libgcc library. **The dynamic link is not recommended because version 3 of the GNU General Public License \(GPLv3\) will be polluted during commercial distribution.** 1. Start a Linux server. -2. Download [gcc\_riscv32](http://tools.harmonyos.com/mirrors/gcc_riscv32/7.3.0/linux/gcc_riscv32-linux-7.3.0.tar.gz). +2. Download [gcc\_riscv32](https://repo.huaweicloud.com/harmonyos/compiler/gcc_riscv32/7.3.0/linux/gcc_riscv32-linux-7.3.0.tar.gz). 3. Decompress the gcc\_riscv32 installation package to **tar -xvf gcc\_riscv32-linux-7.3.0.tar.gz -C \~/** in **/opt/gcc\_riscv32**. 4. Open the **\~/.bashrc** file in Vim and add a line of **export PATH=\~/gcc\_riscv32/bin:$PATH** to set an environment variable. 5. Run **source \~/.bashrc** to validate the environment variable. diff --git a/docs-en/quick-start/setting-up-a-hi3516-board-environment.md b/docs-en/quick-start/setting-up-a-hi3516-board-environment.md index 5a399f6c3a4150b0a914d5b0e244527db9bc5bdd..205948a0587106616ca431e9accfa1175eb0e3f0 100755 --- a/docs-en/quick-start/setting-up-a-hi3516-board-environment.md +++ b/docs-en/quick-start/setting-up-a-hi3516-board-environment.md @@ -63,61 +63,61 @@ The following table describes the common tools required for Linux and how to obt **Table 2** Development tools and obtaining methods -

Development Tool

Description

+

Description

How to Obtain

+

How to Obtain

Python3.7+

+

Python3.7+

Runs the compilation scripts.

+

Runs the compilation scripts.

https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz

+

https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz

bash

+

bash

Executes commands.

+

Executes commands.

Internet

+

Internet

gn

+

gn

Generates ninja compilation scripts.

+

Generates ninja compilation scripts.

http://tools.harmonyos.com/mirrors/gn/1523/linux/gn.1523.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/gn/1523/linux/gn.1523.tar

ninja

+

ninja

Executes ninja compilation scripts.

+

Executes ninja compilation scripts.

http://tools.harmonyos.com/mirrors/ninja/1.9.0/linux/ninja.1.9.0.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar

LLVM

+

LLVM

Functions as the compiler toolchain.

+

Functions as the compiler toolchain.

http://tools.harmonyos.com/mirrors/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar

hc-gen

+

hc-gen

Configures and compiles files.

+

Configures and compiles files.

http://tools.harmonyos.com/mirrors/hc-gen/0.65/linux/hc-gen-0.65-linux.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar

IPOP, PuTTY, or other HyperTerminal software

+

IPOP, PuTTY, or other HyperTerminal software

Connects to the Linux server (choose one of the terminals).

+

Connects to the Linux server (choose one of the terminals).

Internet (for example, https://www.putty.org/)

+

Internet (for example, https://www.putty.org/)

HiTool

Burns the images and the U-Boot.

+

Burns the images and the U-boot.

http://www.hihope.org/download

Executes script cross compilation.

http://tools.harmonyos.com/mirrors/gcc_riscv32/7.3.0/linux/gcc_riscv32-linux-7.3.0.tar.gz

+

https://repo.huaweicloud.com/harmonyos/compiler/gcc_riscv32/7.3.0/linux/gcc_riscv32-linux-7.3.0.tar.gz

Python3.7+

@@ -102,14 +102,14 @@ The following table describes the tools required for setting up the general envi

Generates ninja compilation scripts.

http://tools.harmonyos.com/mirrors/gn/1523/linux/gn.1523.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/gn/1523/linux/gn.1523.tar

ninja

Executes ninja compilation scripts.

http://tools.harmonyos.com/mirrors/ninja/1.9.0/linux/ninja.1.9.0.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar

- - - - - - - - - - @@ -45,13 +40,13 @@ The source code directory structure of the Distributed Scheduler is as follows: │ ├── distributed_schedule_service.h # Header file for the open APIs provided by the Distributed Scheduler │ ├── dmslite_check_remote_permission.h # Header file for the permission management module of the Distributed Scheduler │ ├── dmslite_famgr.h # Header file for the FA management module of the Distributed Scheduler -│ ├── dmslite_inner_common.h # Header file for the service files of the Distributed Scheduler -│ ├── dmslite.h # Header file for the implementation of the Distributed Scheduler +│ ├── dmslite_inner_common.h # Internal common file for the Distributed Scheduler +│ ├── dmslite.h # Header file for the implementation of the Distributed Scheduler Service │ ├── dmslite_log.h # Header file for the log module -│ ├── dmslite_msg_parser.h # Header file for communication data deserialization +│ ├── dmslite_msg_parser.h # Header file for the distributed message parsing module │ ├── dmslite_tlv_common.h # Header file for the TLV data parsing module -│ └── dmslite_session.h # Header file for enabling cross-device communication -├── README.md +│ └── dmslite_session.h # Header file for the inter-device communication module +├── readme.md ├── LICENSE ├── source ├── distributed_schedule_service.c @@ -65,69 +60,59 @@ The source code directory structure of the Distributed Scheduler is as follows: ## Constraints -- Language: C -- Networking: Devices must be on the same LAN. -- Operating system: OpenHarmony +**Language**: C or C++ + +**Networking environment**: The primary and secondary devices must be on the same LAN and can ping each other. + +**Operating system**: OpenHarmony **Limitations and constraints on remote startup**: - Only FAs can be started remotely. Remote startup is unavailable to abilities using the Service template. -- Before the remote startup, ensure that the primary and secondary devices are on the same network segment and can ping each other. Otherwise, the remote startup fails. +- Before the remote startup, ensure that the distributed networking between the primary and secondary devices is successful. Otherwise, the remote startup fails. ## Usage -**Compiling the Distributed Scheduler** +- **Compiling the Distributed Scheduler** -The distributed scheduler uses some feature macros to customize the function code to be compiled on different platforms. The function code is stored in **build\\lite\\config\\subsystem\\distributedschedule\\**. The directory structure is as follows: +The code of the Distributed Scheduler is stored in the following directory: ``` -build/lite/config/subsystem/distributedschedule -├── BUILD.gn +foundation/distributedschedule/services/dtbschedmgr_lite ``` -Modify the **BUILD.gn** file when compiling code for different platforms. The following code snippet uses code compilation for the Hi3518EV300 and Hi3516DV300 development boards as an example: +When compiling the code for a specific platform, you need to specify the target platform. The following code snippet uses code compilation for the Hi3516DV300 platform as an example: ``` -zlite_subsystem("distributedschedule") { - subsystem_components = [ - "//foundation/distributedschedule/services/samgr_lite:samgr", - ] - if (board_name == "hi3518ev300" || board_name == "hi3516dv300") { - subsystem_components += [ - "//foundation/distributedschedule/services/safwk_lite:safwk_lite", - "//foundation/distributedschedule/services/dtbschedmgr_lite:dtbschedmgr", // Configure the distributed scheduler. - ] - } -} +python build.py ipcamera -p hi3516dv300_liteos_a ``` -**\* Primary device development** \(taking FA startup as an example\) +- **Primary device development** \(taking FA startup as an example\) -Create a **Want** instance. You should first create an **ElementName** object with **deviceId**, **bundleName**, and **abilityName** specified and add this object to the **Want** instance. Then, set the multi-device startup flag **Want.FLAG\_ABILITYSLICE\_MULTI\_DEVICE** to the **Want** instance to enable remote FA startup. +Create a **Want** instance to set the remote device ID, bundle name, and ability class name of the target FA and set the **Want.FLAG\_ABILITYSLICE\_MULTI\_DEVICE** flag to enable distributed startup. ``` -// Import related header files. import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Want; import ohos.bundle.ElementName; -// Start the remote FA on the secondary device. -Want want = new Want(); // Create a Want instance that encapsulates information about the remote FA to start. -ElementName name = new ElementName("remote_device_id", "com.huawei.remote_package_name", "remote_class_name"); +// Create a Want instance that will be passed to the startAbility method. +Want want = new Want(); +ElementName name = new ElementName(remote_device_id, "com.huawei.remote_bundle_name", "remote_ability_name"); want.setElement(name); // Add information about the target FA for startup to the Want instance. want.setFlags(Want.FLAG_ABILITYSLICE_MULTI_DEVICE); // Set the multi-device startup flag. If this flag is not set, remote FA startup will be unavailable. + +// Start the remote FA on the secondary device. startAbility(want); // Start the specified FA based on the want parameter. If the name and type of the want parameter are different from those used in the IDE, use the parameter name and type in the IDE. ``` -**\* Prerequisites** - -**Networking between the primary and secondary devices**: Before the remote startup, ensure that the two devices are on the same network segment and can ping each other. Otherwise, the remote startup fails. +- **Prerequisites** -**FA installation on the secondary device**: Before the remote startup, ensure that the target FA has been installed on the secondary device. +The target FA with the specified bundle name must have been installed on the secondary device. -**\* Execution** \(taking FA startup as an example\) +- **Execution** \(taking FA startup as an example\) -Call **startAbility** on the primary device \(smart TV\) to start the FA of the secondary device \(memory-constrained device such as a lite wearable\). +Call the **startAbility** method on the primary device to start the target FA on the secondary device. ## Repositories Involved diff --git "a/docs-en/readme/figures/bms\347\255\226\347\225\245\344\270\276\344\276\213.png" "b/docs-en/readme/figures/bms\347\255\226\347\225\245\344\270\276\344\276\213.png" new file mode 100755 index 0000000000000000000000000000000000000000..fb9c3d8c66673f5c5b69718f59bb09dab16e48a9 Binary files /dev/null and "b/docs-en/readme/figures/bms\347\255\226\347\225\245\344\270\276\344\276\213.png" differ diff --git a/docs-en/readme/figures/declaring-permissions.png b/docs-en/readme/figures/declaring-permissions.png deleted file mode 100755 index cb34dac621d30de96efeef18f8b5d4519ab3de8e..0000000000000000000000000000000000000000 Binary files a/docs-en/readme/figures/declaring-permissions.png and /dev/null differ diff --git a/docs-en/readme/figures/en-us_image_0000001054941316.png b/docs-en/readme/figures/en-us_image_0000001054941316.png new file mode 100644 index 0000000000000000000000000000000000000000..5c36589713f0264b5d3f87e3af9b63b05dda17d7 Binary files /dev/null and b/docs-en/readme/figures/en-us_image_0000001054941316.png differ diff --git a/docs-en/readme/figures/en-us_image_0000001055103250.png b/docs-en/readme/figures/en-us_image_0000001055103250.png new file mode 100755 index 0000000000000000000000000000000000000000..1123a2ad54538e66721419518ac33c94a6eaa5d3 Binary files /dev/null and b/docs-en/readme/figures/en-us_image_0000001055103250.png differ diff --git a/docs-en/readme/figures/en-us_image_0000001055199362.png b/docs-en/readme/figures/en-us_image_0000001055199362.png deleted file mode 100755 index 91ee8f2b429c045f5f3fc57a09c76bb9c6c8bc14..0000000000000000000000000000000000000000 Binary files a/docs-en/readme/figures/en-us_image_0000001055199362.png and /dev/null differ diff --git a/docs-en/readme/figures/en-us_image_0000001055267336.png b/docs-en/readme/figures/en-us_image_0000001055267336.png new file mode 100644 index 0000000000000000000000000000000000000000..c329d1d02d83435acfa6dbf1629f5649541f3b42 Binary files /dev/null and b/docs-en/readme/figures/en-us_image_0000001055267336.png differ diff --git "a/docs-en/readme/figures/\345\205\250\345\261\200\347\255\226\347\225\2452.png" "b/docs-en/readme/figures/\345\205\250\345\261\200\347\255\226\347\225\2452.png" new file mode 100755 index 0000000000000000000000000000000000000000..c40fd5e3f15cbd316c43dce31020740396c57d3f Binary files /dev/null and "b/docs-en/readme/figures/\345\205\250\345\261\200\347\255\226\347\225\2452.png" differ diff --git "a/docs-en/readme/figures/\347\255\226\347\225\245\347\261\273\345\236\2132.png" "b/docs-en/readme/figures/\347\255\226\347\225\245\347\261\273\345\236\2132.png" new file mode 100755 index 0000000000000000000000000000000000000000..1ad38251b4d9abba2076bfc2df91fa14c81ac07d Binary files /dev/null and "b/docs-en/readme/figures/\347\255\226\347\225\245\347\261\273\345\236\2132.png" differ diff --git a/docs-en/readme/js-application-framework.md b/docs-en/readme/js-application-framework.md index d1e8b4a14c903554c38f434ff468db3281286f67..fd0a55854a0a89a6aeface04708f146baf3a4d2c 100755 --- a/docs-en/readme/js-application-framework.md +++ b/docs-en/readme/js-application-framework.md @@ -2,7 +2,7 @@ ## Introduction -The JS application framework allows you to develop web-like applications across platforms. The framework uses Toolkit to pack your **.hml**, **.css**, and **.js** files to a JavaScript bundle, parses the bundle, and renders it with view components of the C++ native UI. You can use the declarative APIs to develop applications. This allows data to drive view changes and avoids a large number of view operations, greatly simplifying application development. +The JS application framework allows you to develop web-like applications across platforms. The framework uses Toolkit to pack your **.hml**, **.css**, and **.js** files to a JavaScript bundle, parses the bundle, generates the native UI view component tree, and then renders it for display. You can use the declarative APIs to develop applications. This allows data to drive view changes and avoids a large number of view operations, greatly simplifying application development. The following figure shows the framework modules. @@ -14,37 +14,37 @@ The source code of the framework is stored in **/foundation/ace**. The followin ``` /foundation/ace -├── frameworks #Framework code +├── frameworks # Framework code │ └── lite -│ ├── examples #Sample code -│ ├── include #Exposed header files -│ ├── packages #JavaScript implementation - │ ├── src #Source code -│ ├── targets #Configuration file of each target device - │ └── tools #Tool code -├── interfaces #APIs exposed externally -│ └── innerkits #Header files of internal subsystems -│ └── builtin #JavaScript third-party module APIs exposed by the JS application framework +│ ├── examples # Sample code +│ ├── include # Exposed header files +│ ├── packages # JavaScript implementation +│ ├── src # Source code +│ ├── targets # Configuration file of each target device +│ └── tools # Tool code +├── interfaces # APIs exposed externally +│ └── innerkits # Header files of internal subsystems +│ └── builtin # JavaScript third-party module APIs exposed by the JS application framework ``` ## Constraints -- Language version +- Language versions: - C++11 or later - - JavaScript ES5.1 or later + - JavaScript ES5.1 - Framework runtime memory consists of: - - Pre-allocated memory for running the JavaScript engine. The memory size is adjustable and depends on the complexity of the device application. Generally, 64 KB to 512 KB is recommended. - - Memory for the framework itself. For devices whose memory capacity exceeds 100 KB, the framework memory can be managed by a pre-allocated memory pool, which can be shared with the native UI framework. The memory pool manages objects and heap memory in a unified manner. + - Runtime memory for the JavaScript engine: The memory size is adjustable and depends on the complexity of the device application. Generally, 64 KB to 512 KB is recommended. + - Native memory for the framework itself: For devices whose memory capacity exceeds 100 KB, it is recommended that a pre-allocated memory pool be used for native memory management. The memory pool is shared with the native UI framework. -- The framework provides different specifications for various chip platforms and underlying OS capabilities. +- The framework provides different specifications for various chip platforms and underlying OS capabilities: - Cortex-M RAM and ROM - JavaScript engine memory pool: greater than 48 KB \(recommended\) - RAM: memory pool shared with the native UI \(recommended\). The size must be greater than 80 KB. - ROM: greater than 300 KB \(for the JS application framework and related subsystems, such as native UI and JavaScript engine\) - - Cortex-A RAM and ROM + - Cortex-A RAM/ROM - JavaScript engine memory pool: greater than 128 KB \(recommended\) - RAM: greater than 512 KB \(recommended\) - ROM: greater than 2 MB \(for the JS application framework and related subsystems, such as native UI and JavaScript engine\) @@ -53,7 +53,10 @@ The source code of the framework is stored in **/foundation/ace**. The followin ## Using targets -The implementation of the JS application framework consists of two parts: native and JavaScript. The native part is developed by C++ and is the main body of the framework. The JavaScript part supports the runtime environment of JavaScript files, and supports the interaction between the JavaScript runtime and native framework through some global functions or objects exposed to the JavaScript engine. +The implementation of the JS application framework consists of the following two parts: + +- Native part: The native part is developed in C++ and is the main body of the framework. +- JavaScript part: The JavaScript part supports the runtime environment of JavaScript files, and supports the interaction between the JavaScript runtime and native framework through some global functions or objects exposed to the JavaScript engine. The framework uses feature macros to customize function code to be compiled on different platforms. The feature macros are stored in header files in **foundation/ace/frameworks/lite/targets**. The directory structure is as follows: @@ -61,70 +64,74 @@ The framework uses feature macros to customize function code to be compiled on d /foundation/ace/frameworks/lite/targets ├── default/ │ └── acelite_config.h -├── linux/ #Linux environment configuration files +├── linux/ # Linux environment configuration files │ └── acelite_config.h -├── liteos_a/ #Environment configuration files for LiteOS Cortex-A +├── liteos_a/ # Environment configuration files for LiteOS Cortex-A │ └── acelite_config.h -├── liteos_m/ #Environment configuration files for LiteOS Cortex-M +├── liteos_m/ # Environment configuration files for LiteOS Cortex-M │ └── acelite_config.h ├── platform_adapter.cpp ├── platform_adapter.h -└── simulator/ #Simulator environment configuration files +└── simulator/ # Simulator environment configuration files └── win/ └── acelite_config.h* ``` When compiling for different platform targets, use the **acelite\_config.h** file in the corresponding platform directory. You can configure the header file searching path for compilation to locate the file to use. The following takes **ninja** and **cmake** build tools as examples: -ninja: +- ninja: -``` - if (hos_kernel_type == "liteos_a" || hos_kernel_type == "liteos_m" || - hos_kernel_type == "liteos_riscv") {// Select different header file searching paths based on the target kernel platform. - include_dirs += [ "targets/liteos-a" ] - } else if (hos_kernel_type == "linux") { - include_dirs += [ "targets/linux" ] - } -``` + ``` + if (ohos_kernel_type == "liteos_a" || ohos_kernel_type== "liteos_m" || + ohos_kernel_type == "liteos_riscv") { // Select different header file searching paths based on the target kernel platform. + include_dirs += [ "targets/liteos-a" ] + } else if (ohos_kernel_type == "linux") { + include_dirs += [ "targets/linux" ] + } + ``` -cmake: -``` -...... -set(ACE_LITE_CONFIG_PATH "${CMAKE_CURRENT_SOURCE_DIR}/targets/simulator/win") -set(JSFWK_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/include") -set(JSFWK_SOURCE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/core") -set(UIKIT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ui") -set(THIRTY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../third_party") -set(JSFWK_SIMULATOR_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../tools/simulator") -set(JS_API_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../api/emui_band/MoltenCore/application/framework/ace/api") -set(JSFWK_SIMULATOR_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../tools/simulator") -set(AAFWK_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../aafwk") - -# header files -include_directories( - ${ACE_LITE_CONFIG_PATH} - ${JSFWK_INCLUDE_PATH}/async - ${JSFWK_INCLUDE_PATH}/base - ${JSFWK_INCLUDE_PATH}/context - ${JSFWK_INCLUDE_PATH}/jsi - ${JSFWK_SOURCE_PATH} +- cmake: + + ``` ...... -``` + set(ACE_LITE_CONFIG_PATH "${CMAKE_CURRENT_SOURCE_DIR}/targets/simulator/win") # Set the simulator search path to targets/simulator/win. + set(JSFWK_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/include") + set(JSFWK_SOURCE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/core") + set(UIKIT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ui") + set(THIRTY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../third_party") + set(JSFWK_SIMULATOR_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../tools/simulator") + set(JS_API_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../api/emui_band/MoltenCore/application/framework/ace/api") + set(JSFWK_SIMULATOR_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../tools/simulator") + set(AAFWK_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../aafwk") + + # header files + include_directories( + ${ACE_LITE_CONFIG_PATH} + ${JSFWK_INCLUDE_PATH}/async + ${JSFWK_INCLUDE_PATH}/base + ${JSFWK_INCLUDE_PATH}/context + ${JSFWK_INCLUDE_PATH}/jsi + ${JSFWK_SOURCE_PATH} + ...... + ``` + The **acelite\_config.h** file is used to enable or disable the feature macros of different platforms. It can also be used to define constants for shielding platform differences. For example, platform file systems are different, and the names of some fixed directories might be different. These constants can be defined as follows: -**liteos-a/acelite\_config.h** +- liteos-a/acelite\_config.h -``` -#define JS_FRAMEWORK_PATH "//system/ace/bin/" -``` + ``` + #define JS_FRAMEWORK_PATH "//system/ace/bin/" + ``` -**simulator/win/acelite\_config.h** -``` -#define JS_FRAMEWORK_PATH "..\\..\\..\\jsfwk\\packages\\runtime-core\\build" -``` +- **simulator/win/acelite\_config.h** + + ``` + #define JS_FRAMEWORK_PATH "..\\..\\..\\jsfwk\\packages\\runtime-core\\build" + ``` + ## Using Runtime-core @@ -133,30 +140,30 @@ Runtime-core is a JavaScript-based simple data hijacking framework provided by t ``` /foundation/ace/frameworks/lite/packages └── runtime-core - ├── .babelrc #Babel configuration file - ├── .editorconfig #IDE configuration file - ├── .eslintignore #Configuration file of the ESLint tool. You can set a directory or files that will not be scanned by the ESLint tool. - ├── .eslintrc.js #ESLint configuration file for scanning rules. + ├── .babelrc # Babel configuration file + ├── .editorconfig # IDE configuration file + ├── .eslintignore # Configuration file of the ESLint tool. You can set a directory or files that will not be scanned by the ESLint tool. + ├── .eslintrc.js # ESLint configuration file for scanning rules ├── .gitignore - ├── package.json #NPM file - ├── package-lock.json #NPM dependency lock file - ├── .prettierrc #Configuration file for code formatting rules - ├── scripts #Directory for compilation scripts - │ ├── build.js #Compilation script - │ └── configs.js #Rollup configuration file + ├── package.json # NPM file + ├── package-lock.json # NPM dependency lock file + ├── .prettierrc # Configuration file for code formatting rules + ├── scripts # Directory for compilation scripts + │ ├── build.js # Compilation script + │ └── configs.js # Rollup configuration file ├── .size-snapshot.json - └── src #Source code - ├── core #ViewModel core implementation code + └── src # Source code + ├── core # ViewModel core implementation code │ └── index.js ├── index.js - ├── observer #Data hijacking implementation code + ├── observer # Data hijacking implementation code │ ├── index.js │ ├── observer.js │ ├── subject.js │ └── utils.js - ├── profiler #profiler directory + ├── profiler # profiler directory │ └── index.js - └── __test__ #Test cases + └── __test__ # Test cases └── index.test.js ``` @@ -164,7 +171,7 @@ The following NPM commands are supported: - **npm run build** - The JavaScript engine integrated in the JS application framework supports ES5.1 syntax only. However, the runtime-core is implemented using JavaScript ES6. Therefore, you should use Babel for ES6 code degradation and use Rollup to package the code. Run the **npm run build** command, and the packaged files are output to the **build** directory. + The JavaScript engine integrated in the JS application framework supports ES5.1 syntax only. However, the runtime-core is implemented using JavaScript ES6. Therefore, you should use Babel for syntax degradation and use Rollup to package the code. Run the **npm run build** command, and the packaged files are output to the **build** directory. ``` build/ diff --git a/docs-en/readme/kernel-subsystem.md b/docs-en/readme/kernel-subsystem.md index 032eef563c4f5690492c401f8ce6d96c4e909bd9..eef0aba845a9f7d693c8af7967e36774b6a6fc72 100755 --- a/docs-en/readme/kernel-subsystem.md +++ b/docs-en/readme/kernel-subsystem.md @@ -4,11 +4,13 @@ The OpenHarmony kernel is a real-time OS kernel developed by Huawei for IoT devices. It is as lightweight as RTOS and as easy-to-use as Linux. -The kernel repository is used to store the source code of the OpenHarmony kernel components, including process and thread scheduling, memory management, IPC mechanism, and timer management, as well as the version package compilation information. +The OpenHarmony kernel includes basic kernel functions such as process and thread scheduling, memory management, IPC mechanism, and timer management. + +The source code of the OpenHarmony kernel consists of two repositories: the [`kernel_liteos_a`](https://gitee.com/openharmony/kernel_liteos_a) repository for Cortex-A processors and the [`kernel_liteos_m`](https://gitee.com/openharmony/kernel_liteos_m) repository for Cortex-M processors. The directory structures of the two repositories are similar. The following describes the directory structure of kernel_liteos_a. ## Directory Structure -**Table 1** Directory structure of the OpenHarmony lightweight kernel source code +**Table 1** Directory structure of the OpenHarmony kernel source code

Development Tool

+ - - - - - - - - - - - - - - - - - - - - - - - @@ -152,6 +152,13 @@ The following table describes the common tools required for Linux and how to obt + + + +

Development Tool

Description

+

Description

How to Obtain

+

How to Obtain

Python3.7+

+

Python3.7+

Runs the compilation scripts.

+

Runs the compilation scripts.

https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz

+

https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz

bash

+

bash

Executes commands.

+

Executes commands.

Internet

+

Internet

gn

+

gn

Generates ninja compilation scripts.

+

Generates ninja compilation scripts.

http://tools.harmonyos.com/mirrors/gn/1523/linux/gn.1523.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/gn/1523/linux/gn.1523.tar

ninja

+

ninja

Executes ninja compilation scripts.

+

Executes ninja compilation scripts.

http://tools.harmonyos.com/mirrors/ninja/1.9.0/linux/ninja.1.9.0.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar

LLVM

+

LLVM

Functions as the compiler toolchain.

+

Functions as the compiler toolchain.

http://tools.harmonyos.com/mirrors/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar

hc-gen

+

hc-gen

Configures and compiles files.

+

Configures and compiles files.

http://tools.harmonyos.com/mirrors/hc-gen/0.65/linux/hc-gen-0.65-linux.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar

IPOP, PuTTY, or other HyperTerminal software

+

IPOP, PuTTY, or other HyperTerminal software

Connects to the Linux server (choose one of the terminals).

+

Connects to the Linux server (choose one of the terminals).

Internet (for example, https://www.putty.org/)

+

Internet (for example, https://www.putty.org/)

https://device.harmonyos.com/cn/ide

HiTool

+

Burns the images and the U-boot.

+

http://www.hihope.org/download

+
@@ -253,7 +260,7 @@ sudo ln -s /bin/bash /bin/sh ## Installing gn 1. Start a Linux server. -2. Download [gn](https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/latest). +2. Download [gn](https://repo.huaweicloud.com/harmonyos/compiler/gn/1523/linux/gn.1523.tar). 3. Decompress the **gn** installation package to the **tar -xvf gn.1523.tar -C \~/** in **\~/gn** directory. 4. Open the **\~/.bashrc** file in Vim and add a line of **export PATH=\~/gn:$PATH** to set an environment variable. 5. Run **source \~/.bashrc** to validate the environment variable. @@ -261,7 +268,7 @@ sudo ln -s /bin/bash /bin/sh ## Installing ninjah 1. Start a Linux server. -2. Download [ninja](https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-linux.zip). +2. Download [ninja](https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar). 3. Decompress the **ninja** installation package to **tar -xvf ninja.1.9.0.tar -C \~/** in **\~/ninja** directory. 4. Open the **\~/.bashrc** file in Vim and add a line of **export PATH=\~/ninja:$PATH** to set an environment variable. 5. Run **source \~/.bashrc** to validate the environment variable. @@ -269,7 +276,7 @@ sudo ln -s /bin/bash /bin/sh ## Installing the LLVM Toolchain 1. Start a Linux server. -2. Download [http://tools.harmonyos.com/mirrors/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar](http://tools.harmonyos.com/mirrors/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar). +2. Download [LLVM](http://tools.harmonyos.com/mirrors/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar). 3. Decompress the LLVM installation package to the **\~/llvm** path by running **"tar -xvf llvm-linux-9.0.0-34042.tar -C \~/"**. 4. Open the **\~/.bashrc** file in Vim and add a line of **export PATH=\~/llvm/bin:$PATH** to set an environment variable. 5. Run **source \~/.bashrc** to validate the environment variable. @@ -277,8 +284,8 @@ sudo ln -s /bin/bash /bin/sh ## Installing hc-gen 1. Start a Linux server. -2. Download [http://tools.harmonyos.com/mirrors/hc-gen/0.65/linux/hc-gen-0.65-linux.tar](http://tools.harmonyos.com/mirrors/hc-gen/0.65/linux/hc-gen-0.65-linux.tar). -3. Decompress the hc-gen installation package to the **\~/hc-gen** directory on the Linux server. +2. Download [hc-gen](https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar). +3. Decompress the hc-gen installation package to **tar -xvf hc-gen-0.65-linux.tar -C \~/** in **\~/hc-gen** on the Linux. 4. Open the **\~/.bashrc** file in Vim and add a line of **export PATH=\~/hc-gen:$PATH** to set an environment variable. 5. Run **source \~/.bashrc** to validate the environment variable. diff --git a/docs-en/readme/application-framework.md b/docs-en/readme/application-framework.md old mode 100755 new mode 100644 index 13bcf46ac37350cee9141ddad6c60eb8924544ad..4be927597534f1da62449ea6cedf10abaf33f249 --- a/docs-en/readme/application-framework.md +++ b/docs-en/readme/application-framework.md @@ -7,9 +7,9 @@ The application framework of OpenHarmony consists of two modules: **ability man **1. Ability management framework**: This framework is provided by OpenHarmony for you to develop OpenHarmony applications. The following figure shows the modules in the ability management framework. **Figure 1** Architecture of the Ability management framework -![](figures/architecture-of-the-ability-management-framework.png "architecture-of-the-ability-management-framework") +![](figures/en-us_image_0000001054941316.png) -- **AbilityKit** is a development kit provided by the ability management framework. You can use this kit to develop applications based on the **Ability** component. There are two types of applications developed based on the **Ability** component: **JS Ability** developed using the JavaScript language and **Native Ability** developed using the C/C++ language. The **ACE** framework encapsulates JavaScript UI components on the basis of the AbilityKit and is used to help you quickly develop JS Ability-based applications. +- **AbilityKit** is a development kit provided by the ability management framework. You can use this kit to develop applications based on the **Ability** component. There are two types of applications developed based on the **Ability** component: **JS Ability** developed using the JavaScript language and **Native Ability** developed using the C/C++ language. The **JS application development framework** encapsulates JavaScript UI components on the basis of the AbilityKit and is used to help you quickly develop JS Ability-based applications. - **Ability** is the minimum unit for the system to schedule applications. It is a component that can implement an independent functionality. An application can contain one or more **Ability** instances. There are two types of templates that you can use to create an **Ability** instance: Page and Service. - An **Ability using the Page template** \(Page ability for short\) provides a UI for interacting with users. - An **Ability using the Service template** does not have a UI and is used for running background tasks. @@ -80,7 +80,7 @@ The following table describes the source code directory structure of the applica

foundation/aafwk/frameworks/ability_lite

Core code of the ability management framework

+

Core code for AbilityKit

foundation/aafwk/frameworks/abilitymgr_lite

@@ -95,12 +95,12 @@ The following table describes the source code directory structure of the applica

foundation/aafwk/interfaces/kits/abilitykit_lite

External APIs of the ability management framework

+

APIs provided by AbilityKit for developers

foundation/aafwk/interfaces/innerkits/abilitymgr_lite

APIs provided by the Ability Manager Service to other subsystems

+

APIs provided by the Ability Manager Service for other subsystems

foundation/aafwk/interfaces/kits/want_lite

@@ -115,12 +115,12 @@ The following table describes the source code directory structure of the applica

foundation/appexecfwk/interfaces/kits/bundle_lite

External bundle management APIs provided by the bundle management framework

+

APIs provided by BundleKit for developers

foundation/appexecfwk/interfaces/innerkits/bundlemgr_lite

APIs provided by the Bundle Manager Service to other subsystems

+

Core code for AbilityKit and APIs provided by the Bundle Manager Service for other subsystems

foundation/appexecfwk/frameworks/bundle_lite

@@ -147,13 +147,13 @@ The following table describes the source code directory structure of the applica - C++11 or later - The specifications of the application framework vary depending on the System-on-a-Chip \(SoC\) and underlying OS capabilities. - - Cortex-M RAM and ROM: + - Cortex-M RAM and ROM - RAM: greater than 20 KB \(recommended\) - - ROM: greater than 300 KB \(for the ACE framework and related subsystems, such as UIKit and engine\) + - ROM: greater than 300 KB \(for the JS application development framework and related subsystems, such as UIKit and engine\) - Cortex-A RAM and ROM - RAM: greater than 2 MB \(recommended\) - - ROM: greater than 2 MB \(for the ACE framework and related subsystems, such as UIKit and engine\) + - ROM: greater than 2 MB \(for the JS application development framework and related subsystems, such as UIKit and engine\) @@ -231,7 +231,7 @@ The following table describes the source code directory structure of the applica - After the preceding configurations are complete, run the following command to compile the entire system: ``` -python build.py ipcamera -p hi3516dv300_liteos_a -b debug +python build.py ipcamera_hi3516dv300 -b debug ``` ## Running the Two Services in the Application Framework @@ -253,78 +253,93 @@ deps = [ ## Running an Ability Developed Based on AbilityKit -- The demo code of the ability developed based on AbilityKit is stored in the **foundation/aafwk/frameworks/kits/ability\_lite/test** directory. If you need to modify the functionality, modify the code in the **unittest** file or add a code file, and update the configuration in **BUILD.gn** accordingly. -- Run the following command in the shell to compile the demo. After the compilation is successful, the **libLauncher.so** file is generated in **out/ipcamera\_hi3516dv300\_liteos\_a**. +- The demo code of the ability developed based on AbilityKit is stored in the **foundation/aafwk/frameworks/ability\_lite/example** directory. If you need to modify the functionality, modify the code in the **entry/src/main/cpp** files or add a new code file, and update the configuration in **BUILD.gn** accordingly. +- Add the configuration for the ability demo for compilation in the **build/lite/config/subsystem/aafwk/BUILD.gn** file. ``` - python build.py ipcamera -p hi3516dv300_liteos_a -T //foundation/aafwk/frameworks/kits/ability_lite/test:Launcher + import("//build/lite/config/subsystem/lite_subsystem.gni") + + lite_subsystem("aafwk") { + subsystem_components = [ + "......", + "//foundation/aafwk/frameworks/ability_lite/example:hiability", + "......", + ] + } ``` -- Modify the **config.json** file. The example content is as follows: +- Run the following command in the shell to compile the demo. After the compilation is successful, the **libhiability.so** file is generated in **out/ipcamera\_hi3516dv300\_liteos\_a/dev\_tools/example**. -``` -{ - "app": { - "bundleName": "com.huawei.launcher", - "vendor": "huawei", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 3, - "target": 3 - } - }, - "deviceConfig": { - "default": { - "keepAlive": false - }, - }, - "module": { - "deviceType": [ - "smartVision" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "Launcher", - "moduleType": "entry" - }, - "abilities": [{ - "name": "MainAbility", - "icon": "assets/entry/resources/base/media/icon.png", - "label": "test app 1", - "launchType": "standard", - "type": "page", - "visible": true + ``` + python build.py ipcamera_hi3516dv300 -b debug + ``` + +- Compile the **config.json** file. For details, see the **config.json** file in the **foundation/aafwk/frameworks/ability\_lite/example** directory. The file content is as follows: + + ``` + { + "app": { + "bundleName": "com.huawei.hiability", + "vendor": "huawei", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 3, + "target": 3 + } }, - { - "name": "SecondAbility", - "icon": "assets/entry/resources/base/media/icon.png", - "label": "test app 2", - "launchType": "standard", - "type": "page", - "visible": true + "deviceConfig": { + "default": { + "keepAlive": false + }, }, - { - "name": "ServiceAbility", - "icon": "", - "label": "test app 2", - "launchType": "standard", - "type": "service", - "visible": true + "module": { + "deviceType": [ + "smartVision" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "hiability", + "moduleType": "entry" + }, + "abilities": [{ + "name": "MainAbility", + "icon": "assets/entry/resources/base/media/icon.png", + "label": "test app 1", + "launchType": "standard", + "type": "page", + "visible": true + }, + { + "name": "SecondAbility", + "icon": "", + "label": "test app 2", + "launchType": "standard", + "type": "page", + "visible": true + }, + { + "name": "ServiceAbility", + "icon": "", + "label": "test app 2", + "launchType": "standard", + "type": "service", + "visible": true + } + ] } - ] } -} -``` + ``` + - Generate a HAP. - Add resource files to the **assets/entry/resources/base/media** directory based on the following directory structure. - ![](figures/en-us_image_0000001055712348.png) + ![](figures/en-us_image_0000001055267336.png) - - Compress the preceding files into a ZIP package and change the file name extension to **.hap**, for example, **Launcher.hap**. + - Compress the preceding files into a ZIP package and change the file name extension to **.hap**, for example, **hiability.hap**. - Install the HAP. @@ -332,13 +347,13 @@ deps = [ - Run the following command to install the HAP: ``` - ./bin/bm install -p /nfs/hap/Launcher.hap + ./bin/bm install -p /nfs/hap/hiability.hap ``` - After the installation is complete, run the following command to run the demo: ``` -./bin/aa start -p com.huawei.launcher -n MainAbility +./bin/aa start -p com.huawei.hiability -n MainAbility ``` ## Repositories Involved diff --git a/docs-en/readme/distributed-scheduler.md b/docs-en/readme/distributed-scheduler.md index 799453b3065a685d200f972d83d30265e97473c9..28435bba82faf265731673538bb511a9d3733ae4 100755 --- a/docs-en/readme/distributed-scheduler.md +++ b/docs-en/readme/distributed-scheduler.md @@ -2,9 +2,9 @@ ## Overview -The Distributed Scheduler sets up a distributed service platform in OpenHarmony by using a proxy between the primary and secondary devices. With the distributed scheduler, the primary device \(OpenHarmony-powered smart TV\) can start a Feature Ability \(FA\) deployed on the secondary device \(a memory-constrained OpenHarmony device such as a lite wearable\). The following figure shows the components of the Distributed Scheduler. +The Distributed Scheduler is used for cross-device component management. It allows the local device to access or control remote components, and enables application collaboration in distributed scenarios. The following figure shows the modules in the Distributed Scheduler. -![](figures/en-us_image_0000001055199362.png) +![](figures/en-us_image_0000001055103250.png) ## Directory Structure @@ -21,17 +21,12 @@ The following table describes the directory structure of the Distributed Schedul

dtbschedmgr_lite

Implementation logic of the Distributed Scheduler

+

Implementation of the Distributed Scheduler

safwk_lite

Implementation logic of system service processes

-

samgr_lite

-

Implementation logic of local service management

+

Implementation of the foundation process

- - - - @@ -87,7 +84,7 @@ The kernel repository is used to store the source code of the OpenHarmony kernel ## Constraints -By default, the JFFS2 file system is used during system startup. This file system is read-write. If other file systems need to be used, the configurations of the file systems must be added accordingly. +Hi3518EV300 uses the JFFS2 file system by default, and Hi3516DV300 uses the VFAT file system by default. If other file systems need to be used, the configurations of the file systems must be added accordingly. ## Usage @@ -95,11 +92,11 @@ For details, see [Kernel Usage Guidelines](../kernel/Readme-EN.md). ## Repositories Involved -drivers\_liteos +[drivers_liteos](https://gitee.com/openharmony/drivers_liteos) -kernel\_liteos\_a +[kernel_liteos_a](https://gitee.com/openharmony/kernel_liteos_a) -kernel\_liteos\_a\_huawei\_proprietary\_fs\_proc +[kernel_liteos_a_huawei_proprietary_fs_proc](https://gitee.com/openharmony/kernel_liteos_a_huawei_proprietary_fs_proc) -kernel\_liteos\_m +[kernel_liteos_m](https://gitee.com/openharmony/kernel_liteos_m) diff --git a/docs-en/readme/security-subsystem.md b/docs-en/readme/security-subsystem.md index a0908cdfd7f270bb108d7a4302c36bc065c68a3b..d47af078c927dc5748cf4e5210f0ebcf1db7e8b2 100755 --- a/docs-en/readme/security-subsystem.md +++ b/docs-en/readme/security-subsystem.md @@ -6,8 +6,6 @@ This section provides samples about how to use existing security mechanisms to i ## Directory Structure -**Directory 1** - ``` security ├── framework @@ -31,18 +29,6 @@ security │ ├── secure_os Secure OS ``` -**Directory 2** - -``` -kernel/liteos-a/security/ -├── cap Capability mechanism -│ ├── BUILD.gn -│ ├── capability_api.h -│ ├── capability.c -│ ├── capability_type.h -│ └── Makefile -``` - ## Constraints C programming language is used. The preceding security features are mainly used on Cortex-A or devices with equivalent processing capabilities. On Cortex-M or devices with equivalent processing capabilities, only HUKS and HiChain are available. @@ -53,14 +39,9 @@ To generate a x509 image package, perform compilation to generate the required b ## Application Permission Management -Application permissions are used to control access to system resources and features. These include personal privacy-related features or data in some scenarios, for example, hardware features of personal devices such as cameras and microphones, and personal data such as contacts and calendar data. OpenHarmony protects such data and features through application permission management. +Application permissions are used to control access to system resources and features related to personal privacy, for example, accessing hardware features of personal devices such as cameras and microphones, and reading and writing media files. The OS protects such data and features through application permission management. -To declare the permissions required by an application, edit **req-permissions** in the **HarmonyProfile.json** file in the installation bundle. The following figure shows an example. - -**Figure 1** Declaring permissions -![](figures/declaring-permissions.png "declaring-permissions") - -Field descriptions +The following table describes fields in a permission.

Directory

@@ -72,14 +74,9 @@ The kernel repository is used to store the source code of the OpenHarmony kernel

System calls

test

-

Kernel and user-space test cases

-

tools

Code related to compilation configuration and menuconfig

+

Building tool as well as related configuration and code

@@ -104,46 +84,55 @@ Field descriptions ## IPC Authentication - If system services registered with Samgr provide APIs for other processes to access the services through IPC, access control policies must be configured; otherwise, access to the system services will be denied. -- You can configure access control policies in **base/security/services/iam\_lite/include/policy\_preset.h**. You need to configure the policy for each feature and then add the policies of features to the global policy. +- You can configure access control policies in **base/security/services/iam\_lite/ipc\_auth/include/policy\_preset.h**. + + 1. Define the policies for each feature. + + 2. Add the feature policies to the global policy. + For example, to configure an access policy for the BMS service, whose service registered with Samgr is **bundlems** and whose registered feature is **BmsFeature**, perform the following operations: -1. Define the feature policy. You can configure multiple features and configure multiple access policies for each feature. +1. Define feature policies. You can configure multiple features and configure multiple access policies for each feature. + +**Figure 1** Example feature policy + -**Figure 2** Example feature policy -![](figures/example-feature-policy.png "example-feature-policy") +![](figures/bms策略举例.png) There are three types of access policies: -**Figure 3** Access policy structure -![](figures/access-policy-structure.png "access-policy-structure") +**Figure 2** Access policy structure + + +![](figures/策略类型2.png) - **RANGE**: Processes with a UID within a specified range are allowed to access **BmsFeature**. **uidMin** and **uidMax** need to be specified. - **FIXED**: Processes with specified UIDs are allowed to access **BmsFeature**. **fixedUid** needs to be specified. A maximum number of eight UIDs can be configured. - **BUNDLENAME**: Only a specified application is allowed to access **BmsFeature**. **bundleName** needs to be specified. -2. Add the defined feature policy to the global policy. You need to configure the number of features. +2. Add the defined feature policies to the global policy. You need to configure the number of features. -**Figure 4** Registering a feature policy -![](figures/registering-a-feature-policy.png "registering-a-feature-policy") +**Figure 3** Registering a feature policy + + +![](figures/全局策略2.png) UID allocation rules: -Init/foundation process: 0 +1. Init process: 0 appspawn process: 1 Shell process: 2 -kitfw process: 3 +4. Other built-in system services: less than or equal to 99 -Other built-in services: 4–99 +5. System applications \(such as settings, home screen, and camera\): 100–999 -System applications \(such as settings\): 100–999 +6. Preset applications: 1000–9999 -Preset applications \(such as Wallet and Taobao\): 1000–9999 - -Common third-party applications: 10000 to **INT\_MAX** +7. Common third-party applications: 10000 to **INT\_MAX** ## HUKS @@ -193,7 +182,7 @@ When an IoT controller and an IoT device communicate with each other after estab ## Application Signature Verification -To ensure the integrity of application content, HarmonyOS uses application signatures and profiles to manage application sources. Only pre-installed applications and applications from HUAWEI AppGallery can be installed on devices. +To ensure the integrity of application content, OpenHarmony uses application signatures and profiles to manage application sources. Only pre-installed applications and applications from HUAWEI AppGallery can be installed on devices. **Basic Concepts** @@ -232,20 +221,19 @@ Unique identifier of an application, which consists of the application bundle na - **Application debugging scenario** -To develop and debug applications for HarmonyOS devices, you need to apply for becoming an authorized application developer on HUAWEI AppGallery. You need to generate a public/private key pair and upload the public key to HUAWEI AppGallery. HUAWEI AppGallery creates a developer certificate based on your identity information and the uploaded public key, and issues the certificate through the developer certificate CA. You also need to upload the application information and debugging device ID for creating an application debugging profile, which contains the HUAWEI AppGallery signature and cannot be tampered with. Upon obtaining the developer certificate and application debugging profile, you can install and debug applications signed with the private key on a specified HarmonyOS device. +To develop and debug applications for OpenHarmony devices, you need to apply for becoming an authorized application developer on HUAWEI AppGallery. You need to generate a public/private key pair and upload the public key to HUAWEI AppGallery. HUAWEI AppGallery creates a developer certificate based on your identity information and the uploaded public key, and issues the certificate through the developer certificate CA. You also need to upload the application information and debugging device ID for creating an application debugging profile, which contains the HUAWEI AppGallery signature and cannot be tampered with. Upon obtaining the developer certificate and application debugging profile, you can install and debug applications signed with the private key on a specified OpenHarmony device. -The application installation service of HarmonyOS verifies the application signature to ensure application integrity. In addition, the service verifies the developer certificate, application debugging profile, and the mapping between them to ensure the validity of your identity and the application. +The application installation service of OpenHarmony verifies the application signature to ensure application integrity. In addition, the service verifies the developer certificate, application debugging profile, and the mapping between them to ensure the validity of your identity and the application. ![](figures/en-us_image_0000001051282241.png) - **Application publishing** - To publish applications in HUAWEI AppGallery, you need to use the application publishing certificate and profile issued by HUAWEI AppGallery to sign the applications. As shown in the following figure, the procedure of applying for the application publishing certificate and profile is similar to that of applying for the developer certificate and application debugging profile \(you can use the same public/private key pair\). Applications signed by the application publishing certificate cannot be directly installed on devices. Instead, the applications must be published in HUAWEI AppGallery for review. After the applications are reviewed and approved, HUAWEI AppGallery uses the publishing certificate to re-sign the applications. The re-signed applications can be downloaded and installed by users. - - The application installation service of HarmonyOS verifies the application signature to ensure application integrity. In addition, the service checks whether the signature certificate is from HUAWEI AppGallery to ensure that the application is trusted. +To publish applications in HUAWEI AppGallery, you need to use the application publishing certificate and profile issued by HUAWEI AppGallery to sign the applications. As shown in the following figure, the procedure of applying for the application publishing certificate and profile is similar to that of applying for the developer certificate and application debugging profile \(you can use the same public/private key pair\). Applications signed by the application publishing certificate cannot be directly installed on devices. Instead, the applications must be published in HUAWEI AppGallery for review. After the applications are reviewed and approved, HUAWEI AppGallery uses the publishing certificate to re-sign the applications. The re-signed applications can be downloaded and installed by users. - ![](figures/en-us_image_0000001051562162.png) +The application installation service of OpenHarmony verifies the application signature to ensure application integrity. In addition, the service checks whether the signature certificate is from HUAWEI AppGallery to ensure that the application is trusted. +![](figures/en-us_image_0000001051562162.png) ## Repositories Involved diff --git a/docs-en/readme/testing-subsystem.md b/docs-en/readme/testing-subsystem.md index bb2f779f1cf101b84231dbcad536c875cd9d7a40..6b1947fe865c3758e6dab3ef0051f6dba565262c 100755 --- a/docs-en/readme/testing-subsystem.md +++ b/docs-en/readme/testing-subsystem.md @@ -2,11 +2,11 @@ ## Overview -The test-driven development mode is used during the development process. You can develop new cases or modify existing cases to test new or enhanced system features. The self-test helps you develop high-quality code in the development phase. +The test-driven development mode is used during the development process. You can develop new cases or modify existing cases to test new or enhanced system features. The test helps you develop high-quality code in the development phase. ## Directory Structure -**Table 1** Directory structure of the source code for self-test tools +**Table 1** Directory structure of the source code for test tools

Field

@@ -83,7 +64,6 @@ Field descriptions

Multi-language string ID

Purpose of requesting the permission.

-

The purposes include reviewing requests for publishing applications, pop-up authorization, and permission management by users.

used-scene{

@@ -95,7 +75,7 @@ Field descriptions

when: inuse and always

Scene where the APIs controlled by this permission are called.

-

This field declares the components that call the APIs controlled by this permission and whether the APIs are called from the foreground or from both the foreground and background.

+

This field declares what components can call the APIs controlled by this permission in the specified scene (foreground/background).

- - - @@ -136,7 +136,7 @@ Install the serial port plugins **pyserial** and **readline** on the local P ## Compiling Test Cases -- Self-test case specifications +- Test case specifications - Naming rules The source file name of the test case must be consistent with the test suite content. The relationship between the test suite and the test case is 1:N and the test suite and the test source file is 1:1. Each source file is globally unique and named in the format of \[Feature\]\_\[Function\]\_\[Subfunction 1\]\_\[Subfunction 1.1\]. Subfunctions can be further divided. @@ -145,18 +145,18 @@ Install the serial port plugins **pyserial** and **readline** on the local P - Test case coding specifications - The self-test cases must comply with the feature code coding specifications. In addition, necessary case description information must be added. For details, see [\#li2069415903917](#li2069415903917). + The test cases must comply with the feature code coding specifications. In addition, necessary case description information must be added. For details, see [\#li2069415903917](#li2069415903917). - Test case compilation and configuration specifications The test cases are compiled in GN mode. The configuration must comply with the compilation guide of the open source project. For details, see [en-us\_topic\_0000001051580775.md](en-us_topic_0000001051580775.md). -- Self-test case template +- Test case template For details, see the test case **demo** developertest/example/cxx\_demo/test/unittest/common/calc\_subtraction\_test.cpp. - >![](public_sys-resources/icon-note.gif) **NOTE:** + >![](public_sys-resources/icon-note.gif) **NOTE:** >Feature: Description of the tested feature >Function: Function of the tested feature >SubFunction: Subfunction of the tested feature @@ -165,7 +165,7 @@ Install the serial port plugins **pyserial** and **readline** on the local P >CaseDescription: Test case description >step: Procedure for executing the test case when the complex logic is tested -- Directory plan for self-test cases +- Directory plan for test cases ``` subsystem (subsystem, system component) @@ -188,21 +188,21 @@ Install the serial port plugins **pyserial** and **readline** on the local P ├── common ├── liteos ├── linux - + ``` - >![](public_sys-resources/icon-note.gif) **NOTE:** + >![](public_sys-resources/icon-note.gif) **NOTE:** >The LiteOS and Linux are used as examples only for different device models. For the same feature on different development boards, if the test cases are the same, they are stored in the **common** directory. For the same feature, if the test cases are used to distinguish different device models and may include kernel differences and chip platform differences, the test cases are distinguished by directory. -- Procedure for compiling self-test cases - 1. Add the comment information of the case header file. +- Procedure for compiling test cases + 1. Add comments to the test case header file. 2. Reference the **gtest** header file and **ext** namespace. 3. Add the header file to test. 4. Define test suites \(test classes\). 5. Implement specific test cases of the test suite, including test case comments and logic implementation. 6. Compile the test case compilation configuration. - >![](public_sys-resources/icon-note.gif) **NOTE:** + >![](public_sys-resources/icon-note.gif) **NOTE:** >\* Example: developertest/example/cxx\_demo/test/unittest/common/calc\_subtraction\_test.cpp >Notes: >- **SetUp** and **TearDown** are the processing logic before and after each test case in the test suite is executed. @@ -213,26 +213,26 @@ Install the serial port plugins **pyserial** and **readline** on the local P - Compile a test case compilation file. - Define test case compilation and building objectives. - 1. Add comments to the case compilation header file. + 1. Add comments to the test case compilation header file. 2. Import the test case compilation template file. 3. Specify the output path of the test case file. 4. Configure the directory contained in the test case compilation dependency. - 5. Specify the name of the case execution file generated by the case compilation target. + 5. Specify the file name generated by the test case compilation target. 6. Compile a specific test case compilation script and add the source files, configurations, and dependencies involved in the compilation. - 7. Group the target case files by condition. The group name is fixed to **unittest/moduletest**. + 7. Group the target test case files by condition. The group name is fixed to **unittest/moduletest**. - If there are multiple test suites, define the common compilation configuration. - Add test cases to the build system. - >![](public_sys-resources/icon-note.gif) **NOTE:** + >![](public_sys-resources/icon-note.gif) **NOTE:** >\* Example: developertest/example/cxx\_demo/test/unittest/common/BUILD.gn - Test case level definition - - Basic \(Level 1\): < 1s - - Major \(Level 2\): < 10s - - Minor \(Level 3\): < 5 min - - Uncommon \(Level 4\): \> 5 min + - Basic \(Level 1\) + - Major \(Level 2\) + - Minor \(Level 3\) + - Uncommon \(Level 4\) ## Using Test Framework @@ -292,7 +292,7 @@ Install the serial port plugins **pyserial** and **readline** on the local P ``` -- Check the environment before executing the self-test cases. +- Check the environment before executing the test cases. - The system image and file system have been burnt to a development board and are running properly on the development board. In system mode, for example, the device prompt **OHOS\#** is displayed during shell login. - The development host is properly connected to the serial port of the development board, and the development host is properly connected to the serial port of the development board. - The IP addresses of the development host and development board are in the same network segment and can ping each other. @@ -318,25 +318,29 @@ Install the serial port plugins **pyserial** and **readline** on the local P Configure device models based on the actual development board, for example, **developertest/src/core/resource/config/framework\_config.xml**. - Run the test command. - 1. The following example shows how to run the test command. **-t ut** is mandatory, and **-ss** and **-tm** are optional. + 1. To query the subsystems, modules, product forms, and test types supported by test cases, run the **show** command. + + ``` + usage: + show productlist Querying Supported Product Forms + show typelist Querying the Supported Test Type + show subsystemlist Querying Supported Subsystems + show modulelist Querying Supported Modules + ``` + + 2. The following example shows how to run the test command. **-t** is mandatory, and **-ss** and **-tm** are optional. ``` run -t ut -ss test -tm example ``` - 2. Specify the parameters that can be used to execute the test suite corresponding to a specific feature or module. + 3. Specify the parameters that can be used to execute the test suite corresponding to a specific feature or module. ``` - usage: __main__.py [-h] [-p PRODUCTFORM] [-t [TESTTYPE [TESTTYPE ...]]] + usage: run [-h] [-p PRODUCTFORM] [-t [TESTTYPE [TESTTYPE ...]]] [-ss SUBSYSTEM] [-tm TESTMODULE] [-ts TESTSUIT] - [-tc TESTCASE] [-tl TESTLEVEL] [-os TARGET_OS_NAME] - [-bv BUILD_VARIANT] [-b [BUILD [BUILD ...]]] - [-cov COVERAGE] [-tf TESTFILE] [-res RESOURCE] - [-sn DEVICE_SN] [-c CONFIG] [-rp REPORTPATH] [-e EXECTYPE] - [-td TEST_DRIVER] - action Specify test para.positional arguments: - action Specify action - + [-tc TESTCASE] [-tl TESTLEVEL] + optional arguments: -h, --help show this help message and exit -p PRODUCTFORM, --productform PRODUCTFORM Specified product form @@ -347,16 +351,6 @@ Install the serial port plugins **pyserial** and **readline** on the local P -ts TESTSUIT, --testsuit TESTSUIT Specify test suit -tc TESTCASE, --testcase TESTCASE Specify test case -tl TESTLEVEL, --testlevel TESTLEVEL Specify test level - -bv BUILD_VARIANT, --build_variant BUILD_VARIANT Specify build variant(release,debug) - -b [BUILD [BUILD ...]], --build [BUILD [BUILD ...]] - Specify build values(version,testcase) - -tf TESTFILE, --testfile TESTFILE Specify test suites list file - -res RESOURCE, --resource RESOURCE Specify test resource - -sn DEVICE_SN, --device_sn DEVICE_SN Specify device serial number - -c CONFIG, --config CONFIG Specify test config file - -rp REPORTPATH, --reportpath REPORTPATH Specify test report path - -e EXECTYPE, --exectype EXECTYPE Specify test execute type - -td TEST_DRIVER, --testdriver TEST_DRIVER Specify test driver id ``` @@ -371,7 +365,7 @@ Install the serial port plugins **pyserial** and **readline** on the local P - Exit the self-test platform. - - Run the following command to exit the self-test platform: + - Run the following command to exit the test platform: ``` quit diff --git a/docs-en/readme/utils-library.md b/docs-en/readme/utils-library.md index f1a779ea0fbeb6ecc7f7f36055058385d47360fc..e825caf83791854ea29892aebb240490d234004b 100755 --- a/docs-en/readme/utils-library.md +++ b/docs-en/readme/utils-library.md @@ -6,40 +6,40 @@ The Utils library stores basic components of OpenHarmony. These basic components The Utils library provides the following capabilities on different platforms: -- LiteOS-M platform: KV stores, file operations, timers, and IoT peripheral control -- LiteOS-A platform: KV stores, timers, and ACE JavaScript APIs +- LiteOS Cortex-M \(Hi3861 platform\): KV stores, file operations, timers, and IoT peripheral control +- LiteOS Cortex-A \(Hi3516 and Hi3518 platforms\): KV stores, timers, and ACE JavaScript APIs ## Directory Structure ``` -utils/native/lite/ # Root directory of the Utils library -├── file # Implementation of the file interface -├── hals # HAL directory -│ └── file # Header files of the hardware abstraction layer for file operations -├── include # Files of external interfaces provided by the Utils library +utils/native/lite/ # Root directory of the Utils library +├── file # Implementation of the file interface +├── hals # HAL directory +│ └── file # Header files of the hardware abstraction layer for file operations +├── include # Files of external interfaces provided by the Utils library ├── js # ACE JavaScript API directory │ └── builtin │ ├── common │ ├── deviceinfokit # Device information kit │ ├── filekit # File kit │ └── kvstorekit # KV store kit -├── kal # KAL directory -│ └── timer # KAL implementation of the timer - ├── kv_store # KV store implementation -│ ├── innerkits # Internal KV store interfaces -│ └── src # KV store source file -└── timer_task # Timer implementation - -base/iot_hardware # IoT peripheral control +├── kal # KAL directory +│ └── timer # KAL implementation of the timer +├── kv_store # KV store implementation +│ ├── innerkits # Internal KV store interfaces +│ └── src # KV store source file +└── timer_task # Timer implementation + +base/iot_hardware # IoT peripheral control ├── frameworks -│ └── wifiiot_lite # Implementation of the IoT peripheral control module +│ └── wifiiot_lite # Implementation of the IoT peripheral control module ├── hals -│ └── wifiiot_lite # HAL interfaces +│ └── wifiiot_lite # HAL interfaces └── interfaces - └── kits # Interfaces of the IoT peripheral control module + └── kits # Interfaces of the IoT peripheral control module vendor/hisi/hi3861/hi3861_adapter/hals/iot_hardware # HAL for IoT peripheral control -└── wifiiot_lite # Implementation of the interfaces at the HAL +└── wifiiot_lite # Implementation of the interfaces at the HAL ``` ## Constraints @@ -61,7 +61,7 @@ The Utils library is developed using the C language. - @@ -70,7 +70,7 @@ The Utils library is developed using the C language. - @@ -79,7 +79,7 @@ The Utils library is developed using the C language. - @@ -88,7 +88,7 @@ The Utils library is developed using the C language. - @@ -101,12 +101,12 @@ The Utils library is developed using the C language. - **KV store** - Obtaining an interface - ``` + Obtaining an interface char key1[] = "rw.sys.version"; char value1[32] = {0}; int ret = UtilsGetValue(key1, value1, 32); + Setting the interface char key14[] = "key_14"; ret = UtilsSetValue(key14, defValue); @@ -121,10 +121,12 @@ The Utils library is developed using the C language. printf("file handle = %d\n", fd); int ret = UtilsFileWrite(fd, def, strlen(def)); printf("write ret = %d\n", ret); + // stat int fileLen = 0; ret = UtilsFileStat(fileName, &fileLen); printf("file size = %d\n", fileLen); + // seek int fd1 = UtilsFileOpen(fileName, O_RDWR_FS, 0); ret = UtilsFileSeek(fd1, 5, SEEK_SET_FS); @@ -133,6 +135,7 @@ The Utils library is developed using the C language. int readLen = UtilsFileRead(fd1, buf, 32); ret = UtilsFileClose(fd1); printf("read len = %d : buf = %s\n", readLen, buf); + // delete ret = UtilsFileDelete(fileName); printf("delete ret = %d\n", ret); diff --git "a/get-code/\346\272\220\347\240\201\350\216\267\345\217\226.md" "b/get-code/\346\272\220\347\240\201\350\216\267\345\217\226.md" index 4a9dbd455c5876eb87fa60ac32eb9858a0a72127..b2696931356e94f651f6dd60d56e217cdd6e6b31 100755 --- "a/get-code/\346\272\220\347\240\201\350\216\267\345\217\226.md" +++ "b/get-code/\346\272\220\347\240\201\350\216\267\345\217\226.md" @@ -36,16 +36,16 @@ OpenHarmony是HarmonyOS的开源版,由华为捐赠给开放原子开源基金 - - - @@ -54,25 +54,25 @@ OpenHarmony是HarmonyOS的开源版,由华为捐赠给开放原子开源基金 - - - - - @@ -234,13 +234,13 @@ OpenHarmony是HarmonyOS的开源版,由华为捐赠给开放原子开源基金 方式一(推荐):通过repo下载 ``` -repo init -u https://gitee.com/openharmony/manifest.git -b master +repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify repo sync -c ``` 方式二:通过git clone单个代码仓库 -进入代码仓库主页:[https://gitee.com/openharmony](https://gitee.com/openharmony),选择需要克隆的代码仓库,执行命令,如: +进入代码仓库主页:https://gitee.com/openharmony,选择需要克隆的代码仓库,执行命令,如: ``` git clone https://gitee.com/openharmony/manifest.git -b master diff --git "a/get-code/\350\216\267\345\217\226\345\267\245\345\205\267.md" "b/get-code/\350\216\267\345\217\226\345\267\245\345\205\267.md" index 007211fe4331a40176d812912a5ec7a01e7f01a6..820fc481049f43773ceac25d13dc7d9024f12e47 100755 --- "a/get-code/\350\216\267\345\217\226\345\267\245\345\205\267.md" +++ "b/get-code/\350\216\267\345\217\226\345\267\245\345\205\267.md" @@ -21,7 +21,7 @@ - @@ -30,7 +30,7 @@ - @@ -39,7 +39,7 @@ - @@ -48,7 +48,7 @@ - @@ -57,7 +57,7 @@ - diff --git "a/guide/\347\244\272\344\276\213\345\274\200\345\217\221.md" "b/guide/\347\244\272\344\276\213\345\274\200\345\217\221.md" index ac7f0267fc7d340b8705fd082595789a4e5335e7..02a8888db1eea3313a4dec00aa714d84e40060e2 100755 --- "a/guide/\347\244\272\344\276\213\345\274\200\345\217\221.md" +++ "b/guide/\347\244\272\344\276\213\345\274\200\345\217\221.md" @@ -1,6 +1,6 @@ # 示例开发 -相机开发基本概念可参考:[相机开发概述](zh-cn_topic_0000001051690589.md)。 +相机开发基本概念可参考:[相机开发概述](../subsystems/相机开发概述.md)。 若开发者想先查看示例效果,可先跳过本节,进入[应用实例](应用实例.md)。如需自定义应用行为,可参考本节描述对示例代码进行修改。 diff --git "a/quick-start/Hi3861\345\274\200\345\217\221\346\235\277\347\254\254\344\270\200\344\270\252\347\244\272\344\276\213\347\250\213\345\272\217.md" "b/quick-start/Hi3861\345\274\200\345\217\221\346\235\277\347\254\254\344\270\200\344\270\252\347\244\272\344\276\213\347\250\213\345\272\217.md" index 076e5b7d9334ff3373744047e559eaa9ea5d734d..38f43f223e4217d404ce2c9e1334474df683179d 100755 --- "a/quick-start/Hi3861\345\274\200\345\217\221\346\235\277\347\254\254\344\270\200\344\270\252\347\244\272\344\276\213\347\250\213\345\272\217.md" +++ "b/quick-start/Hi3861\345\274\200\345\217\221\346\235\277\347\254\254\344\270\200\344\270\252\347\244\272\344\276\213\347\250\213\345\272\217.md" @@ -4,7 +4,7 @@ ## 源码获取 -开发者需要在Linux服务器上下载一套源代码,获取Hi3861源码([下载链接](http://tools.harmonyos.com/mirrors/os/1.0/code-1.0.tar.gz))。更多源码获取方式,请见[源码获取](../get-code/源码获取.md)。 +开发者需要在Linux服务器上下载一套源代码,获取Hi3861源码([下载链接](https://repo.huaweicloud.com/harmonyos/os/1.0/code-1.0.tar.gz))。更多源码获取方式,请见[源码获取](../get-code/源码获取.md)。 ## 源码编译 @@ -66,7 +66,7 @@ Hi3861 WLAN模组的镜像烧录可以通过OpenHarmony IDE工具DevEco完成, 1. 在Baud rate中选择合适的波特率,波特率越高烧写速度越快,此处建议使用921600。 2. 在Data bit中选择数据位,WLAN模组默认为8,此处与其保持一致即可。 - 3. 选择版本包路径“./out/wifiiot/Hi3861\_wifiiot\_app\_allinone.bin”。 + 3. 选择版本包路径“./out/wifiiot/Hi3861\_wifiiot\_app\_allinone.bin”,选择Mode为“Hiburn”。 4. 点击Save保存配置。 **图 8** 波特率和数据位配置示意图 @@ -75,7 +75,7 @@ Hi3861 WLAN模组的镜像烧录可以通过OpenHarmony IDE工具DevEco完成, **图 9** 烧录包路径示意图 - ![](figures/zh-cn_image_0000001054087868.png) + ![](figures/zh-cn_image_0000001055427138.png) 4. 在DecEco工具界面中单击“烧录”按钮![](figures/zh-cn_image_0000001054443694.png),然后选择烧录串口“COM11”。 @@ -97,24 +97,34 @@ Hi3861 WLAN模组的镜像烧录可以通过OpenHarmony IDE工具DevEco完成, ## WLAN模组联网 -完成版本构建及烧录后,下面开始介绍如何在DevEco的串口终端上执行AT命令,使WLAN模组联网。 +完成版本构建及烧录后,下面开始介绍如何在串口终端上执行AT命令,使WLAN模组联网。 -1. 保持Windows工作台和WLAN模组的连接状态,在DevEco工具最下方,点击“Serial port”按钮,弹出串口终端的配置界面。 +>![](public_sys-resources/icon-note.gif) **说明:** +>- DevEco串口连接功能待上线,敬请期待。 +>- 该样例中使用IPOP(或其他)串口工具进行演示,IPOP工具请开发者通过互联网获取。 - **图 13** 打开DevEco串口终端示意图 - ![](figures/打开DevEco串口终端示意图.png "打开DevEco串口终端示意图") +1. 通过USB线,连接Windows工作台和Hi3861开发板,确认待连接串口为COM11,如下图所示。 -2. 选择串口,并完成参数配置。根据实际情况输入串口号,此处为“COM11”;波特率、数据位、停止位使用默认值;由于AT命令输入需要以“\\r\\n”结尾,否则输入无效,所以结束符处输入“1”。 + **图 13** 设备管理器的COM示意图 + + + ![](figures/zh-cn_image_0000001055268090.png) + +2. 在Windows工作台上,使用IPOP工具,连接WLAN模组串口(COM11),并配置好波特率115200,同时勾选Newline,确保输入字符串以"\\r\\n"结尾,避免AT命令无法输入。 + + **图 14** IPOP连接配置示意图 + + + ![](figures/zh-cn_image_0000001055427946.png) - **图 14** 串口参数配置示意图 - ![](figures/串口参数配置示意图.png "串口参数配置示意图") +3. 复位WLAN模组,终端界面显示“ready to OS start”,则启动成功。 -3. 复位WLAN模组,观察到终端界面“ready to OS start”日志打印,启动成功。 + **图 15** WLAN复位成功示意图 + - **图 15** 复位WLAN模组示意图 - ![](figures/复位WLAN模组示意图.png "复位WLAN模组示意图") + ![](figures/zh-cn_image_0000001055148043.png) -4. 在DevEco的串口终端,依次执行如下AT命令,完成启动STA,连接指定AP,开启dhcp。 +4. 在IPOP串口终端中,依次执行如下AT命令,启动STA模式,连接指定AP热点,并开启DHCP功能。 ``` AT+STARTSTA - 启动STA模式 @@ -125,9 +135,16 @@ Hi3861 WLAN模组的镜像烧录可以通过OpenHarmony IDE工具DevEco完成, AT+DHCP=wlan0,1 - 通过DHCP向AP请求wlan0的IP地址 ``` -5. 接口已分配IP,并与网关联通正常。 +5. 查看WLAN模组与网关联通是否正常,如下图所示。 + + ``` + AT+IFCFG - 查看模组接口IP + AT+PING=X.X.X.X - 检查模组与网关的联通性,其中X.X.X.X需替换为实际的网关地址 + ``` + + **图 16** WLAN模组联网成功示意图 + - **图 16** WLAN模组联网成功示意图 - ![](figures/WLAN模组联网成功示意图.png "WLAN模组联网成功示意图") + ![](figures/zh-cn_image_0000001055428072.png) diff --git "a/quick-start/figures/HiTool\345\267\245\345\205\267U-boot\347\203\247\345\206\231\345\256\214\346\210\220\344\270\262\345\217\243\346\230\276\347\244\272-4.png" "b/quick-start/figures/HiTool\345\267\245\345\205\267U-boot\347\203\247\345\206\231\345\256\214\346\210\220\344\270\262\345\217\243\346\230\276\347\244\272-4.png" new file mode 100644 index 0000000000000000000000000000000000000000..4e2a2794e63f64341e448313968b6f82d237543d Binary files /dev/null and "b/quick-start/figures/HiTool\345\267\245\345\205\267U-boot\347\203\247\345\206\231\345\256\214\346\210\220\344\270\262\345\217\243\346\230\276\347\244\272-4.png" differ diff --git "a/quick-start/figures/HiTool\345\267\245\345\205\267U-boot\347\203\247\345\206\231\345\256\214\346\210\220\344\270\262\345\217\243\346\230\276\347\244\272.png" "b/quick-start/figures/HiTool\345\267\245\345\205\267U-boot\347\203\247\345\206\231\345\256\214\346\210\220\344\270\262\345\217\243\346\230\276\347\244\272.png" index 4e2a2794e63f64341e448313968b6f82d237543d..ad4fd618860ca9f79e9bdc39436c3b2f9cdb72de 100755 Binary files "a/quick-start/figures/HiTool\345\267\245\345\205\267U-boot\347\203\247\345\206\231\345\256\214\346\210\220\344\270\262\345\217\243\346\230\276\347\244\272.png" and "b/quick-start/figures/HiTool\345\267\245\345\205\267U-boot\347\203\247\345\206\231\345\256\214\346\210\220\344\270\262\345\217\243\346\230\276\347\244\272.png" differ diff --git a/quick-start/figures/zh-cn_image_0000001055148043.png b/quick-start/figures/zh-cn_image_0000001055148043.png new file mode 100644 index 0000000000000000000000000000000000000000..d8f0f95d6e464a7af8e81ef8466fedd7f760a75d Binary files /dev/null and b/quick-start/figures/zh-cn_image_0000001055148043.png differ diff --git a/quick-start/figures/zh-cn_image_0000001055268090.png b/quick-start/figures/zh-cn_image_0000001055268090.png new file mode 100644 index 0000000000000000000000000000000000000000..dfc4a7bd9438664d3fe1cade7738ba72e68c586d Binary files /dev/null and b/quick-start/figures/zh-cn_image_0000001055268090.png differ diff --git a/quick-start/figures/zh-cn_image_0000001055427138.png b/quick-start/figures/zh-cn_image_0000001055427138.png new file mode 100644 index 0000000000000000000000000000000000000000..8c1b5d1af9f49d9d8a00602e0a658fcb6123cd71 Binary files /dev/null and b/quick-start/figures/zh-cn_image_0000001055427138.png differ diff --git a/quick-start/figures/zh-cn_image_0000001055427946.png b/quick-start/figures/zh-cn_image_0000001055427946.png new file mode 100644 index 0000000000000000000000000000000000000000..c25b5c13128538f063fe0875c66191fe88802590 Binary files /dev/null and b/quick-start/figures/zh-cn_image_0000001055427946.png differ diff --git a/quick-start/figures/zh-cn_image_0000001055428072.png b/quick-start/figures/zh-cn_image_0000001055428072.png new file mode 100644 index 0000000000000000000000000000000000000000..3e305a77258d959459ee9a052d17edf0669314cc Binary files /dev/null and b/quick-start/figures/zh-cn_image_0000001055428072.png differ diff --git "a/quick-start/figures/\344\277\256\346\224\271\344\270\262\345\217\243\345\217\267\345\233\276\347\244\272-3.png" "b/quick-start/figures/\344\277\256\346\224\271\344\270\262\345\217\243\345\217\267\345\233\276\347\244\272-3.png" new file mode 100644 index 0000000000000000000000000000000000000000..f699204d10d39eb088c0ecc7aa08ba134ec4b6b6 Binary files /dev/null and "b/quick-start/figures/\344\277\256\346\224\271\344\270\262\345\217\243\345\217\267\345\233\276\347\244\272-3.png" differ diff --git "a/quick-start/figures/\346\234\252\345\221\275\345\220\215\345\233\276\347\211\20711111.png" "b/quick-start/figures/\346\234\252\345\221\275\345\220\215\345\233\276\347\211\20711111.png" new file mode 100644 index 0000000000000000000000000000000000000000..4b8caa20e71b5a592b82a625d9f022a29667427d Binary files /dev/null and "b/quick-start/figures/\346\234\252\345\221\275\345\220\215\345\233\276\347\211\20711111.png" differ diff --git "a/quick-start/\345\270\270\350\247\201\351\227\256\351\242\230-1.md" "b/quick-start/\345\270\270\350\247\201\351\227\256\351\242\230-1.md" index d02d3aaedee9af6f07c3ac01d50abbdd8043c2dc..1f48e478aed84eb45ad53316ee26e9b5a3964d5f 100755 --- "a/quick-start/\345\270\270\350\247\201\351\227\256\351\242\230-1.md" +++ "b/quick-start/\345\270\270\350\247\201\351\227\256\351\242\230-1.md" @@ -120,3 +120,57 @@ ![](figures/zh-cn_image_0000001054875562.png) +**问题 5:串口无回显。** + +- **现象描述** + + 串口显示已连接,重启单板后,回车无任何回显。 + +- **可能原因** + - 串口连接错误。 + - 单板U-boot被损坏。 + +- **解决办法** + + **解决办法1:修改串口号** + + 请查看设备管理器,确认连接单板的串口与终端中连接串口是否一致,若不一致,请按步骤修改串口号。 + + **图 10** 修改串口号图示 + ![](figures/修改串口号图示.png "修改串口号图示") + + +1. 断开当前串口。 +2. 点击设置按钮。 +3. 在弹框中修改串口号并点击OK。 +4. 连接后在对话框中输入回车查看是否存在回显。 + +**解决办法2:烧写U-boot** + +若上述步骤依旧无法连接串口,可能由于单板U-boot损坏,按下述步骤烧写U-boot。 + +1. 获取引导文件U-boot。 + + >![](public_sys-resources/icon-notice.gif) **须知:** + >单板的U-boot文件请在开源包中获取,路径为vendor\\hisi\\hi35xx\\hi3516dv300\\uboot\\out\\boot\\u-boot-hi3516dv300.bin + +2. 使用HiTool工具按照标号选择U-boot烧写选项,点击烧写按钮。 + + **图 11** HiTool工具U-boot烧写步骤图 + + + ![](figures/未命名图片11111.png) + + 1. 选择单板串口COM7。 + 2. 选择Transfer Mode为Serial。 + 3. 选择Burn Fastboot标签。 + 4. 选择Flash Type为spi nor。 + 5. 选择Browse,找到对应U-boot文件。 + 6. 点击Burn开始烧写。 + +3. 提示下电并给单板重新上电,烧写完成后,连接串口,如下图所示。 + + **图 12** HiTool工具U-boot烧写完成串口显示 + ![](figures/HiTool工具U-boot烧写完成串口显示.png "HiTool工具U-boot烧写完成串口显示") + + diff --git "a/quick-start/\345\270\270\350\247\201\351\227\256\351\242\230-3.md" "b/quick-start/\345\270\270\350\247\201\351\227\256\351\242\230-3.md" index f5616e23bd14656e89e53ed9030ab3751965b511..1c25ec9d9b047933c8567ede7e9541fe3bd315f4 100755 --- "a/quick-start/\345\270\270\350\247\201\351\227\256\351\242\230-3.md" +++ "b/quick-start/\345\270\270\350\247\201\351\227\256\351\242\230-3.md" @@ -12,10 +12,12 @@ - **解决办法** + **解决办法1:修改串口号** + 请查看设备管理器,确认连接单板的串口与终端中连接串口是否一致,若不一致,请按步骤修改串口号。 **图 1** 修改串口号图示 - ![](figures/修改串口号图示.png "修改串口号图示") + ![](figures/修改串口号图示-3.png "修改串口号图示-3") 1. 断开当前串口。 @@ -23,7 +25,9 @@ 3. 在弹框中修改串口号并点击OK。 4. 连接后在对话框中输入回车查看是否存在回显。 -若上述步骤依旧无法连接串口,可能由于单板U-boot损坏,按下述步骤烧写U-Boot。 +**解决办法2:烧写U-boot** + +若上述步骤依旧无法连接串口,可能由于单板U-boot损坏,按下述步骤烧写U-boot。 1. 获取引导文件U-boot。 @@ -39,13 +43,13 @@ 2. 选择Transfer Mode为Serial。 3. 选择Burn Fastboot标签。 4. 选择Flash Type为spi nor。 - 5. 选择Browse,找到对应U-Boot文件。 + 5. 选择Browse,找到对应U-boot文件。 6. 点击Burn开始烧写。 3. 提示下电并给单板重新上电,烧写完成后,连接串口,如下图所示。 **图 3** HiTool工具U-boot烧写完成串口显示 - ![](figures/HiTool工具U-boot烧写完成串口显示.png "HiTool工具U-boot烧写完成串口显示") + ![](figures/HiTool工具U-boot烧写完成串口显示-4.png "HiTool工具U-boot烧写完成串口显示-4") **问题 2:HiTool工具烧写时上报如下错误。** diff --git "a/quick-start/\345\274\200\345\217\221Hi3516\347\254\254\344\270\200\344\270\252\345\272\224\347\224\250\347\250\213\345\272\217\347\244\272\344\276\213.md" "b/quick-start/\345\274\200\345\217\221Hi3516\347\254\254\344\270\200\344\270\252\345\272\224\347\224\250\347\250\213\345\272\217\347\244\272\344\276\213.md" index 15801a72dd750930e6f28fd4c962d94e190156e6..5b00e7bec3c1ab142fe343c1d917184af680b5ec 100755 --- "a/quick-start/\345\274\200\345\217\221Hi3516\347\254\254\344\270\200\344\270\252\345\272\224\347\224\250\347\250\213\345\272\217\347\244\272\344\276\213.md" +++ "b/quick-start/\345\274\200\345\217\221Hi3516\347\254\254\344\270\200\344\270\252\345\272\224\347\224\250\347\250\213\345\272\217\347\244\272\344\276\213.md" @@ -4,7 +4,7 @@ ## 获取源码 -开发者需要在Linux服务器上下载一套源代码,获取Hi3516源码([下载链接](http://tools.harmonyos.com/mirrors/os/1.0/code-1.0.tar.gz))。更多源码获取方式,请见[源码获取](../get-code/源码获取.md)。 +开发者需要在Linux服务器上下载一套源代码,获取Hi3516源码([下载链接](https://repo.huaweicloud.com/harmonyos/os/1.0/code-1.0.tar.gz))。更多源码获取方式,请见[源码获取](../get-code/源码获取.md)。 ## 修改应用程序 @@ -114,6 +114,9 @@ python build.py ipcamera_hi3516dv300 -b debug 1. 连接串口。 + >![](public_sys-resources/icon-notice.gif) **须知:** + >若无法连接串口,请参考常见问题5进行排查。 + **图 9** 连接串口图 diff --git "a/quick-start/\345\274\200\345\217\221Hi3516\347\254\254\344\270\200\344\270\252\351\251\261\345\212\250\347\250\213\345\272\217\347\244\272\344\276\213.md" "b/quick-start/\345\274\200\345\217\221Hi3516\347\254\254\344\270\200\344\270\252\351\251\261\345\212\250\347\250\213\345\272\217\347\244\272\344\276\213.md" index d913c11639e2cbcbd382e23c6d382a4bfe8ca878..72716dc85f18442fb461c84f52b5291830d398d8 100755 --- "a/quick-start/\345\274\200\345\217\221Hi3516\347\254\254\344\270\200\344\270\252\351\251\261\345\212\250\347\250\213\345\272\217\347\244\272\344\276\213.md" +++ "b/quick-start/\345\274\200\345\217\221Hi3516\347\254\254\344\270\200\344\270\252\351\251\261\345\212\250\347\250\213\345\272\217\347\244\272\344\276\213.md" @@ -419,6 +419,9 @@ 1. 连接串口。 + >![](public_sys-resources/icon-notice.gif) **须知:** + >若无法连接串口,请参考常见问题5进行排查。 + **图 1** 连接串口图 diff --git "a/quick-start/\345\274\200\345\217\221Hi3518\347\254\254\344\270\200\344\270\252\347\244\272\344\276\213\347\250\213\345\272\217.md" "b/quick-start/\345\274\200\345\217\221Hi3518\347\254\254\344\270\200\344\270\252\347\244\272\344\276\213\347\250\213\345\272\217.md" index 1397fff09f0ecb4c98dfd9a2e33dd9c4a6637a32..5129d1789185ba4dd177f4b5e4a6d46c2f2eac5e 100755 --- "a/quick-start/\345\274\200\345\217\221Hi3518\347\254\254\344\270\200\344\270\252\347\244\272\344\276\213\347\250\213\345\272\217.md" +++ "b/quick-start/\345\274\200\345\217\221Hi3518\347\254\254\344\270\200\344\270\252\347\244\272\344\276\213\347\250\213\345\272\217.md" @@ -4,7 +4,7 @@ ## 获取源码 -开发者需要在Linux服务器上下载一套源代码,获取Hi3518源码([下载链接](http://tools.harmonyos.com/mirrors/os/1.0/code-1.0.tar.gz))。更多源码获取方式,请见[源码获取](../get-code/源码获取.md)。 +开发者需要在Linux服务器上下载一套源代码,获取Hi3518源码([下载链接](https://repo.huaweicloud.com/harmonyos/os/1.0/code-1.0.tar.gz))。更多源码获取方式,请见[源码获取](../get-code/源码获取.md)。 ## 修改应用程序 @@ -115,5 +115,5 @@ Hi3518EV300单板请使用串口烧写。 ## 下一步学习 -恭喜您,已完成Hi3518的快速上手!建议您下一步进入[无屏摄像头产品开发](zh-cn_topic_0000001055366100.md)的学习 。 +恭喜您,已完成Hi3518的快速上手!建议您下一步进入[无屏摄像头产品开发](../guide/摄像头控制.md)的学习 。 diff --git "a/quick-start/\346\220\255\345\273\272\347\216\257\345\242\203-0.md" "b/quick-start/\346\220\255\345\273\272\347\216\257\345\242\203-0.md" index 55d0bf8f5b02ded06ee33d362e7a71fa44efb5ac..4c1d029fc923507c42d3a051167a489a3f3dcf57 100755 --- "a/quick-start/\346\220\255\345\273\272\347\216\257\345\242\203-0.md" +++ "b/quick-start/\346\220\255\345\273\272\347\216\257\345\242\203-0.md" @@ -89,28 +89,28 @@ Linux服务器通用环境配置需要的工具及其获取途径如下表所示 - - - - + + + +

Name

@@ -17,7 +17,7 @@ The test-driven development mode is used during the development process. You can

developertest

Development self-test framework

+

Development test framework

developertest/src

@@ -107,12 +107,12 @@ The test-driven development mode is used during the development process. You can

developertest/start.bat

Developer self-test entry (Windows)

+

Developer test entry (Windows)

developertest/start.sh

Developer self-test entry (Linux)

+

Developer test entry (Linux)

KV store

LiteOS-M and LiteOS-A platforms

+

LiteOS Cortex-M and LiteOS Cortex-A

Provides KV storage for applications.

File operation

LiteOS-M platform

+

LiteOS Cortex-M

Provides unified file operation interfaces that can be used on different underlying chip components.

Timer

LiteOS-M and LiteOS-A platforms

+

LiteOS Cortex-M and LiteOS Cortex-A

Provides unified timer operation interfaces that can be used on different underlying chip components.

IoT peripheral control

LiteOS-M platform

+

LiteOS Cortex-M

Provides the capability of performing operations for peripherals.

1.0

站点1站点2

+

站点

SHA256 校验码

+

SHA256 校验码

Hi3861解决方案(二进制)

1.0

站点1站点2

+

站点

SHA256 校验码

1.0

站点1站点2

+

站点

SHA256 校验码

+

SHA256 校验码

Hi3516解决方案(二进制)

1.0

站点1站点2

+

站点

SHA256 校验码

+

SHA256 校验码

RELEASE-NOTES

1.0

站点1

+

站点

-

9.0.0-34042

站点1 站点2

+

站点

64a518b50422b6f1ba8f6f56a5e303fb8448a311211ba10c385ad307a1d2546f

7.3.0

站点1 站点2

+

站点

614ee086ead1a4fd7384332b85dd62707801f323de60dfdb61503f473d470a24

1523

站点1 站点2

+

站点

50a5a5ba5877dd0ec8afcb23d3dd4d966a16403c29cd80a4002230241d32ef34

1.9.0

站点1 站点2

+

站点

b4a4ba21e94ff77634e1f88697a00b6f498fdbc0b40d7649df1b246b285874f9

0.65

站点1 站点2

+

站点

fcfee489371947a464fe41a4b45a897b9a44155891a957f15bad2e157c750162

产生ninja编译脚本

http://tools.harmonyos.com/mirrors/gn/1523/linux/gn.1523.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/gn/1523/linux/gn.1523.tar

ninja

执行ninja编译脚本

http://tools.harmonyos.com/mirrors/ninja/1.9.0/linux/ninja.1.9.0.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar

LLVM

编译工具链

http://tools.harmonyos.com/mirrors/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar

hc-gen

驱动配置编译工具

http://tools.harmonyos.com/mirrors/hc-gen/0.65/linux/hc-gen-0.65-linux.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar

IPOP、PuTTY或其他超级终端

@@ -152,6 +152,13 @@ Linux服务器通用环境配置需要的工具及其获取途径如下表所示

https://device.harmonyos.com/cn/ide

HiTool工具

+

U-boot,镜像文件烧写工具

+

http://www.hihope.org/download

+
@@ -256,7 +263,7 @@ sudo ln -s /bin/bash /bin/sh ## 安装gn 1. 打开Linux编译服务器终端。 -2. [下载gn工具](http://tools.harmonyos.com/mirrors/gn/1523/linux/gn.1523.tar)。 +2. [下载gn工具](https://repo.huaweicloud.com/harmonyos/compiler/gn/1523/linux/gn.1523.tar)。 3. 解压gn安装包至\~/gn路径下:"tar -xvf gn.1523.tar -C \~/"。 4. 设置环境变量:"vim \~/.bashrc", 新增:"export PATH=\~/gn:$PATH"。 5. 生效环境变量:"source \~/.bashrc"。 @@ -264,7 +271,7 @@ sudo ln -s /bin/bash /bin/sh ## 安装ninja 1. 打开Linux编译服务器终端 -2. [下载ninja工具](http://tools.harmonyos.com/mirrors/ninja/1.9.0/linux/ninja.1.9.0.tar)。 +2. [下载ninja工具](https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar)。 3. 解压ninja安装包至\~/ninja路径下:"tar -xvf ninja.1.9.0.tar -C \~/"。 4. 设置环境变量:"vim \~/.bashrc", 新增:"export PATH=\~/ninja:$PATH"。 5. 生效环境变量:"source \~/.bashrc"。 @@ -272,7 +279,7 @@ sudo ln -s /bin/bash /bin/sh ## 安装LLVM编译工具链 1. 打开Linux编译服务器终端。 -2. [下载LLVM工具](http://tools.harmonyos.com/mirrors/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar)。 +2. [下载LLVM工具](https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar)。 3. 解压LLVM安装包至\~/llvm路径下:"tar -xvf llvm-linux-9.0.0-34042.tar -C \~/"。 4. 设置环境变量:"vim \~/.bashrc", 新增:export PATH=\~/llvm/bin:$PATH。 5. 生效环境变量:"source \~/.bashrc"。 @@ -280,8 +287,8 @@ sudo ln -s /bin/bash /bin/sh ## 安装hc-gen 1. 打开Linux编译服务器终端。 -2. [下载hc-gen工具](http://tools.harmonyos.com/mirrors/hc-gen/0.65/linux/hc-gen-0.65-linux.tar)。 -3. 解压hc-gen安装包到Linux服务器\~/hc-gen路径下。 +2. [下载hc-gen工具](https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar)。 +3. 解压hc-gen安装包到Linux服务器\~/hc-gen路径下:"tar -xvf hc-gen-0.65-linux.tar -C \~/"。 4. 设置环境变量:"vim \~/.bashrc", 新增:export PATH=\~/hc-gen:$PATH。 5. 生效环境变量:"source \~/.bashrc"。 diff --git "a/quick-start/\346\220\255\345\273\272\347\216\257\345\242\203-2.md" "b/quick-start/\346\220\255\345\273\272\347\216\257\345\242\203-2.md" index 2b1a264c5d476a88f7151529261b160b95f5b2d8..5c27f966f02021119c80fcd91954d5731dce90d7 100755 --- "a/quick-start/\346\220\255\345\273\272\347\216\257\345\242\203-2.md" +++ "b/quick-start/\346\220\255\345\273\272\347\216\257\345\242\203-2.md" @@ -84,28 +84,28 @@ Linux服务器通用环境配置需要的工具及其获取途径如下表所示

产生ninja编译脚本

http://tools.harmonyos.com/mirrors/gn/1523/linux/gn.1523.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/gn/1523/linux/gn.1523.tar

ninja

执行ninja编译脚本

http://tools.harmonyos.com/mirrors/ninja/1.9.0/linux/ninja.1.9.0.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar

LLVM

编译工具链

http://tools.harmonyos.com/mirrors/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar

hc-gen

驱动配置编译工具

http://tools.harmonyos.com/mirrors/hc-gen/0.65/linux/hc-gen-0.65-linux.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar

IPOP、PuTTY或其他超级终端

@@ -249,7 +249,7 @@ sudo ln -s /bin/bash /bin/sh ## 安装gn 1. 打开Linux编译服务器终端。 -2. [下载gn工具](http://tools.harmonyos.com/mirrors/gn/1523/linux/gn.1523.tar)。 +2. [下载gn工具](https://repo.huaweicloud.com/harmonyos/compiler/gn/1523/linux/gn.1523.tar)。 3. 解压gn安装包至\~/gn路径下:"tar -xvf gn.1523.tar -C \~/"。 4. 设置环境变量:"vim \~/.bashrc", 新增:"export PATH=\~/gn:$PATH"。 5. 生效环境变量:"source \~/.bashrc"。 @@ -257,7 +257,7 @@ sudo ln -s /bin/bash /bin/sh ## 安装ninja 1. 打开Linux编译服务器终端 -2. [下载ninja工具](http://tools.harmonyos.com/mirrors/ninja/1.9.0/linux/ninja.1.9.0.tar)。 +2. [下载ninja工具](https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar)。 3. 解压ninja安装包至\~/ninja路径下:"tar -xvf ninja.1.9.0.tar -C \~/"。 4. 设置环境变量:"vim \~/.bashrc", 新增:"export PATH=\~/ninja:$PATH"。 5. 生效环境变量:"source \~/.bashrc"。 @@ -265,7 +265,7 @@ sudo ln -s /bin/bash /bin/sh ## 安装LLVM编译工具链 1. 打开Linux编译服务器终端。 -2. [下载LLVM工具](http://tools.harmonyos.com/mirrors/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar)。 +2. [下载LLVM工具](https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar)。 3. 解压LLVM安装包至\~/llvm路径下:"tar -xvf llvm-linux-9.0.0-34042.tar -C \~/"。 4. 设置环境变量:"vim \~/.bashrc", 新增:export PATH=\~/llvm/bin:$PATH。 5. 生效环境变量:"source \~/.bashrc"。 @@ -273,8 +273,8 @@ sudo ln -s /bin/bash /bin/sh ## 安装hc-gen 1. 打开Linux编译服务器终端。 -2. [下载hc-gen工具](http://tools.harmonyos.com/mirrors/hc-gen/0.65/linux/hc-gen-0.65-linux.tar)。 -3. 解压hc-gen安装包到Linux服务器\~/hc-gen路径下。 +2. [下载hc-gen工具](https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar)。 +3. 解压hc-gen安装包到Linux服务器\~/hc-gen路径下:"tar -xvf hc-gen-0.65-linux.tar -C \~/"。 4. 设置环境变量:"vim \~/.bashrc", 新增:export PATH=\~/hc-gen:$PATH。 5. 生效环境变量:"source \~/.bashrc"。 diff --git "a/quick-start/\346\220\255\345\273\272\347\216\257\345\242\203.md" "b/quick-start/\346\220\255\345\273\272\347\216\257\345\242\203.md" index 675c8dc1ec1b17a3cad90597dbc9d27209c452d0..e629fae462bbaef89a598ded1e7dda4fd772f53f 100755 --- "a/quick-start/\346\220\255\345\273\272\347\216\257\345\242\203.md" +++ "b/quick-start/\346\220\255\345\273\272\347\216\257\345\242\203.md" @@ -67,7 +67,7 @@ Linux服务器通用环境配置需要的工具及其获取途径如下表所示

交叉编译工具

http://tools.harmonyos.com/mirrors/gcc_riscv32/7.3.0/linux/gcc_riscv32-linux-7.3.0.tar.gz

+

https://repo.huaweicloud.com/harmonyos/compiler/gcc_riscv32/7.3.0/linux/gcc_riscv32-linux-7.3.0.tar.gz

Python3.7+

@@ -102,14 +102,14 @@ Linux服务器通用环境配置需要的工具及其获取途径如下表所示

产生ninja编译脚本

http://tools.harmonyos.com/mirrors/gn/1523/linux/gn.1523.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/gn/1523/linux/gn.1523.tar

ninja

执行ninja编译脚本

http://tools.harmonyos.com/mirrors/ninja/1.9.0/linux/ninja.1.9.0.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar

services/hiview_lite

DFX框架服务化注册

+

DFX mini框架服务化注册

frameworks/ddrdump_lite

@@ -94,7 +94,7 @@

utils/lite

公共基础操作定义实现。包含了miini框架的config配置

+

公共基础操作定义实现。包含了mini框架的config配置

@@ -157,7 +155,6 @@ DFX-mini是一套简单小巧的DFX设计,对外提供log功能:

OUTPUT_OPTION_DEBUG 日志不进行跨任务调度直接输出到串口,仅适合临时调测使用。

OUTPUT_OPTION_FLOW 日志流式输出到串口(默认设置)

OUTPUT_OPTION_TEXT_FILE 日志输出为文本文件

-

OUTPUT_OPTION_BIN_FILE 日志输出为二进制文件(后续支持)

- @@ -191,7 +188,7 @@ DFX-mini是一套简单小巧的DFX设计,对外提供log功能: 在需要打印日志的.c文件中 \#include "log.h",调用如下接口: - HILOG\_INFO\(HILOG\_MODULE\_SAMGR, “log test: %d”, 88\); + HILOG\_INFO\(HILOG\_MODULE\_A,“log test: %d”, 88\); 接口参数说明: @@ -250,18 +247,22 @@ DFX featured框架提供完整的DFX特性,对外提供log接口: hilog 可用API ``` -HILOGD(fmt,...) HILOGI(fmt,...) HILOGW(fmt,...) HILOGE(fmt,...) +HILOG_DEBUG(type, ...) +HILOG_INFO(type, ...) +HILOG_WARN(type, ...) +HILOG_ERROR(type, ...) +HILOG_FATAL(type, ...) ``` 使用介绍 -首先需要定义TAG,DOMAIN需要找DFT申请,未经申请的DOMAIN,日志打印不出来。 +1. 首先需要定义TAG。 -本地调试,可以临时使用domain数值 0。 +2. 本地调试,可以临时使用domain数值 0。 -包含头文件:\#include +3. 包含头文件:\#include -在BUILD.gn中添加依赖库 libhilog。 +4. 在BUILD.gn中添加依赖库 libhilog。 接口规则介绍: @@ -284,7 +285,7 @@ HILOGD(fmt,...) HILOGI(fmt,...) HILOGW(fmt,...) HILOGE(fmt,...) - - @@ -70,7 +69,7 @@ vendor/hisi/hi3861/hi3861_adapter/hals/iot_hardware #IoT外设控制HAL层 - @@ -79,7 +78,7 @@ vendor/hisi/hi3861/hi3861_adapter/hals/iot_hardware #IoT外设控制HAL层 - @@ -88,7 +87,7 @@ vendor/hisi/hi3861/hi3861_adapter/hals/iot_hardware #IoT外设控制HAL层 - @@ -101,12 +100,12 @@ vendor/hisi/hi3861/hi3861_adapter/hals/iot_hardware #IoT外设控制HAL层 - **KV存储** - 获取接口 - ``` + 获取接口 char key1[] = "rw.sys.version"; char value1[32] = {0}; int ret = UtilsGetValue(key1, value1, 32); + 设置接口 char key14[] = "key_14"; ret = UtilsSetValue(key14, defValue); @@ -121,10 +120,12 @@ vendor/hisi/hi3861/hi3861_adapter/hals/iot_hardware #IoT外设控制HAL层 printf("file handle = %d\n", fd); int ret = UtilsFileWrite(fd, def, strlen(def)); printf("write ret = %d\n", ret); + // stat int fileLen = 0; ret = UtilsFileStat(fileName, &fileLen); printf("file size = %d\n", fileLen); + // seek int fd1 = UtilsFileOpen(fileName, O_RDWR_FS, 0); ret = UtilsFileSeek(fd1, 5, SEEK_SET_FS); @@ -133,6 +134,7 @@ vendor/hisi/hi3861/hi3861_adapter/hals/iot_hardware #IoT外设控制HAL层 int readLen = UtilsFileRead(fd1, buf, 32); ret = UtilsFileClose(fd1); printf("read len = %d : buf = %s\n", readLen, buf); + // delete ret = UtilsFileDelete(fileName); printf("delete ret = %d\n", ret); diff --git "a/readme/\345\206\205\346\240\270\345\255\220\347\263\273\347\273\237README.md" "b/readme/\345\206\205\346\240\270\345\255\220\347\263\273\347\273\237README.md" index d1583ca09eccd5a53b9f2c09f1fa96535225ef56..03ba49855c51a8fcf87b4ec850f0570bc3cf2ca2 100755 --- "a/readme/\345\206\205\346\240\270\345\255\220\347\263\273\347\273\237README.md" +++ "b/readme/\345\206\205\346\240\270\345\255\220\347\263\273\347\273\237README.md" @@ -4,11 +4,13 @@ OpenHarmony内核是华为推出面向IoT领域的实时操作系统内核,它同时具备RTOS轻快和Linux易用的特点。 -这个仓库用于存放OpenHarmony内核的源代码,主要包括如下基本功能组件模块:进程和线程调度、内存管理、IPC机制、timer管理等,版本包编译信息。 +OpenHarmony内核主要包括进程和线程调度、内存管理、IPC机制、timer管理等内核基本功能。 + +OpenHarmony内核的源代码分为 [`kernel_liteos_a`](https://gitee.com/openharmony/kernel_liteos_a) 和 [`kernel_liteos_m`](https://gitee.com/openharmony/kernel_liteos_m) 这2个代码仓库,其中`kernel_liteos_a`主要针对Cortex-A系列处理器,而`kernel_liteos_m`则主要针对Cortex-M系列处理器,两者目录结构非常相似,所以下面主要针对`kernel_liteos_a`代码仓库进行介绍。 ## 目录 -**表 1** OpenHarmony轻内核源代码目录结构 +**表 1** OpenHarmony内核源代码目录结构

配置项

level

@@ -180,7 +177,7 @@ DFX-mini是一套简单小巧的DFX设计,对外提供log功能:

eventSwitch

事件功能开关。编译前关闭则不再初始化DUMP组件。默认关闭。取值如下:

+

事件功能开关。编译前关闭则不再初始化Event组件。默认关闭。取值如下:

HIVIEW_FEATURE_ON/ HIVIEW_FEATURE_OFF

domain

领域标识ID,需要找DFT申请,未经申请的domain会出现日志打印不出来的问题

+

领域标识ID

tag

@@ -312,14 +313,14 @@ HILOGD(fmt,...) HILOGI(fmt,...) HILOGW(fmt,...) HILOGE(fmt,...) **日志查看** -1. debug版本hilog日志会保存到/storage/data/log/hilogs 目录下面。 +1. debug版本hilog日志会保存到/storage/data/log/目录下面。 2. 可以执行hilogcat实时查看hilog日志。 **日志系统架构** -![](figures/zh-cn_image_0000001052080708.png) +![](figures/zh-cn_image_0000001054762887.png) 1. hilogtask流水日志的内核任务。 - 此功能是一个linux内核的任务或者线程,在系统启动时初始化。 @@ -329,7 +330,6 @@ HILOGD(fmt,...) HILOGI(fmt,...) HILOGW(fmt,...) HILOGE(fmt,...) 2. hilogcatd用户态日志存储服务。 - 这是一个用户态的进程,负责定时将内核的ringbuffer读取出来,存储到日志文件中。 - 日志文件输出支持gzip压缩,使用zlib - - 每个类型的ringbuffer分开存储。 - 存储文件的单个文件大小,文件个数可在编译时配置。 3. hilogcat日志查看命令行工具。 @@ -338,7 +338,6 @@ HILOGD(fmt,...) HILOGI(fmt,...) HILOGW(fmt,...) HILOGE(fmt,...) 4. 支持日志缓冲区可配置。 - 编译时可以配置日志缓冲区的大小。 - - 编译时可以指定日志缓冲区的类型,类型个数就是ringbuffer的个数。 ## 涉及仓 diff --git "a/readme/JS\345\272\224\347\224\250\345\274\200\345\217\221\346\241\206\346\236\266README.md" "b/readme/JS\345\272\224\347\224\250\345\274\200\345\217\221\346\241\206\346\236\266README.md" index 1d001b0f6763e1d8b98607d75e9cb1bbd2c4b3ed..0e98449019b32c9dd99d3d3c443210e75a9ae1ed 100755 --- "a/readme/JS\345\272\224\347\224\250\345\274\200\345\217\221\346\241\206\346\236\266README.md" +++ "b/readme/JS\345\272\224\347\224\250\345\274\200\345\217\221\346\241\206\346\236\266README.md" @@ -2,7 +2,7 @@ ## 简介 -JS应用开发框架,提供了一套跨平台的类web应用开发框架,通过Toolkit将开发者编写的HML、CSS和JS 文件编译打包成JS Bundle,然后再将JS Bundle解析运行成C++ native UI的View 组件进行渲染。通过支持三方开发者使用声明式的API进行应用开发,以数据驱动视图变化,避免了大量的视图操作,大大降低了应用开发难度,提升开发者开发体验。 +JS应用开发框架,提供了一套跨平台的类web应用开发框架,通过Toolkit将开发者编写的HML、CSS和JS 文件编译打包成JS Bundle,解析运行JS Bundle,生成native UI View组件树并进行渲染显示。通过支持三方开发者使用声明式的API进行应用开发,以数据驱动视图变化,避免大量的视图操作,大大降低应用开发难度,提升开发者开发体验。 JS应用框架模块组成如下图所示: @@ -14,37 +14,37 @@ JS应用开发框架源代码在/foundation/ace下,目录结构如下图所示 ``` /foundation/ace -├── frameworks #框架代码 +├── frameworks # 框架代码 │ └── lite -│ ├── examples #示例代码目录 -│ ├── include #对外暴露头文件存放目录 -│ ├── packages #框架JS实现存放目录 -│ ├── src #源代码存放目录 -│ ├── targets #各目标设备配置文件存放目录 -│ └── tools #工具代码存放目录 -├── interfaces #对外接口存放目录 -│ └── innerkits #对内部子系统暴露的头文件存放目录 +│ ├── examples # 示例代码目录 +│ ├── include # 对外暴露头文件存放目录 +│ ├── packages # 框架JS实现存放目录 +│ ├── src # 源代码存放目录 +│ ├── targets # 各目标设备配置文件存放目录 +│ └── tools # 工具代码存放目录 +├── interfaces # 对外接口存放目录 +│ └── innerkits # 对内部子系统暴露的头文件存放目录 │ └── builtin # JS应用框架对外暴露JS三方module API接口存放目录 ``` ## 约束 -- 语言版本 +- 语言版本: - C++11版本或以上 - - JavaScript ES5.1+ + - JavaScript ES5.1 - 框架运行内存通常分为如下组成部分: - - 运行时引擎的预分配内存,该内存值可调,取决于具体设备应用复杂度,通常建议64K\~512K - - 框架本身内存,在百K级的内存设备上,通常通过预分配一个内存池进行管理,可以和native UI共用一个内存池,包含了对象和堆内存统一管理 + - JS引擎运行时内存:可调,取决于具体设备应用复杂度,通常建议64K\~512K + - 框架本身native内存:在百K级的内存设备上,建议预分配一个与native UI共用的内存池,用于native内存的管理 -- 框架针对不同的芯片平台和底层OS能力,规格有所区别 - - Cortex-M RAM/ROM: +- 框架针对不同的芯片平台和底层OS能力,规格有所区别: + - Cortex-M RAM/ROM - JS引擎内存池: 建议大于48K - RAM:建议与native UI共用内存池,大于80K - ROM: \> 300K (包含JS应用框架,以及native UI和JS引擎等强相关子系统) - - Cortex-A RAM/ROM: + - Cortex-A RAM/ROM - JS引擎内存池: 建议大于128K - RAM:建议大于512K - ROM:\> 2M (包含JS应用框架,以及native UI和JS引擎等强相关子系统) @@ -53,7 +53,10 @@ JS应用开发框架源代码在/foundation/ace下,目录结构如下图所示 ## 使用**targets** -JS应用框架实现主要包含两部分,native和JavaScript,native部分为C++,为框架的主体实现,JavaScript部分实现提供JS应用框架对用户JS文件的运行时支持,并通过向引擎暴露一些全局方法或对象,支撑JS运行时与native框架之间的交互。 +JS应用框架实现主要包含两部分: + +- native部分:使用C++进行编写,是框架主体实现; +- JavaScript部分:提供JS应用框架对用户JS文件的运行时支持,并通过向引擎暴露一些全局方法和对象,支撑JS运行时与native框架之间的交互。 JS应用框架通过一些特性宏来定制不同平台上参与编译的功能代码,该部分特性宏定义在 foundation/ace/frameworks/lite/targets 目录下头文件内,目录结构如下: @@ -61,70 +64,74 @@ JS应用框架通过一些特性宏来定制不同平台上参与编译的功能 /foundation/ace/frameworks/lite/targets ├── default/ │ └── acelite_config.h -├── linux/ #linux环境配置文件目录 +├── linux/ # linux环境配置文件目录 │ └── acelite_config.h -├── liteos_a/ #LiteOS A核环境配置文件目录 +├── liteos_a/ # LiteOS A核环境配置文件目录 │ └── acelite_config.h -├── liteos_m/ #LiteOS M核环境配置文件目录 +├── liteos_m/ # LiteOS M核环境配置文件目录 │ └── acelite_config.h ├── platform_adapter.cpp ├── platform_adapter.h -└── simulator/ #模拟器环境配置文件目录 +└── simulator/ # 模拟器环境配置文件目录 └── win/ └── acelite_config.h* ``` -在编译不同的平台目标时,需要使用对应平台目录下的acelite\_config.h 头文件,这可以通过配置编译时的搜索路径来进行,以下以 ninja和cmake 构建工具为例进行示例: +在编译不同的平台目标时,需要使用对应平台目录下的acelite\_config.h头文件,这可以通过配置编译时的搜索路径来进行,以下以ninja和cmake构建工具为例进行示例: -ninja: +- ninja: -``` - if (hos_kernel_type == "liteos_a" || hos_kernel_type == "liteos_m" || - hos_kernel_type == "liteos_riscv") { // 通过目标内核平台选择不同的头文件搜索路径 - include_dirs += [ "targets/liteos-a" ] - } else if (hos_kernel_type == "linux") { - include_dirs += [ "targets/linux" ] - } -``` + ``` + if (ohos_kernel_type == "liteos_a" || ohos_kernel_type== "liteos_m" || + ohos_kernel_type == "liteos_riscv") { // 通过目标内核平台选择不同的头文件搜索路径 + include_dirs += [ "targets/liteos-a" ] + } else if (ohos_kernel_type == "linux") { + include_dirs += [ "targets/linux" ] + } + ``` -cmake: -``` -...... -set(ACE_LITE_CONFIG_PATH "${CMAKE_CURRENT_SOURCE_DIR}/targets/simulator/win") -set(JSFWK_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/include") -set(JSFWK_SOURCE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/core") -set(UIKIT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ui") -set(THIRTY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../third_party") -set(JSFWK_SIMULATOR_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../tools/simulator") -set(JS_API_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../api/emui_band/MoltenCore/application/framework/ace/api") -set(JSFWK_SIMULATOR_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../tools/simulator") -set(AAFWK_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../aafwk") - -# header files -include_directories( - ${ACE_LITE_CONFIG_PATH} - ${JSFWK_INCLUDE_PATH}/async - ${JSFWK_INCLUDE_PATH}/base - ${JSFWK_INCLUDE_PATH}/context - ${JSFWK_INCLUDE_PATH}/jsi - ${JSFWK_SOURCE_PATH} +- cmake: + + ``` ...... -``` + set(ACE_LITE_CONFIG_PATH "${CMAKE_CURRENT_SOURCE_DIR}/targets/simulator/win") # 模拟器编译搜索路径使用targets/simulator/win + set(JSFWK_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/include") + set(JSFWK_SOURCE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/core") + set(UIKIT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ui") + set(THIRTY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../third_party") + set(JSFWK_SIMULATOR_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../tools/simulator") + set(JS_API_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../api/emui_band/MoltenCore/application/framework/ace/api") + set(JSFWK_SIMULATOR_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../tools/simulator") + set(AAFWK_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../aafwk") + + # header files + include_directories( + ${ACE_LITE_CONFIG_PATH} + ${JSFWK_INCLUDE_PATH}/async + ${JSFWK_INCLUDE_PATH}/base + ${JSFWK_INCLUDE_PATH}/context + ${JSFWK_INCLUDE_PATH}/jsi + ${JSFWK_SOURCE_PATH} + ...... + ``` -acelite\_config.h主要用于对应平台的特性宏开关,也可用来进行一些屏蔽平台差异的定义,如不同平台由于使用的文件系统不一致,可能存在一些固定目录路径名不一样的情况,这些有区别的常量可以放在这里进行定义,如下: -liteos-a/acelite\_config.h +acelite\_config.h主要用于对应平台的特性宏开关,也可用来进行一些屏蔽平台差异的定义。如不同平台由于使用的文件系统不一致,可能存在一些固定目录路径名不一样的情况,这些有区别的常量可以放在这里进行定义,如下: -``` -#define JS_FRAMEWORK_PATH "//system/ace/bin/" -``` +- liteos-a/acelite\_config.h -simulator/win/acelite\_config.h + ``` + #define JS_FRAMEWORK_PATH "//system/ace/bin/" + ``` + + +- simulator/win/acelite\_config.h + + ``` + #define JS_FRAMEWORK_PATH "..\\..\\..\\jsfwk\\packages\\runtime-core\\build" + ``` -``` -#define JS_FRAMEWORK_PATH "..\\..\\..\\jsfwk\\packages\\runtime-core\\build" -``` ## 使用runtime-core @@ -133,30 +140,30 @@ simulator/win/acelite\_config.h ``` /foundation/ace/frameworks/lite/packages └── runtime-core - ├── .babelrc #babel配置文件 - ├── .editorconfig #IDE配置文件 - ├── .eslintignore #ESLint配置文件,可以设置不进行ESLint扫描的目录或文件 - ├── .eslintrc.js #ESLint配置文件,可以配置扫描规则 + ├── .babelrc # babel配置文件 + ├── .editorconfig # IDE配置文件 + ├── .eslintignore # ESLint配置文件,可以设置不进行ESLint扫描的目录或文件 + ├── .eslintrc.js # ESLint配置文件,可以配置扫描规则 ├── .gitignore - ├── package.json #NPM包管理文件 - ├── package-lock.json #NPM依赖版本锁定文件 - ├── .prettierrc #代码格式化规则配置文件 - ├── scripts #编译脚本存放目录 - │ ├── build.js #编译脚本 - │ └── configs.js #Rollup配置文件 + ├── package.json # NPM包管理文件 + ├── package-lock.json # NPM依赖版本锁定文件 + ├── .prettierrc # 代码格式化规则配置文件 + ├── scripts # 编译脚本存放目录 + │ ├── build.js # 编译脚本 + │ └── configs.js # Rollup配置文件 ├── .size-snapshot.json - └── src #源代码 - ├── core #ViewModel核心实现目录 + └── src # 源代码 + ├── core # ViewModel核心实现目录 │ └── index.js ├── index.js - ├── observer #数据劫持部分代码实现目录 + ├── observer # 数据劫持部分代码实现目录 │ ├── index.js │ ├── observer.js │ ├── subject.js │ └── utils.js - ├── profiler #profiler目录 + ├── profiler # profiler目录 │ └── index.js - └── __test__ #测试用例目录 + └── __test__ # 测试用例目录 └── index.test.js ``` @@ -164,7 +171,7 @@ simulator/win/acelite\_config.h - npm run build - JS应用框架所集成的JS 引擎仅支持ES5.1语法,runtime-core源代码是使用ES6源码书写的。因此选择使用rollup做为打包工具,配合babel实现对JavaScript语法进行降级处理。只要命令行中执行命令npm run build,会在build目录下输出打包结果,输出结果如下所示: + JS应用框架所集成的JS引擎仅支持ES5.1语法,runtime-core源代码是使用ES6语法书写的。因此选择使用rollup做为打包工具,配合babel实现对语法进行降级处理。命令行中执行npm run build,会在build目录下输出打包结果,输出结果如下所示: ``` build/ diff --git "a/readme/XTS\350\256\244\350\257\201\345\255\220\347\263\273\347\273\237README.md" "b/readme/XTS\350\256\244\350\257\201\345\255\220\347\263\273\347\273\237README.md" index b66acd065fa011e48027256a1fb9e2ae770610d5..c44113c0201ab6edc1f80223f6ac95c7b7b1cc0a 100755 --- "a/readme/XTS\350\256\244\350\257\201\345\255\220\347\263\273\347\273\237README.md" +++ "b/readme/XTS\350\256\244\350\257\201\345\255\220\347\263\273\347\273\237README.md" @@ -6,8 +6,8 @@ XTS是OpenHarmony生态认证测试套件的集合,当前包括acts(applicat test/xts仓当前包括acts与tools软件包: -- acts,存放acts相关测试用例源码与配置文件,帮助终端设备厂商尽早发现软件与OpenHarmony的不兼容性,确保软件在整个开发过程中满足OpenHarmony的兼容性要求。 -- tools,提供acts编写和编译所依赖的开发框架。 +- acts,存放acts相关测试用例源码与配置文件,其目的是帮助终端设备厂商尽早发现软件与OpenHarmony的不兼容性,确保软件在整个开发过程中满足OpenHarmony的兼容性要求。 +- tools,存放acts相关测试用例开发框架。 ## 目录 @@ -17,9 +17,7 @@ test/xts源代码目录结构: │ ├── BUILD.gn 测试用例编译配置 -│ └── A测试子系统\_lite A测试子系统测试用例源码 - -│ └── B测试子系统\_lite B测试子系统测试用例源码 +│ └── subsystem\_lite 子系统测试用例源码 └── tools @@ -39,7 +37,7 @@ test/xts源代码目录结构: ## 编写联接类模组acts测试用例 -当前使用的测试框架是hctest测试框架。 +当前使用的测试框架是hctest。 hctest测试框架支持使用C语言编写测试用例,在联接类模组上执行,是在开源测试框架unity的基础上进行增强和适配。 @@ -49,13 +47,13 @@ hctest测试框架支持使用C语言编写测试用例,在联接类模组上 │ ├── BUILD.gn -│ └──测试子系统\_lite +│ └──subsystem\_lite -│ │ └── 测试模块\_hal +│ │ └── module\_hal │ │ │ └── BUILD.gn -│ │ │ └── src 存放测试用例源码 +│ │ │ └── src **2,src目录下用例编写样例:** @@ -171,7 +169,7 @@ hctest_suite("ActsDemoTest") { **4,acts下BUILD.gn增加编译选项** -如何将编写的测试代码加入到版本编译中,需要将测试模块加入到acts目录下的编译脚本中,编译脚本为:test/xts/acts/BUILD.gn。 +需要将测试模块加入到acts目录下的编译脚本中,编译脚本路径:test/xts/acts/BUILD.gn。 ``` lite_component("acts") { @@ -179,7 +177,7 @@ lite_component("acts") { if(board_name == "liteos_riscv") { features += [ ... - "//xts/acts/测试子系统_lite/测试模块_hal:ActsDemoTest" + "//xts/acts/subsystem_lite/module_hal:ActsDemoTest" ] } } @@ -203,13 +201,13 @@ hcpptest测试框架是在开源的googletest测试框架的基础上进行的 │ ├── BUILD.gn -│ └──测试子系统\_lite +│ └──subsystem\_lite -│ │ └── 测试模块\_posix +│ │ └── module\_posix │ │ │ └── BUILD.gn -│ │ │ └── src 存放测试用例源码 +│ │ │ └── src **2,测试模块src下用例编写样例:** @@ -226,17 +224,17 @@ hcpptest测试框架是在开源的googletest测试框架的基础上进行的 ``` class TestSuite: public testing::Test { protected: -// SetUpTestCase:测试套预置动作,在第一个TestCase之前执行 +// Preset action of the test suite, which is executed before the first test case static void SetUpTestCase(void){ } -// TearDownTestCase:测试套清理动作,在最后一个TestCase之后执行 +// Test suite cleanup action, which is executed after the last test case static void TearDownTestCase(void){ } -// 用例的预置动作 +// Preset action of the test case virtual void SetUp() { } -// 用例的清理动作 +// Cleanup action of the test case virtual void TearDown() { } @@ -339,7 +337,7 @@ hcpptest_suite("ActsDemoTest") { 4**,acts目录下增加编译选项(BUILD.gn)** -如何将编写的测试代码加入到版本编译中,需要将测试模块加入到acts目录下的编译脚本中,编译脚本为:test/xts/acts/BUILD.gn。 +需要将测试模块加入到acts目录下的编译脚本中,编译脚本为:test/xts/acts/BUILD.gn。 ``` lite_component("acts") { @@ -347,7 +345,7 @@ hcpptest_suite("ActsDemoTest") { else if(board_name == "liteos_a") { features += [ ... - "//xts/acts/测试子系统_lite/测试模块_posix:ActsDemoTest" + "//xts/acts/subsystem_lite/module_posix:ActsDemoTest" ] } } diff --git "a/readme/figures/bms\347\255\226\347\225\245\344\270\276\344\276\213.png" "b/readme/figures/bms\347\255\226\347\225\245\344\270\276\344\276\213.png" new file mode 100644 index 0000000000000000000000000000000000000000..fb9c3d8c66673f5c5b69718f59bb09dab16e48a9 Binary files /dev/null and "b/readme/figures/bms\347\255\226\347\225\245\344\270\276\344\276\213.png" differ diff --git a/readme/figures/zh-cn_image_0000001054762887.png b/readme/figures/zh-cn_image_0000001054762887.png new file mode 100644 index 0000000000000000000000000000000000000000..fee686d5a816b82f3d0d455d2134819976d33613 Binary files /dev/null and b/readme/figures/zh-cn_image_0000001054762887.png differ diff --git a/readme/figures/zh-cn_image_0000001055103250.png b/readme/figures/zh-cn_image_0000001055103250.png new file mode 100644 index 0000000000000000000000000000000000000000..e1732f4dd9bb12a8abf040fba4b92dafab7df01e Binary files /dev/null and b/readme/figures/zh-cn_image_0000001055103250.png differ diff --git a/readme/figures/zh-cn_image_0000001055267336.png b/readme/figures/zh-cn_image_0000001055267336.png new file mode 100644 index 0000000000000000000000000000000000000000..c329d1d02d83435acfa6dbf1629f5649541f3b42 Binary files /dev/null and b/readme/figures/zh-cn_image_0000001055267336.png differ diff --git "a/readme/figures/\345\205\250\345\261\200\347\255\226\347\225\2452.png" "b/readme/figures/\345\205\250\345\261\200\347\255\226\347\225\2452.png" new file mode 100644 index 0000000000000000000000000000000000000000..c40fd5e3f15cbd316c43dce31020740396c57d3f Binary files /dev/null and "b/readme/figures/\345\205\250\345\261\200\347\255\226\347\225\2452.png" differ diff --git "a/readme/figures/\347\255\226\347\225\245\347\261\273\345\236\2132.png" "b/readme/figures/\347\255\226\347\225\245\347\261\273\345\236\2132.png" new file mode 100644 index 0000000000000000000000000000000000000000..1ad38251b4d9abba2076bfc2df91fa14c81ac07d Binary files /dev/null and "b/readme/figures/\347\255\226\347\225\245\347\261\273\345\236\2132.png" differ diff --git "a/readme/\345\205\254\345\205\261\345\237\272\347\241\200README.md" "b/readme/\345\205\254\345\205\261\345\237\272\347\241\200README.md" index 6d3220d47f40f56d32625b19c1263e0c968727fd..5d0c573366541439a8617b411cf9d04a59fd5e39 100755 --- "a/readme/\345\205\254\345\205\261\345\237\272\347\241\200README.md" +++ "b/readme/\345\205\254\345\205\261\345\237\272\347\241\200README.md" @@ -6,40 +6,39 @@ 公共基础库在不同平台上提供的能力: -- LiteOS-M平台:KV存储、文件操作、定时器、IoT外设控制 -- LiteOS-A平台:KV存储、定时器、ACE JS API +- LiteOS-M内核(Hi3861平台):KV存储、文件操作、定时器、IoT外设控制 +- LiteOS-A内核(Hi3516、Hi3518平台):KV存储、定时器、ACE JS API ## 目录 ``` -utils/native/lite/ # 公共基础库根目录 -├── file # 文件接口实现 -├── hals # HAL目录 -│ └── file # 文件操作硬件抽象层头文件 -├── include # 公共基础库对外接口文件 -├── js # ACE JS API目录 -│ └── builtin +utils/native/lite/ # 公共基础库根目录 +├── file # 文件接口实现 +├── hals # HAL目录 +│ └── file # 文件操作硬件抽象层头文件 +├── include # 公共基础库对外接口文件 +├── js # ACE JS API目录 +│ └── builtin │ ├── common -│ ├── deviceinfokit # 设备信息Kit -│ ├── filekit # 文件Kit -│ └── kvstorekit # KV存储Kit -├── kal # KAL目录 -│ └── timer # Timer的KAL实现 -├── kv_store # KV存储实现 -│ ├── innerkits # KV存储内部接口 -│ └── src # KV存储源文件 -└── timer_task # Timer实现 - -base/iot_hardware #IoT外设控制 -├── frameworks -│ └── wifiiot_lite #IoT外设控制模块实现 +│ ├── deviceinfokit # 设备信息Kit +│ ├── filekit # 文件Kit +│ └── kvstorekit # KV存储Kit +├── kal # KAL目录 +│ └── timer # Timer的KAL实现 +├── kv_store # KV存储实现 +│ ├── innerkits # KV存储内部接口 +│ └── src # KV存储源文件 +└── timer_task # Timer实现 + +base/iot_hardware #IoT外设控制 +├── frameworks +│ └── wifiiot_lite #IoT外设控制模块实现 ├── hals -│ └── wifiiot_lite #HAL适配层接口 +│ └── wifiiot_lite #HAL适配层接口 └── interfaces - └── kits #IoT外设控制模块接口 - + └── kits #IoT外设控制模块接口 vendor/hisi/hi3861/hi3861_adapter/hals/iot_hardware #IoT外设控制HAL层 -└── wifiiot_lite #HAL适配层接口实现 +└── wifiiot_lite #HAL适配层接口实现 ``` ## 约束 @@ -61,7 +60,7 @@ vendor/hisi/hi3861/hi3861_adapter/hals/iot_hardware #IoT外设控制HAL层

KV存储

LiteOS-M平台、LiteOS-A平台

+

LiteOS-M内核、LiteOS-A内核

为应用程序提供KV存储机制。

文件操作

LiteOS-M平台

+

LiteOS-M内核

提供统一的文件操作接口,屏蔽对底层不同芯片组件的差异。

定时器

LiteOS-M平台、LiteOS-A平台

+

LiteOS-M内核、LiteOS-A内核

提供统一的定时器操作接口,屏蔽对底层不同芯片组件的差异。

IoT外设控制

LiteOS-M平台

+

LiteOS-M内核

IoT外设控制模块提供对外围设备的操作能力。

- - - - @@ -87,7 +84,7 @@ OpenHarmony内核是华为推出面向IoT领域的实时操作系统内核,它 ## 约束 -系统启动默认使用jffs2的文件系统,该文件系统支持可读可写,若要使用其他文件系统,需要适配新增。 +Hi3518EV300默认使用jffs2文件系统,Hi3516DV300默认使用vfat文件系统。若要使用其他文件系统,需要新增适配。 ## 使用 @@ -95,11 +92,11 @@ OpenHarmony内核是华为推出面向IoT领域的实时操作系统内核,它 ## 涉及仓 -drivers\_liteos +[drivers_liteos](https://gitee.com/openharmony/drivers_liteos) -kernel\_liteos\_a +[kernel_liteos_a](https://gitee.com/openharmony/kernel_liteos_a) -kernel\_liteos\_a\_huawei\_proprietary\_fs\_proc +[kernel_liteos_a_huawei_proprietary_fs_proc](https://gitee.com/openharmony/kernel_liteos_a_huawei_proprietary_fs_proc) -kernel\_liteos\_m +[kernel_liteos_m](https://gitee.com/openharmony/kernel_liteos_m) diff --git "a/readme/\345\210\206\345\270\203\345\274\217\344\273\273\345\212\241\350\260\203\345\272\246\345\255\220\347\263\273\347\273\237README.md" "b/readme/\345\210\206\345\270\203\345\274\217\344\273\273\345\212\241\350\260\203\345\272\246\345\255\220\347\263\273\347\273\237README.md" index 6cf4b30117466a7473e650710da510b3b3bf01c2..b8ddb55f5f360eeebdcf91aef9bbe362325c50ea 100755 --- "a/readme/\345\210\206\345\270\203\345\274\217\344\273\273\345\212\241\350\260\203\345\272\246\345\255\220\347\263\273\347\273\237README.md" +++ "b/readme/\345\210\206\345\270\203\345\274\217\344\273\273\345\212\241\350\260\203\345\272\246\345\255\220\347\263\273\347\273\237README.md" @@ -2,9 +2,9 @@ ## 简介 -分布式任务调度模块,通过主(智慧屏设备)从设备(运动手表等小内存设备)服务代理机制,在异构操作系统上建立起分布式服务平台,支持OpenHarmony智慧屏与拉起其它OpenHarmony设备FA的能力。轻量分布式调度模块组成如下图所示: +分布式任务调度模块负责跨设备组件管理,提供访问和控制远程组件的能力,支持分布式场景下的应用协同。分布式调度模块组成如下图所示: -![](figures/zh-cn_image_0000001055199362.png) +![](figures/zh-cn_image_0000001055103250.png) ## 目录 @@ -21,17 +21,12 @@ - - - - - @@ -42,16 +37,16 @@ ``` ├── BUILD.gn ├── include -│ ├── distributed_schedule_service.h # 分布式调度对外接口文件 +│ ├── distributed_schedule_service.h # 分布式调度对外接口 │ ├── dmslite_check_remote_permission.h # 分布式调度权限管理模块 │ ├── dmslite_famgr.h # 分布式调度FA管理模块 -│ ├── dmslite_inner_common.h # 分布式调度服务文件 -│ ├── dmslite.h # 分布式调度实现 +│ ├── dmslite_inner_common.h # 分布式调度内部通用文件 +│ ├── dmslite.h # 分布式调度服务实现 │ ├── dmslite_log.h # 日志模块 -│ ├── dmslite_msg_parser.h # 通讯数据反序列化 +│ ├── dmslite_msg_parser.h # 分布式消息解析模块 │ ├── dmslite_tlv_common.h # TLV格式数据解析模块 -│ └── dmslite_session.h # 跨设备通信辅助文件 -├── README.md +│ └── dmslite_session.h # 跨设备通信收发模块 +├── readme.md ├── LICENSE ├── source ├── distributed_schedule_service.c @@ -65,67 +60,59 @@ ## 约束 -语言限制:C语言。 组网环境:必须确保设备在同一个局域网中。操作系统限制:OpenHarmony操作系统。 +**语言限制**:C/C++语言 + +**组网环境**:必须确保设备在同一个局域网中,主从设备能互相ping通 + +**操作系统限制**:OpenHarmony操作系统 **远程启动的约束与限制:** -- 支持远程启动FA,不支持远程启动SA。 -- 远程启动前必须确保主设备(智慧屏设备)与从设备间(运动手表等小内存设备)分布式组网成功(需要在同一网段内,可互相ping通),否则无法远程启动。 +- 支持远程启动FA,不支持远程启动SA +- 远程启动前必须确保主设备与从设备间分布式组网成功,否则无法远程启动 ## 使用 -**轻量级分布式调度模块编译** +- **轻量级分布式调度模块编译** -轻量级分布式调度模块通过一些特性宏来定制不同平台上参与编译的功能代码,该部分代码位于build\\lite\\config\\subsystem\\distributedschedule\\目录下,目录结构如下: +轻量级分布式调度模块,其代码所在目录如下: ``` -build/lite/config/subsystem/distributedschedule -├── BUILD.gn +foundation/distributedschedule/services/dtbschedmgr_lite ``` -在编译不同的平台目标时,需要使用对BUILD.gn进行修改,以下以平台hi3518ev300和hi3516dv300为例: +在针对不同平台进行编译时,需要在指定目标平台,以下以hi3516dv300为例: ``` -zlite_subsystem("distributedschedule") { - subsystem_components = [ - "//foundation/distributedschedule/services/samgr_lite:samgr", - ] - if (board_name == "hi3518ev300" || board_name == "hi3516dv300") { - subsystem_components += [ - "//foundation/distributedschedule/services/safwk_lite:safwk_lite", - "//foundation/distributedschedule/services/dtbschedmgr_lite:dtbschedmgr", // 轻量级分布式调度模块配置 - ] - } -} +python build.py ipcamera -p hi3516dv300_liteos_a ``` -**\* 主设备程序开发**(以拉起FA为例) +- **主设备程序开发**(以拉起FA为例) -构造want,首先使用ElementName类表明需要启动的远端设备ID,包名,元能力类名,传入want中,然后设置want中的分布式标志位Want.FLAG\_ABILITYSLICE\_MULTI\_DEVICE表示需要远程启动。 +构造意图参数want,设置需要启动的远端设备ID,包名,元能力类名信息,以及分布式标志位Want.FLAG\_ABILITYSLICE\_MULTI\_DEVICE以使能分布式启动 ``` -// 引入相关头文件 import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Want; import ohos.bundle.ElementName; -// 启动远程设备FA -Want want = new Want(); // 封装启动远端FA的Want -ElementName name = new ElementName("remote_device_id", "com.huawei.remote_package_name","remote_class_name"); +// 构造want参数 +Want want = new Want(); +ElementName name = new ElementName(remote_device_id, "com.huawei.remote_bundle_name", "remote_ability_name"); want.setElement(name); // 将待启动的FA信息添加到Want中 want.setFlags(Want.FLAG_ABILITYSLICE_MULTI_DEVICE); // 设置分布式标记,若不设置将无法使用分布式能力 -startAbility(want); // 按照Want启动指定FA,Want参数命名以实际开发平台API为准 -``` -**\* 预置条件** +// 启动远程设备FA +startAbility(want); // 按照Want启动指定FA,want参数命名以实际开发平台API为准 +``` -**主从设备间组网**:远程启动前必须确保主从设备分布式组网成功(需要在同一网段内,可互相ping通),否则无法远程启 +- **预置条件** -**从设备FA安装:**安装测试或者自开发的FA到从设备 +从设备侧需安装对应包名的FA -**\* 运行**(以拉起FA为例) +- **运行**(以拉起FA为例) -执行主设备(智慧屏)侧的startAbility即可拉起从设备(运动手表等小内存设备)FA +执行主设备侧的startAbility即可拉起从设备FA ## 涉及仓 diff --git "a/readme/\345\220\257\345\212\250\346\201\242\345\244\215README.md" "b/readme/\345\220\257\345\212\250\346\201\242\345\244\215README.md" index 96725f0b5634104b0817673fa42eb755baf5f257..51b3eb02573cc51a0077e7af6c6545a99c58648f 100755 --- "a/readme/\345\220\257\345\212\250\346\201\242\345\244\215README.md" +++ "b/readme/\345\220\257\345\212\250\346\201\242\345\244\215README.md" @@ -2,7 +2,7 @@ ## 简介 -启动恢复负责在内核启动之后,应用启动之前的操作系统中间层的启动。涉及以下模块: +启动恢复负责在内核启动之后到应用启动之前的系统关键进程和服务的启动过程。涉及以下模块: - init启动引导 @@ -139,7 +139,7 @@ vendor - init启动引导的配置文件 -启动引导模块配置文件包含了所有需要由init进程启动的系统关键服务的服务名、可执行文件路径、权限和其他属性信息,该文件位于代码仓库/vendor/huawei/camera/init\_configs/目录,部署在/etc/下,文件名称为init.cfg,采用json格式,文件大小目前限制在10KB以内。 +启动引导模块配置文件包含了所有需要由init进程启动的系统关键服务的服务名、可执行文件路径、权限和其他属性信息,该文件位于代码仓库/vendor/huawei/camera/init\_configs/目录,部署在/etc/下,文件名称为init.cfg,采用json格式,文件大小目前限制在100KB以内。 init进程启动后首先读取/etc/init.cfg,然后解析其json内容,并根据解析结果依次加载系统服务。配置文件格式和内容说明如下所示: diff --git "a/readme/\345\252\222\344\275\223\345\255\220\347\263\273\347\273\237README.md" "b/readme/\345\252\222\344\275\223\345\255\220\347\263\273\347\273\237README.md" index 781942e0002162f2ef4847cab3fca85bd924039e..cecd0977ca9cbdd4e55d80b5dccb16701b1564d4 100755 --- "a/readme/\345\252\222\344\275\223\345\255\220\347\263\273\347\273\237README.md" +++ "b/readme/\345\252\222\344\275\223\345\255\220\347\263\273\347\273\237README.md" @@ -2,9 +2,7 @@ ## 简介 -该仓主要用于存放媒体子系统的源码信息,旨在为多媒体应用开发者开发者提供统一的开发接口,使得开发者可以专注于应用业务的开发,轻松使用多媒体的资源。 - -本次开源基于本仓代码信息将相关设备配置文件放入到test\\lite\\devini内,用户使用时将配置文件放入到开发板/data目录,通过该配置文件可以方便去适配sensor及分辨率帧率等能力。 +该仓主要用于存放媒体子系统的源码信息,旨在为多媒体应用开发者开发者提供统一的开发接口,使得开发者可以专注于应用业务的开发,轻松使用多媒体的资源。下图分别展现媒体子系统的框架及业务流程。 多媒体子系统框架 @@ -14,7 +12,7 @@ ![](figures/zh-cn_image_0000001052440794.png) -如上图,多媒体包括camera,recorder和player,camera提供yuv/rgb,jpeg以及H264,H265数据到共享内存surface中,recorder模块将surface中h264/h265数据和音频aac数据打包成mp4文件,player模块把mp4文件解复用成音频和视频数据,分别送入对应编码器解码,然后进行播放。 +如上图,多媒体包括camera,recorder和player,camera提供YUV、RGB、JPEG以及H264,H265数据到共享内存surface中,recorder模块将surface中h264/h265数据和音频aac数据打包成mp4文件,player模块把mp4文件解复用成音频和视频数据,分别送入对应编码器解码,然后进行播放。 ## 目录 @@ -29,27 +27,27 @@ - - - - - @@ -59,18 +57,20 @@ - C++11版本或以上 - 目前支持3516dv300、3518ev300开发板,其中仅3516dv300支持播放功能 +- 当前3516dv300开发板默认支持索尼imx335、3518ev300默认支持晶相jxf23。 ## 安装 - 请提前加载内核及相关驱动,参考内核及驱动子系统readme。 -- 配置合适的配置文件,可以参考test/devini下配置文件,说明参见《配置文件说明文档》,当前仅支持imx335和imx327sensor,如果适配其他sensor可在开源社区中求助。 -- 北向接口调用参见test下demo实现。 +- 配置合适的配置文件,可以参考applications/sample/camera/media下配置文件,如果适配其他sensor可在开源社区中求助。用户使用时将配置文件放入到开发板/storage/data目录,开发者通过该配置文件可以去适配sensor及分辨率、帧率等能力。 +- 应用接口调用参见applications/sample/camera/media下demo实现。 ## 使用 -开发者使用多媒体接口用于录像、预览和播放音视频等资源,使用这些资源前先创建camerakit组件对象,注册各种事件回调,这些事件回调是用户实现用来响应多媒体模块中事件响应的,之后调用创建camera就可以创建一个操作camera资源的对象,使用这个对象可以启动预览、录像或抓拍取流,及设置取流的相关参数。 - +Native应用接口调用可以参考applications/sample/camera/media下demo实现 +应用开发者使用多媒体接口实现录像、预览和播放音视频,使用可以参考《多媒体开发指南》。 例:下面是用户重写事件类的实例 +用户先创建camerakit组件对象,注册各种事件回调,这些事件回调是用户实现用来响应多媒体模块中事件响应的,之后调用创建camera就可以创建一个操作camera资源的对象,使用这个对象可以启动预览、录像或抓拍取流,及设置取流的相关参数。 ``` /* diff --git "a/readme/\345\256\211\345\205\250\345\255\220\347\263\273\347\273\237README.md" "b/readme/\345\256\211\345\205\250\345\255\220\347\263\273\347\273\237README.md" index 8138f6596c8cac2f197bb234938cccf9cef51149..ec7b36ea2b5463497aeb5631cc1133dfa7b6bd6d 100755 --- "a/readme/\345\256\211\345\205\250\345\255\220\347\263\273\347\273\237README.md" +++ "b/readme/\345\256\211\345\205\250\345\255\220\347\263\273\347\273\237README.md" @@ -39,7 +39,7 @@ x509镜像包生成:参考编译构建子系统编译方式,执行编译生 ## 应用权限管理 -应用权限是软件用来访问系统资源和使用系统能力的一种通行方式,存在涉及个人隐私相关功能和数据的场景,例如:访问个人设备的硬件特性,如摄像头、麦克风,以及获取个人数据,如通讯录,日历等存储的信息等。操作系统通过应用权限管理来保护这些数据以及能力。 +应用权限是软件用来访问系统资源和使用系统能力的一种通行方式,存在涉及个人隐私相关功能和数据的场景,例如:访问个人设备的硬件特性,如摄像头、麦克风,以及读写媒体文件等。操作系统通过应用权限管理来保护这些数据以及能力。 权限定义字段说明: @@ -64,7 +64,6 @@ x509镜像包生成:参考编译构建子系统编译方式,执行编译生 @@ -85,19 +84,28 @@ x509镜像包生成:参考编译构建子系统编译方式,执行编译生 ## IPC通信鉴权 - 在Samgr中注册的系统服务如果通过进程间通信的方式暴露接口给其他进程访问,需要配置相应的访问控制策略。若不进行相关配置,访问会被拒绝。 -- 配置方式:在头文件base/security/services/iam\_lite/include/policy\_preset.h中配置访问策略。1. 定义各个Feature的策略 2. 将Feature的策略加到全局策略中 +- 配置方式:在头文件base/security/services/iam\_lite/ipc\_auth/include/policy\_preset.h中配置访问策略。 + + 1. 定义各个Feature的策略 + + 2. 将Feature的策略加到全局策略中 + Eg. 比如当前需要为BMS服务配置访问策略,BMS在Samgr中注册的service为bundlems,注册的Feature为BmsFeature。 -一、首先定义Feature的策略,可配置多个Feature,每个Feature可以配置多个访问策略,策略的声明方式参考图2 +一、首先定义Feature的策略,可配置多个Feature,每个Feature可以配置多个访问策略,策略的声明方式参考图1 **图 1** Feature策略示例 -![](figures/Feature策略示例.png "Feature策略示例") + + +![](figures/bms策略举例.png) 访问策略有三种类型: **图 2** 访问策略结构体 -![](figures/访问策略结构体.png "访问策略结构体") + + +![](figures/策略类型2.png) 1. type为RANGE类型:允许某个特定范围UID的进程访问,需要指定uidMin和uidMax @@ -105,38 +113,38 @@ Eg. 比如当前需要为BMS服务配置访问策略,BMS在Samgr中注册的s 3. type为BUNDLENAME类型:只允许特定的应用访问,需要指定bundleName(包名) -二、将定义的Feature的策略加配到全局策略中,需要配置feature数量,注册参考图4 +二、将定义的Feature的策略加配到全局策略中,需要配置feature数量,注册参考图3 **图 3** feature策略注册 -![](figures/feature策略注册.png "feature策略注册") + + +![](figures/全局策略2.png) UID分配规则 -1. Init/foundation进程:0 +1. Init进程:0 2. appspawn进程:1 3. Shell进程:2 -4. kitfw进程:3 +4. 其他内置系统服务UID <= 99 -5. 其他内置服务向后递增…最多到99 +5. 系统应用(如设置、桌面、相机):100 \~ 999 -6. 系统应用(如settings):100 \~ 999 +6. 预置厂商应用:1000 \~ 9999 -7. 预置厂商应用(如钱包、淘宝):1000 \~ 9999 - -8. 普通三方应用:10000 \~ INT\_MAX +7. 普通三方应用:10000 \~ INT\_MAX ## HUKS -在分布式场景下,不同终端设备的硬件能力和运行系统环境都不尽相同,这些设备在分布式场景下,均需要建立信任关系,最典型的应用即是HiChain可信互联。那么就需要这样一个统一的密钥管理服务,来做到接口一致,密钥数据格式一致,同时提供业界标准的加解密算法实现。HUKS基于此来提供统一的密钥管理、加解密等能力。 +在分布式场景下,不同终端设备的硬件能力和运行系统环境都不尽相同。这些设备在分布式场景下均需要建立信任关系,最典型的应用即是HiChain可信互联,那么就需要这样一个统一的密钥管理服务来做到接口一致,密钥数据格式一致,同时提供业界标准的加解密算法实现。HUKS基于此来提供统一的密钥管理、加解密等能力。 HUKS模块整体分为北向接口,南向适配层,以及核心的功能模块: -1. HUKS 北向接口:提供统一的对外API,用C语言实现,保持所有设备一致;主要包括密钥生成API、加解密API等; -2. HUKS Core Module:依赖HAL层,提供核心功能:加解密、签名验签、密钥存储等; -3. HUKS HAL层:屏蔽底层硬件和OS的差异,定义HUKS需要的统一底层API。主要包括平台算法库、IO和LOG等; +1. HUKS 北向接口:提供统一的对外API,用C语言实现,保持所有设备一致,主要包括密钥生成API、加解密API等; +2. HUKS Core Module:依赖HAL层,提供核心功能,如加解密、签名验签、密钥存储等; +3. HUKS HAL层:屏蔽底层硬件和OS的差异,定义HUKS需要的统一底层API,主要包括平台算法库、IO和LOG等。 ## HiChain @@ -232,12 +240,11 @@ OpenHarmony应用安装服务通过校验应用签名验证应用完整性,通 - **应用发布场景** - 开发者向华为应用市场发布应用,需要用应用市场签发的应用软件发布证书和应用软件发布profile对应用进行签名。如下图,应用软件发布证书和发布profile的申请方式类似于开发者证书和调试profile申请(支持使用调试场景同一对公私钥对)。使用应用发布证书签名的应用不允许直接在设备中安装,需要上架应用市场审核。审核通过的应用,应用市场将使用应用市场发布证书对应用进行重签名,重签名后的应用才可以被用户下载、安装。 - - OpenHarmony应用安装服务通过验证应用签名,保证应用软件完整性,通过校验签名证书是否为华为应用市场应用签名证书,保证应用来源可信。 +开发者向华为应用市场发布应用,需要用应用市场签发的应用软件发布证书和应用软件发布profile对应用进行签名。如下图,应用软件发布证书和发布profile的申请方式类似于开发者证书和调试profile申请(支持使用调试场景同一对公私钥对)。使用应用发布证书签名的应用不允许直接在设备中安装,需要上架应用市场审核。审核通过的应用,应用市场将使用应用市场发布证书对应用进行重签名,重签名后的应用才可以被用户下载、安装。 - ![](figures/zh-cn_image_0000001051562162.png) +OpenHarmony应用安装服务通过验证应用签名,保证应用软件完整性,通过校验签名证书是否为华为应用市场应用签名证书,保证应用来源可信。 +![](figures/zh-cn_image_0000001051562162.png) ## 涉及仓 diff --git "a/readme/\346\265\213\350\257\225\345\255\220\347\263\273\347\273\237README.md" "b/readme/\346\265\213\350\257\225\345\255\220\347\263\273\347\273\237README.md" index d02604e98a8be295814b48938983761a5cefad55..e9f54ff7ea793afa9e80314d13bb899f70122394 100755 --- "a/readme/\346\265\213\350\257\225\345\255\220\347\263\273\347\273\237README.md" +++ "b/readme/\346\265\213\350\257\225\345\255\220\347\263\273\347\273\237README.md" @@ -2,11 +2,11 @@ ## 简介 -开发过程采用测试驱动开发模式,开发者基于系统新增特性可以通过开发者自己开发用例保证,对于系统已有特性的修改,也可通过修改项目中原有自测试用例保证,开发者自测试旨在帮助开发者在开发阶段就能开发出高质量代码 +开发过程采用测试驱动开发模式,开发者基于系统新增特性可以通过开发者自己开发用例保证,对于系统已有特性的修改,也可通过修改项目中原有的测试用例保证,开发者测试旨在帮助开发者在开发阶段就能开发出高质量代码 ## 目录 -**表 1** 开发者自测试工具源代码目录结构 +**表 1** 开发者测试工具源代码目录结构

名称

@@ -72,14 +74,9 @@ OpenHarmony内核是华为推出面向IoT领域的实时操作系统内核,它

系统调用。

test

-

内核和用户态的测试用例。

-

tools

编译配置和menuconfig相关的代码。

+

构建工具及相关配置和代码。

dtbschedmgr_lite

轻量级分布式任务调度实现。

+

分布式任务调度实现

safwk_lite

系统服务进程实现。

-

samgr_lite

-

本地服务管理实现。

+

foundation进程实现

foundation\multimedia\frameworks

北向接口内部框架实现,包括audio,camera,player.recorder

+

内部框架实现,包括audio,camera,player.recorder

foundation\multimedia\interfaces\kits

北向接口对外头文件

+

应用接口对外头文件

foundation\multimedia\services\media_lite

北向接口底层服务实现

+

应用接口底层服务实现

foundation\multimedia\utils\lite

北向接口通用模块实现

+

应用接口通用模块实现

foundation\multimedia\test\lite

北向接口测试代码。

+

应用接口测试代码。

多语言字符串id

应用申请此权限的目的。

-

上架审核、弹框授权、用户管理权限时使用到

used-scene{

@@ -76,7 +75,7 @@ x509镜像包生成:参考编译构建子系统编译方式,执行编译生

when:inuse, always

调用受此权限管控的接口的场景。

-

声明在哪些组件下、以及是否前台还是前后台都会去调用受权限管控的接口

+

声明在哪些组件和场景(前台/后台)下调用受管控的接口。

- - - - @@ -130,31 +130,31 @@ 依赖python环境: -需要本地的python安装串口插件pyserial,在shell界面执行安装命令pip intall pyserial,安装成功如下图 +需要本地的python安装串口插件pyserial以及readline,在shell界面执行安装命令分别为pip intall pyserial和sudo apt-get install libreadline-dev,安装成功如下图 ![](figures/zh-cn_image_0000001052278423.png) ## 编写测试用例 -- 自测试用例规范 +- 测试用例规范 - 命名规范 测试用例源文件名称和测试套内容保持一致,测试套与用例之间关系1:N,测试套与测试源文件之间关系1:1,每个源文件全局唯一,格式:\[特性\]\_\[功能\]\_\[子功能1\]\_\[子功能1.1\],子功能支持向下细分。 - 文件命名采用大驼峰方式命名,以Test结尾,如demo用例:developertest/example/cxx\_demo + 文件命名采用全小写+下划线方式命名,以test结尾,如demo用例:developertest/example/cxx\_demo - - 用例编码规范 + - 测试用例编码规范 - 开发者自测试用例原则上与特性代码编码规范保持一致,另外需要添加必要的用例描述信息,详见[•自测试用例模板](#li2069415903917) + 开发者测试用例原则上与特性代码编码规范保持一致,另外需要添加必要的用例描述信息,详见[•自测试用例模板](#li2069415903917) - 测试用例编译配置规范 - 用例采用GN方式编译,配置遵循本开源项目的编译指导[使用](zh-cn_topic_0000001051580775.md) + 测试用例采用GN方式编译,配置遵循本开源项目的编译指导[使用](zh-cn_topic_0000001051580775.md) -- 自测试用例模板 +- 测试用例模板 - 详见测试demo用例developertest/example/cxx\_demo/test/unittest/common/calc\_subtraction\_test.cpp + 详见测试demo用例:developertest/example/cxx\_demo/test/unittest/common/calc\_subtraction\_test.cpp >![](public_sys-resources/icon-note.gif) **说明:** >Feature: 被测特性的描述 @@ -165,7 +165,7 @@ >CaseDescription:测试用例描述 >step:测试复杂逻辑时注明用例执行的步骤 -- 自测试用例目录规划 +- 测试用例目录规划 ``` subsystem(子系统,系统组件) @@ -194,13 +194,13 @@ >![](public_sys-resources/icon-note.gif) **说明:** >其中liteos和Linux仅不同设备形态举例,对于同一特性在不同开发板上,如果用例没有差异,则用例放置common目录下,如果同一特性,用例区分不同设备形态,可能包含内核差异,芯片平台差异,则用例以目录区分 -- 编写自测试用例步骤 - 1. 添加用例文件头注释说明 +- 编写测试用例步骤 + 1. 添加测试用例文件头注释信息 2. 引用gtest头文件和ext命名空间 - 3. 添加被测试类头文件 + 3. 添加被测试类的头文件 4. 定义测试套(测试类) 5. 实现该测试套具体的测试用例,包括用例注释和用例逻辑实现 - 6. 编写用例编译配置 + 6. 编写测试用例编译配置 >![](public_sys-resources/icon-note.gif) **说明:** >\*样例参考:developertest/example/cxx\_demo/test/unittest/common/calc\_subtraction\_test.cpp @@ -211,15 +211,15 @@ >d、使用printf函数打印日志 -- 编写用例编译文件 - - 定义用例编译构建目标 - 1. 添加用例编译文件头注释信息 - 2. 导入用例编译模板文件 - 3. 指定用例文件输出路径 - 4. 配置用例编译依赖包含目录 - 5. 指定用例编译目标输出的用例执行文件名称 - 6. 编写具体的用例编译脚本(添加需要参与编译的源文件、配置和依赖 ) - 7. 对目标用例文件进行条件分组(分组名称固定为:unittest/moduletest\) +- 编写测试用例编译文件 + - 定义测试用例编译构建目标 + 1. 添加测试用例编译文件头注释信息 + 2. 导入测试用例编译模板文件 + 3. 指定测试用例文件的输出路径 + 4. 配置测试用例编译依赖包含目录 + 5. 指定测试用例编译目标输出的文件名称 + 6. 编写具体的测试用例编译脚本(添加需要参与编译的源文件、配置和依赖 ) + 7. 对目标测试用例文件进行条件分组(分组名称固定为:unittest/moduletest\) - 如果存在多个测试套,定义公共编译配置 - 将测试用例添加到构建系统中 @@ -229,16 +229,16 @@ - 测试用例级别定义 - - 基本(Level1):<1s - - 重要(Level2):<10s - - 一般(Level3):<5min - - 生僻(Level4):\>5min + - 基本(Level1) + - 重要(Level2) + - 一般(Level3) + - 生僻(Level4) ## 使用测试框架 - 安装xdevice基础框架 - 1. 以Windows环境为例,打开xdevice安装目录:test\\xdevice + 1. 以Windows环境为例,打开xdevice安装目录:test/xdevice 2. 打开控制台窗口,执行如下命令 ``` @@ -292,14 +292,14 @@ ``` -- 执行自测试用例前的环境检查 +- 执行测试用例前的环境检查 - 系统镜像与文件系统已烧录进开发板,开发板上系统正常运行,在系统模式下,如shell登录时设备提示符OHOS\# - 开发主机和开发板串口连接正常,网口连接正常 - 开发主机IP与开发板IP处在同一小网网段,相互可以ping通 - 开发主机侧创建空目录用于开发板通过NFS挂载测试用例,并且NFS服务启动正常 - 运行测试套 - - 启动测试框架 + - 启动测试框架,打开test/developertest目录 1. Windows环境启动测试框架 ``` @@ -318,24 +318,28 @@ 根据实际的开发板选择,设备形态配置:developertest/src/core/resource/config/framework\_config.xml - 执行测试指令 - 1. 执行测试指令示例,其中-t ut为必选,-ss和-tm为可选字段 + 1. 查询测试用例支持的子系统,模块,产品形态以及测试类型,使用show命令 + + ``` + usage: + show productlist Querying Supported Product Forms + show typelist Querying the Supported Test Type + show subsystemlist Querying Supported Subsystems + show modulelist Querying Supported Modules + ``` + + 2. 执行测试指令示例,其中-t为必选,-ss和-tm为可选字段 ``` run -t ut -ss test -tm example ``` - 2. 参数说明:指定参数可以执行特定特性、模块对应的测试套 + 3. 参数说明:指定参数可以执行特定特性、模块对应的测试套 ``` usage: run [-h] [-p PRODUCTFORM] [-t [TESTTYPE [TESTTYPE ...]]] [-ss SUBSYSTEM] [-tm TESTMODULE] [-ts TESTSUIT] - [-tc TESTCASE] [-tl TESTLEVEL] [-os TARGET_OS_NAME] - [-bv BUILD_VARIANT] [-b [BUILD [BUILD ...]]] - [-cov COVERAGE] [-tf TESTFILE] [-res RESOURCE] - [-sn DEVICE_SN] [-c CONFIG] [-rp REPORTPATH] [-e EXECTYPE] - [-td TEST_DRIVER] - action Specify test para.positional arguments: - action Specify action + [-tc TESTCASE] [-tl TESTLEVEL] optional arguments: -h, --help show this help message and exit @@ -360,6 +364,15 @@ +- 退出自测试平台 + - 退出自测试平台,使用如下命令退出测试平台 + + ``` + quit + ``` + + + ## 测试结果与日志 - 通过在测试框架中执行测试指令,即可以生成测试日志和测试报告 diff --git "a/readme/\347\224\250\346\210\267\347\250\213\345\272\217\346\241\206\346\236\266\345\255\220\347\263\273\347\273\237README.md" "b/readme/\347\224\250\346\210\267\347\250\213\345\272\217\346\241\206\346\236\266\345\255\220\347\263\273\347\273\237README.md" index 68d4940745caf1e12f23609e52da7a8df96e44db..f0df35c2c0d1f8e61c0ac0f6f897093825ef424a 100644 --- "a/readme/\347\224\250\346\210\267\347\250\213\345\272\217\346\241\206\346\236\266\345\255\220\347\263\273\347\273\237README.md" +++ "b/readme/\347\224\250\346\210\267\347\250\213\345\272\217\346\241\206\346\236\266\345\255\220\347\263\273\347\273\237README.md" @@ -13,7 +13,7 @@ - **AbilityKit**是Ability框架提供给开发者的开发包,开发者基于该开发包可以开发出基于Ability组件的应用。基于Ability组件开发的应用有两种类型:基于Javascript语言开发的Ability(**JS Ability**)和基于C/C++语言开发的Ability(**Native Ability**)。**JS应用开发框架**是开发者开发JS Ability所用到框架,是在AbilityKit基础封装的包含js UI组件的一套方便开发者能够迅速开发Ability应用的框架。 - **Ability**是系统调度应用的最小单元,是能够完成一个独立功能的组件,一个应用可以包含一个或多个Ability。Ability分为两种类型:Page类型的Ability和Service类型的Ability - - **Page类型的Ability**:带有界面,为用户提供人机交互的能力。 + - **Page类型的Ability:**带有界面,为用户提供人机交互的能力。 - **Service类型的Ability**:不带界面,为用户提供后台任务机制。 - **AbilitySlice**是单个页面及其控制逻辑的总和,是Page类型Ability特有的组件,一个Page类型的Ability可以包含多个AbilitySlice,此时,这些页面提供的业务能力应当是高度相关的。Page类型的Ability和AbilitySlice的关系如下图2所示: @@ -31,7 +31,7 @@ - **UNINITIALIZED**:未初始状态,为临时状态,Ability被创建后会由UNINITIALIZED状态进入INITIAL状态; - - **INITIAL**:初始化状态,也表示停止状态,表示当前Ability未运行,调用Start后进入INACTIVE,同时回调开发者的OnSatrt生命周期回调; + - **INITIAL**:初始化状态,也表示停止状态,表示当前Ability未运行,调用Start后进入INACTIVE,同时回调开发者的OnStart生命周期回调; - **INACTIVE**:未激活状态,表示当前窗口已显示但是无焦点状态,由于Window暂未支持焦点的概念,当前状态与ACTIVE一致。 @@ -42,16 +42,16 @@ - **AbilityLoader**负责注册和加载开发者Ability的模块。开发者开发的Ability先要调用AbilityLoader的注册接口注册到框架中,接着Ability启动时会被实例化。 - **AbilityManager**负责AbilityKit和Ability管理服务进行IPC的通信。 -- **EvenHandler**是AbilityKit提供给开发者的用于在Ability中实现线程间通信的一个模块。 +- **EventHandler**是AbilityKit提供给开发者的用于在Ability中实现线程间通信的一个模块。 - **Ability运行管理服务**是用于协调各Ability运行关系、及生命周期进行调度的系统服务。其中,**服务启动**模块负责Ability管理服务的启动、注册等。**服务接口管理模块**负责Ability管理服务对外能力的管理。**进程管理模块**负责Ability应用所在进程的启动和销毁、及其进程信息维护等功能。**Ability栈管理模块**负责维护各个Ability之间跳转的先后关系。**生命周期调度模块**是Ability管理服务根据系统当前的操作调度Ability进入相应的状态的模块**。连接管理模块**是Ability管理服务对Service类型Ability连接管理的模块。 - **AppSpawn**是负责创建Ability应用所在进程的系统服务,该服务有较高的权限,为Ability应用设置相应的权限,并预加载一些通用的模块,加速应用的启动。 -**2. 包管理子系统**,是HarmonyOS为开发者提供的安装包管理框架。包管理子系统的由如下图4模块组成: +**2. 包管理子系统**,是OpenHarmony为开发者提供的安装包管理框架。包管理子系统的由如下图4模块组成: **图 4** 包管理子系统框架图 ![](figures/包管理子系统框架图.png "包管理子系统框架图") -- **BundleKit**:是包管理服务对外提供的接口,有安装/卸载接口、包信息查询接口、包状态变化监听接口。 +- **BundleKit:**是包管理服务对外提供的接口,有安装/卸载接口、包信息查询接口、包状态变化监听接口。 - **包扫描器**:用来解析本地预制或者安装的安装包,提取里面的各种信息,供管理子模块进行管理,持久化。 - **包安装子模块**:安装,卸载,升级一个包;**包安装服务**一个单独进程的用于创建删除安装目录,具有较高的权限。 @@ -115,7 +115,7 @@ -

名称

@@ -17,7 +17,7 @@

developertest

开发自测试框架

+

开发测试框架

developertest/src

@@ -32,7 +32,7 @@

developertest/src/core/build

自测试用例编译

+

测试用例编译

developertest/src/core/command

@@ -107,12 +107,12 @@

developertest/start.bat

开发者自测试入口(Windows)

+

开发者测试入口(Windows)

developertest/start.sh

开发者自测试入口(Linux)

+

开发者测试入口(Linux)

foundation/appexecfwk/interfaces/innerkits/bundlemgr_lite

AbilityKit实现的核心代码,及包管理服务为其它子系统提供的接口

+

BundleKit实现的核心代码,及包管理服务为其它子系统提供的接口

foundation/appexecfwk/frameworks/bundle_lite

@@ -226,12 +226,12 @@ - 添加完上述的配置后,执行如下命令编译整个系统: ``` -python build.py ipcamera -p hi3516dv300_liteos_a -b debug +python build.py ipcamera_hi3516dv300 -b debug ``` ## 运行用户程序框架子系统的两个服务 -- 用户程序框架有两个系统服务ability管理服务(abilityms)和(bundlems),两系统服务运行于foudation进程中。 +- 用户程序框架有两个系统服务ability管理服务(abilityms)和(bundlems),两系统服务运行于foundation进程中。 - abilityms和bundlems注册到sa\_manager中,sa\_manager运行于foundation进程中,sa\_manager为abilityms和bundlems创建线程运行环境。具体创建abilityms、bundlems服务的方式以及使用该服务的方式,可参考[系统服务框架子系统](zh-cn_topic_0000001051589563.md)。 - 在foundation/distributedschedule/services/safwk\_lite/BUILD.gn中添加对abilityms和bundlems,如下: @@ -248,78 +248,93 @@ deps = [ ## 运行基于AbilityKit开发的Ability -- 基于AbilityKit开发的Ability的Demo代码位于foundation/aafwk/frameworks/kits/ability\_lite/test路径下,如有需要修改其中的功能,可在unittest的文件中修改代码或增加代码文件,并在BUILD.gn中做相应的修改。 -- 编译该Demo,在shell中执行如下命令,编译成功后,在out/ipcamera\_hi3516dv300\_liteos\_a下面生成libLauncher.so文件: +- 基于AbilityKit开发的Ability的Demo代码位于foundation/aafwk/frameworks/ability\_lite/example路径下,如有需要修改其中的功能,可在entry/src/main/cpp的文件中修改代码或增加代码文件,并在BUILD.gn中做相应的修改。 +- 在build/lite/config/subsystem/aafwk/BUILD.gn中添加对ability Demo编译配置: ``` - python build.py ipcamera -p hi3516dv300_liteos_a -T //foundation/aafwk/frameworks/kits/ability_lite/test:Launcher + import("//build/lite/config/subsystem/lite_subsystem.gni") + + lite_subsystem("aafwk") { + subsystem_components = [ + "......", + "//foundation/aafwk/frameworks/ability_lite/example:hiability", + "......", + ] + } ``` -- 编写config.json,内容如下: +- 编译该Demo,在shell中执行如下命令,编译成功后,在out/ipcamera\_hi3516dv300\_liteos\_a/dev\_tools/example下面生成libhiability.so文件: -``` -{ - "app": { - "bundleName": "com.huawei.launcher", - "vendor": "huawei", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 3, - "target": 3 - } - }, - "deviceConfig": { - "default": { - "keepAlive": false - }, - }, - "module": { - "deviceType": [ - "smartVision" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "Launcher", - "moduleType": "entry" - }, - "abilities": [{ - "name": "MainAbility", - "icon": "assets/entry/resources/base/media/icon.png", - "label": "test app 1", - "launchType": "standard", - "type": "page", - "visible": true + ``` + python build.py ipcamera_hi3516dv300 -b debug + ``` + +- 编写config.json,参见foundation/aafwk/frameworks/ability\_lite/example路径下的config.josn,内容如下: + + ``` + { + "app": { + "bundleName": "com.huawei.hiability", + "vendor": "huawei", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 3, + "target": 3 + } }, - { - "name": "SecondAbility", - "icon": "assets/entry/resources/base/media/icon.png", - "label": "test app 2", - "launchType": "standard", - "type": "page", - "visible": true + "deviceConfig": { + "default": { + "keepAlive": false + }, }, - { - "name": "ServiceAbility", - "icon": "", - "label": "test app 2", - "launchType": "standard", - "type": "service", - "visible": true + "module": { + "deviceType": [ + "smartVision" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "hiability", + "moduleType": "entry" + }, + "abilities": [{ + "name": "MainAbility", + "icon": "assets/entry/resources/base/media/icon.png", + "label": "test app 1", + "launchType": "standard", + "type": "page", + "visible": true + }, + { + "name": "SecondAbility", + "icon": "", + "label": "test app 2", + "launchType": "standard", + "type": "page", + "visible": true + }, + { + "name": "ServiceAbility", + "icon": "", + "label": "test app 2", + "launchType": "standard", + "type": "service", + "visible": true + } + ] } - ] } -} -``` + ``` + - 生成hap包 - 按照如下目录结构存放文件,assets/entry/resources/base/media下面放置资源文件: - ![](figures/zh-cn_image_0000001055712348.png) + ![](figures/zh-cn_image_0000001055267336.png) - - 将上述文件打包生成zip包,修改后缀为.hap,例如Launcher.hap + - 将上述文件打包生成zip包,修改后缀为.hap,例如hiability.hap - 安装hap包 @@ -327,13 +342,13 @@ deps = [ - 执行安装命令,安装hap包: ``` - ./bin/bm install -p /nfs/hap/Launcher.hap + ./bin/bm install -p /nfs/hap/hiability.hap ``` - 安装完成后,通过如下命令,运行Demo ``` -./bin/aa start -p com.huawei.launcher -n MainAbility +./bin/aa start -p com.huawei.hiability -n MainAbility ``` ## 涉及仓 diff --git "a/readme/\347\263\273\347\273\237\346\234\215\345\212\241\346\241\206\346\236\266\345\255\220\347\263\273\347\273\237README.md" "b/readme/\347\263\273\347\273\237\346\234\215\345\212\241\346\241\206\346\236\266\345\255\220\347\263\273\347\273\237README.md" index 8acae2fb4728d9efac20487a364fc80c02b68c30..ae6c3939d8c30b76e2c00e9b151e5678af248653 100755 --- "a/readme/\347\263\273\347\273\237\346\234\215\345\212\241\346\241\206\346\236\266\345\255\220\347\263\273\347\273\237README.md" +++ "b/readme/\347\263\273\347\273\237\346\234\215\345\212\241\346\241\206\346\236\266\345\255\220\347\263\273\347\273\237README.md" @@ -106,7 +106,7 @@ Samgr:做为中介者,管理Provider提供的能力,同时帮助Consumer 服务名和功能名必需使用常量字符串且长度小于16个字节。 -M核:系统依赖上bootstrap服务,在系统启动函数中调用HOS\_SystemInit\(\)函数。 +M核:系统依赖上bootstrap服务,在系统启动函数中调用OHOS\_SystemInit\(\)函数。 A核:系统依赖samgr库,在main函数中调用SAMGR\_Bootstrap\(\)函数。 @@ -622,7 +622,7 @@ A核:系统依赖samgr库,在main函数中调用SAMGR\_Bootstrap\(\)函数 ## 涉及仓 -distributedschedule\_interfaces\_innerkits\_samgr\_lite +distributedschedule\_interfaces\_kits\_samgr\_lite distributedschedule\_services\_samgr\_lite