diff --git a/ability/LICENSE b/ability/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/ability/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/ability/README.md b/ability/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4f6fcd21a90007e0485383e9c5bc9d7dbc0dd975 --- /dev/null +++ b/ability/README.md @@ -0,0 +1,216 @@ +# 介绍 + +## 简介 + +**轻量级元能力框架子系统**,是OpenHarmony为开发者提供的一套开发鸿蒙应用的开发框架。轻量级元能力框架子系统由如下模块组成: + +**图1** 轻量级元能力框架子系统框架图 + +![](http://tools.harmonyos.com/mirrors/hpm-image/ability_README/figures/zh-cn_image_0000001054467912.png) + +Ability是应用所具备的能力的抽象,一个应用可以包含一个或多个Ability。Ability分为两种类型:FA(Feature Ability)和AA(Atomic Ability)。 + +- **FA**:由三方基于元能力框架开发的、实现单一功能的有UI界面的程序实体,用于支持与用户交互的能力。一个Page实例可以包含一组相关页面,每个页面用一个AbilitySlice实例表示。Page模板是Feature Ability唯一支持的模板。用户可以基于JavaScript语言开发FA,也可以基于C/C++语言开发FA。 + + - Page模板的Ability的生命周期流转图 + + **图2** Ability生命周期流转图 + + ![](http://tools.harmonyos.com/mirrors/hpm-image/ability_README/figures/zh-cn_image_0000001054627908.png)Page模板的Ability生命周期各状态解析 + + - **UNINITIALIZED**:未初始状态,为临时状态,Ability创建后会直接调用Init初始化,进入INITIAL状态; + + - **INITIAL**:初始化状态,也表示停止状态,表示当前Ability未运行,调用Start后进入INACTIVE,同时回调开发者的OnSatrt生命周期回调; + + - **INACTIVE**:未激活状态,表示当前窗口已显示但是无焦点状态,由于Window暂未支持焦点的概念,当前状态与ACTIVE一致。调用Active后进入ACTIVE,同时回调开发者的OnActive生命周期回调;调用Background后进入BACKGROUND,同时回调开发者的OnBackground生命周期回调; + + - **ACTIVE**:前台激活状态,表示当前窗口已显示,并获取焦点。调用Inactive后进入INACTIVE; + + - **BACKGROUND**: 后台状态,表示当前Ability退到后台。调用Active后进入ACTIVE,同时回调开发者的OnActive生命周期回调;调用Stop后进入INITIAL,同时回调开发者的OnStop生命周期回调; + + - **AbilitySlice** + + 一个使用Page模板的Ability由AbilitySlice构成,AbilitySlice是单个页面及其控制逻辑的总和。一个Page可以包含多个AbilitySlice,此时,这些页面提供的业务能力应当是高度相关的。Page模板的Ability与AbilitySlice的关系如下图: + + **图3 **Ability与AbilitySlice的关系图 + + ![](http://tools.harmonyos.com/mirrors/hpm-image/ability_README/figures/zh-cn_image_0000001054307881.gif) + + +- **AA**:由三方基于元能力框架开发的、实现单一功能的无UI界面的支持后台任务的程序实体。AA与FA的区别是,AA无UI界面。仅对系统服务有依赖关系,AA之间不存在依赖关系 。Service模板是AA支持的模板。 +- **注册Ability** + + Ability的模板通过在清单文件中注册时指定。如下所示,开发者可以配置Ability元素的type属性,其取值page、service分别代表Page模板、Service模板。 + + ``` + "module": { + ...... + "abilities": [ + { + "name": "default", + "type": "pages", + "label": "sdfasf" + } + ], ’ + ...... + } + ``` + + +- **AbilityKit**:元能力的开发框架,运行在开发者的应用程序进程中,和AbilityMs通过IPC通信,开发者基于该框架开发自己的Ability。 + +- **AbilityMs**:元能力运行管理服务,元能力生命周期的调度统一由AbilityMs管理。 +- **AppSpawn:**进程孵化器,元能力进程由AppSpawn负责孵化并拉起。 + +## 目录 + +轻量级元能力框架子系统源代码目录结构如下图所示: + +**表 1** 轻量级元能力框架子系统源代码目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

foundation/aafwk/frameworks/ability_lite

+

元能力框架核心代码

+

foundation/aafwk/frameworks/want_lite

+

元能力之间通信的实体

+

foundation/aafwk/interfaces/kits

+

元能力框架对外接口

+

foundation/aafwk/interfaces/kits/ability_lite

+

元能力运行管理服务对外接口

+

foundation/aafwk/interfaces/kits/want_lite

+

元能力之间通信的实体对外接口

+

foundation/aafwk/services/abilitymgr_lite

+

元能力运行管理服务

+

foundation/aafwk/services/abilitymgr_lite/tools

+

元能力调测工具

+
+ +## 约束 + +- 语言版本 + - C++11版本或以上 + +- 框架针对不同的芯片平台和底层OS能力,规格有所区别 + - Cortex-M RAM/ROM: + - RAM:建议大于20K + - ROM: \> 300K (包含ACE,UIKit及引擎等强相关子系统) + + - Cortex-A RAM/ROM: + - RAM:建议大于2M + - ROM:\> 2M (包含ACE,UIKit及引擎等强相关子系统) + + + +# 使用 + +## 编译轻量级元能力框架子系统 + +- 添加对轻量级元能力框架子系统的编译,以hi3516dv300\_liteos\_a为例 + - 在build/lite/platform/hi3516dv300\_liteos\_a/platform.json中的subsystem\_list字段下面添加aafwk,代码如下: + + ``` + { + "name":"aafwk", + "project":"hmf/aafwk/services/abilitymgr_lite", + "path":"build/lite/config/subsystem/aafwk", + "dir":"foundation/aafwk/services/abilitymgr_lite", + "desc":"Ability Services Manager", + "requirement":"yes", + "default":"yes", + "selected":"yes" + }, + ``` + + - 在build/lite/platform/hi3516dv300\_liteos\_a/template/ipcamera.json的“template\_subsystem\_list”字段下面添加"aafwk",代码如下: + + ``` + "template_subsystem_list" : [ + ...... + "distributedschedule", + "aafwk", + "communication", + ...... + ], + ``` + + - 在build/lite/config/subsystem/aafwk/BUILD.gn中添加对用户程序框架中具体组件的编译,如下: + + ``` + import("//build/lite/config/subsystem/lite_subsystem.gni") + + lite_subsystem("aafwk") { + subsystem_components = [ + "//foundation/aafwk/frameworks/kits/ability_lite:aafwk_abilitykit_lite", + "//foundation/aafwk/frameworks/kits/ability_lite:aafwk_abilityMain_lite", + "//foundation/aafwk/services/abilitymgr_lite:aafwk_services_lite", + "//foundation/aafwk/frameworks/kits/tools_lite:tools_lite", + "//foundation/aafwk/frameworks/kits/ability_lite/test:aafwk_testapp_lite", + ] + } + ``` + + - 在foundation/aafwk下面添加对业务模块的编译,各个模块都有自己的BUILD.gn文件 + +- 添加完上述的配置后,执行如下命令编译整个系统: + + ``` + python build.py ipcamera -p hi3516dv300_liteos_a -b release + ``` + + 运行轻量级元能力运行管理服务 + + - 轻量级元能力运行管理服务为AbilityMs,服务运行于foudation进程中。 + - AbilityMs注册到sa\_manager中,sa\_manager运行于foundation进程中,sa\_manager为AbilityMs创建线程运行环境。具体创建AbilityMs服务的方式以及使用该服务的方式,可参考[系统服务框架子系统](zh-cn_topic_0000001051589563.md)。 + - 在foundation/distributedschedule/services/safwk\_lite/BUILD.gn中添加对abilityms,如下: + + ``` + deps = [ + "//foundation/distributedschedule/services/samgr_lite/samgr_server:server", + "//base/dfx/lite/liteos-a/source/log:hilog_a_shared", + "//foundation/aafwk/services/abilitymgr_lite:abilityms", + "//base/security/services/iam_lite:pms_target", + "//foundation/distributedschedule/services/dtbschedmgr_lite:dtbschedmgr", + ] + ``` + + - 刷机后系统启动,AbilityMs会随系统启动而启动,在shell中运行如下命令,可以看到foudation进程中包含了libabilityms + + +## 运行基于AbilityKit开发的Ability + +- 包安装完成后,通过如下命令,运行Demo + +``` +./bin/aa start -p com.huawei.launcher -n MainAbility +``` + + + diff --git a/ability/bundle.json b/ability/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..2b881f1afce2d0d535818f90313c516e60219f4d --- /dev/null +++ b/ability/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/ability", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "轻量级元能力框架子系统,是OpenHarmony为开发者提供的一套开发鸿蒙应用的开发框架", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/aafwk &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "ability" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "foundation" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/app_verify/LICENSE b/app_verify/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/app_verify/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/app_verify/README.md b/app_verify/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f01657c89a990bde601c2dcbf9283aa830b06569 --- /dev/null +++ b/app_verify/README.md @@ -0,0 +1,30 @@ +# appspawn\_README + +# 应用孵化模块 + +## 简介 + +应用孵化模块,appspawn进程,配合轻量级元能力框架子系统,通过轻量级IPC机制接收来自AMS的消息,根据消息解析结果启动元能力进程AbilityMain并赋予其对应权限。 + +模块二进制部署在/bin/appspawn。 + +## 目录 + +``` +base +├──startup 启动恢复子系统根目录 +└──── services + ├── appspawn_lite 应用孵化模块 + ├── BUILD.gn 应用孵化模块编译配置 + ├── include 应用孵化模块头文件目录 + ├── LICENSE 开源LICENSE文件 + ├── moduletest 应用孵化模块自测试代码目录 + └── src 应用孵化模块源文件目录 +``` + +## 约束 + +目前仅支持Hi3516DV300和Hi3518EV300版本。 + + + diff --git a/app_verify/bundle.json b/app_verify/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..a1e12f376919f10b55722cc1cef9ab022b74f6f3 --- /dev/null +++ b/app_verify/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/app_verify", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "为了确保应用内容的完整性,HarmonyOS通过应用签名和Profile对应用的来源进行管控,设备上仅允许安装内部预置或来自华为应用市场的应用。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/security &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "appverify" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/appspawn/LICENSE b/appspawn/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/appspawn/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/appspawn/README.md b/appspawn/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f01657c89a990bde601c2dcbf9283aa830b06569 --- /dev/null +++ b/appspawn/README.md @@ -0,0 +1,30 @@ +# appspawn\_README + +# 应用孵化模块 + +## 简介 + +应用孵化模块,appspawn进程,配合轻量级元能力框架子系统,通过轻量级IPC机制接收来自AMS的消息,根据消息解析结果启动元能力进程AbilityMain并赋予其对应权限。 + +模块二进制部署在/bin/appspawn。 + +## 目录 + +``` +base +├──startup 启动恢复子系统根目录 +└──── services + ├── appspawn_lite 应用孵化模块 + ├── BUILD.gn 应用孵化模块编译配置 + ├── include 应用孵化模块头文件目录 + ├── LICENSE 开源LICENSE文件 + ├── moduletest 应用孵化模块自测试代码目录 + └── src 应用孵化模块源文件目录 +``` + +## 约束 + +目前仅支持Hi3516DV300和Hi3518EV300版本。 + + + diff --git a/appspawn/bundle.json b/appspawn/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..21d0c70609ce35d730110a80f52bf669d0f615be --- /dev/null +++ b/appspawn/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/appspawn", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "应用孵化模块,appspawn进程,配合轻量级元能力框架子系统,通过轻量级IPC机制接收来自AMS的消息,根据消息解析结果启动元能力进程AbilityMain并赋予其对应权限。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/startup/services/appspawn_lite &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "appspawn" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/audio_manager/LICENSE b/audio_manager/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/audio_manager/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/audio_manager/README.md b/audio_manager/README.md new file mode 100644 index 0000000000000000000000000000000000000000..09b79d4c8ad68ad961c8152f166f56dd2e98f3dc --- /dev/null +++ b/audio_manager/README.md @@ -0,0 +1,58 @@ +# AudioManager\_README + +# 项目介绍 + +## 简介 + +音频管理模块支持对音频数据的采集和播放,即音频输入输出模块。 + +在进行应用的开发前,开发者应了解以下基本概念: + +- 流媒体技术 + + 流媒体技术是把连续的影像和声音信息进行编码处理后放在网络服务器上,让浏览者一边下载、一边观看与收听,而不需要等整个多媒体文件下载完成就可以即时观看、收听的技术。 + + +- 视频帧率 + + 帧率是用于测量显示帧数的度量,帧数就是在每秒钟时间里传输的图片数量。每秒钟帧数 \(FPS\) 越多,所显示的画面就会越流畅。 + +- 码率 + + 码率就是数据传输时单位时间传送的数据位数,常用单位是kbps即千位每秒。 + +- 采样率 + + 采样率为每秒从连续信号中提取并组成离散信号的采样个数,单位用赫兹(Hz)来表示。 + + +## 目录 + +音频管理模块源代码目录结构如下图所示: + +**表 1** 音频模块源代码目录结构 + + + + + + + + + + + + + +

名称

+

描述

+

foundation/multimedia/frameworks/audio_lite

+

音频模块实现

+

foundation/multimedia/interfaces/kits/audio_lit

+

音频模块对外头文件

+
+ +# 使用说明 + +请参考player和recorder模块readme。 + diff --git a/audio_manager/bundle.json b/audio_manager/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..36575bebec7a9fdd496dec43d9089f68b04e0a0b --- /dev/null +++ b/audio_manager/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/audio_manager", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "音频管理模块支持对音频数据的采集和播放,即音频输入输出模块。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/multimedia &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "audio" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "foundation" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/bootstrap/LICENSE b/bootstrap/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/bootstrap/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/bootstrap/README.md b/bootstrap/README.md new file mode 100644 index 0000000000000000000000000000000000000000..85097ffbff3e07820cc1146413867b7283624c17 --- /dev/null +++ b/bootstrap/README.md @@ -0,0 +1,42 @@ +# bootstrap\_readme + +# 项目介绍 + +## 简介 + +bootstrap启动服务模块: + +支持使用LiteOS-M内核的平台,当前包括:Hi3861平台。 + +提供了各服务和功能的启动入口标识。在SAMGR启动时,会调用boostrap标识的入口函数,并启动系统服务。 + +## 目录 + +**表 1** bootstrap启动服务模块目录结构 + + + + + + + + + + +

名称

+

描述

+

base/startup/services/bootstrap_lite

+

服务启动模块,启动系统核心服务外的其他服务。

+

Hi3861

+
+ +## 使用 + +bootstrap模块无需单独配置,在SAMGR启动时会自动调用,用于启动系统服务。 + +## 涉及仓 + +startup\_services\_bootstrap\_lite + + + diff --git a/bootstrap/bundle.json b/bootstrap/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..7212550552a7181ebf194aab0e2add62f80efe96 --- /dev/null +++ b/bootstrap/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/bootstrap", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "bootstrap启动服务模块:-支持使用LiteOS-M内核的平台,当前包括:Hi3861平台。提供了各服务和功能的启动入口标识。在SAMGR启动时,会调用boostrap标识的入口函数,并启动系统服务。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/startup/services/bootstrap_lite &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "bootstrap" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-m", + "board": "hi3861" + } +} \ No newline at end of file diff --git a/bounds_checking_function/LICENSE b/bounds_checking_function/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/bounds_checking_function/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/bounds_checking_function/README.en.md b/bounds_checking_function/README.en.md new file mode 100644 index 0000000000000000000000000000000000000000..c905d57e51b80b9109123ed33c48157616e7eae2 --- /dev/null +++ b/bounds_checking_function/README.en.md @@ -0,0 +1,9 @@ +# bounds_checking_function + +#### Description + +- following the standard of C11 Annex K (bound-checking interfaces), functions of the common memory/string operation classes, such as memcpy_s, strcpy_s, are selected and implemented. + +- other standard functions in C11 Annex K will be analyzed in the future and implemented in this organization if necessary. + +- handles the release, update, and maintenance of bounds_checking_function. diff --git a/bounds_checking_function/README.md b/bounds_checking_function/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4cb88ea74afd61d685d37206a940c8b0979631c3 --- /dev/null +++ b/bounds_checking_function/README.md @@ -0,0 +1,6 @@ +# bounds_checking_function + +#### 介绍 +- 遵循C11 Annex K (Bounds-checking interfaces)的标准,选取并实现了常见的内存/字符串操作类的函数,如memcpy_s、strcpy_s等函数。 +- 未来将分析C11 Annex K中的其他标准函数,如果有必要,将在该组织中实现。 +- 处理边界检查函数的版本发布、更新以及维护。 diff --git a/bounds_checking_function/bundle.json b/bounds_checking_function/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..944ce832ea0adc05a19a719030944fc12048992e --- /dev/null +++ b/bounds_checking_function/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/bounds_checking_function", + "version": "1.8.0", + "publishAs": "code-segment", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/bounds_checking_function &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "description": "following the standard of C11 Annex K (bound-checking interfaces), functions of the common memory/string operation classes, such as memcpy_s, strcpy_s, are selected and implemented", + "keywords": [ + "thirdparty" + ], + "license": "Apache V2", + "repository": "https://gitee.com/openeuler/bounds_checking_function", + "homepage": "https://gitee.com/openeuler/bounds_checking_function", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/build/LICENSE b/build/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/build/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/build/README.md b/build/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ffeb2834ccfca508c01c133763511ef074d9b276 --- /dev/null +++ b/build/README.md @@ -0,0 +1,281 @@ +# 编译构建子系统README + +# 编译构建子系统 + +## 简介 + +编译构建提供了一个在GN与ninja基础上的编译构建框架。支持以下功能: + +1. 构建不同芯片平台的产品。如:Hi3518EV300平台的ipcamera产品,Hi3516DV300平台的ipcamera产品,Hi3861平台的wifi模组产品。 +2. 构建HPM包管理配置生成的自定义产品。 + +## 目录 + +``` +build/lite # 编译构建主目录 +├── config # 编译相关的配置项 +│ ├── boards # 开发板相关的变量定义。包括:开发板名、目标架构、目标CPU等 +│ ├── component # OpenHarmony组件相关的模板定义。包括:静态库、动态库、扩展组件、模拟器库等 +│ ├── kernel # OpenHarmony内核的编译变量定义与配置参数 +│ └── subsystem # OpenHarmony子系统列表 +├── ndk # NDK相关编译脚本与配置参数 +├── platform # 平台相关的配置文件 +│ ├── hi3516dv300_liteos_a # hi3516dv300, liteos_a平台。包括:平台配置参数、平台已有产品模板等。 +│ ├── hi3518ev300_liteos_a # hi3518ev300, liteos_a平台。包括:平台配置参数、平台已有产品模板等。 +│ └── hi3861v100_liteos_riscv # hi3861v100, liteos_riscv平台。包括:平台配置参数、平台已有产品模板等。 +├── product # 产品全量配置表。包括:配置单元、子系统列表、编译器等。 +├── toolchain # 编译工具链相关。包括:编译器路径、编译选项、链接选项等。 +└── tools # 编译构建依赖的工具。包括:mkfs等。 +``` + +## 约束 + +编译构建框架开发者需预装GN和ninja构建工具,且加入环境变量。 + +## 使用 + +- 编译已有产品 + +``` +# 编译WIFI-IOT平台 +python build.py wifiiot + +# 编译基于Hi3518ev300的ipcamera: +python build.py ipcamera_hi3518ev300 + +# 编译基于Hi3516dv300的ipcamera: +python build.py ipcamera_hi3516dv300 +``` + +- 编译组件 + + 本节以添加一个自定义的组件为例,描述了如何编译组件、编译库、编译可执行文件。 + + 示例组件example由两个功能feature1和feature2组成。feture1为一个动态库,feature2为一个可执行文件。 + + 示例组件example的完整目录结构如下: + + ``` + example # 自定义组件 + ├── BUILD.gn # 自定义组件gn脚本,BUILD.gn为固定名称 + ├── feature1 # 自定义单元1 + │ ├── BUILD.gn # 自定义单元1的gn脚本,BUILD.gn为固定名称 + │ ├── include # 头文件文件夹 + │ │ └── helloworld1.h # 头文件1 + │ └── src # 源文件文件夹 + │ └── helloworld1.c # 源文件1 + ├── feature2 # 自定义单元2 + │ ├── BUILD.gn # 自定义单元2的gn脚本,BUILD.gn为固定名称 + │ ├── include # 头文件文件夹 + │ │ └── helloworld2.h # 头文件2 + │ └── src # 源文件文件夹 + │ └── helloworld2.c # 源文件2 + ├── build.sh # 自定义组件build.sh脚本,非必要 + └── Makefile # 自定义组件Makefile脚本,非必 + ``` + + - 第一步:编写example/feature1/BUILD.gn,动态库的gn脚本 + + 使用lite\_library模板,可以编译出动态库与静态库。示例如下: + + ``` + # helloworld动态库编译示例 + # helloworld的Build.gn文件 + lite_library("helloworld_lib") { + target_type = "shared_library" # 编译动态库 + #target_type = "static_library" # 编译静态库 + sources = [ + "src/helloworld1.c" + ] + include_dirs = [ + "include", + "../feature2_example/include" # 如果依赖 feature2_example 可以加入该include + ] + } + ``` + + - 第二步:编写example/feature2/BUILD.gn,可执行文件的gn脚本 + + 使用gn自带模板executable,可编译出可执行文件。示例如下: + + ``` + #编译可执行.bin文件 + executable("hello_world_bin") { + sources = [ + "src/helloworld.c" + ] + include_dirs = [ + "include", + #"../feature2_example/include" # 如果依赖 feature2_example 可以加入该include + ] + # 如果依赖 feature1_example 可以加入该deps + #deps = [ + # "../feature1_example:helloworld1" + #] + } + ``` + + - 第三步:编写example/BUILD.gn,组件gn脚本 + + ``` + import("//build/lite/config/component/lite_component.gni") + + #工程全篇使用BUILD.gn脚本编译 + lite_component("example_gn") { + features = [ + "feature_example1:helloworld_lib", + "feature_example2:hello_world_bin", + ] + } + + #融入自带build.sh或Makefile工程, 用gn脚本调用混合编译 + build_ext_component("example_mk") { + exec_path = rebase_path(rebase_path(".", root_build_dir)) + outdir = rebase_path(get_path_info(".", "out_dir")) + prebuilts = "sh build.sh" + command = "make clean && make" + } + ``` + + +- 可用的编译构建变量 + + 全局可引用的变量定义在://build/lite/ohos\_var.gni + + 用户常用变量说明见表1: + + **表 1** + + + + + + + + + + + + + + + + + + + + +

变量

+

取值范围

+

说明

+

ohos_kernel_type

+

"liteos_a", "liteos_riscv"

+

内核类型

+

board_name

+

"hi3516dv300", "hi3518ev300", "hi3861v100"

+

开发板类型

+

ohos_build_compiler

+

"gcc", "clang"

+

编译工具链类型

+
+ + 举例:ohos\_kernel\_type的使用,component\_example/feature2\_example/BUILD.gn + + ``` + lite_library("helloworld") { + if (ohos_kernel_type == "liteos_a") { + target_type = "shared_library" + } + else if (ohos_kernel_type == "liteos_riscv") { + target_type = "static_library" + } + sources = [ + "src/helloworld1.c" + ] + include_dirs = [ + "include" + ] + } + ``` + + +- 编译HPM的解决方案 + +通过HPM下载后,用户自定的全量模板在//build/lite/product 目录下。 + +如ipcamera\_hi3516dv300.json,构建时会读取该文件包含所有用户自定义子系统、组件等配置。 + +- 编译输出 + +编译所生产的文件都归档在out目录下 + +例在代码所在目录下,运行"python build.py wifiiot",编译wifiiot完成后,会有如下结果生成: + +``` +out/ +└── wifiiot # 产品名 + ├── args.gn # gn编译,用户自定义变量 + ├── build.log # 编译日志 + ├── build.ninja + ├── build.ninja.d + ├── gen + ├── Hi3861_boot_signed_B.bin # 带签名的bootloader备份文件 + ├── Hi3861_boot_signed.bin # 带签名的bootloader文件 + ├── Hi3861_loader_signed.bin # 烧写工具使用的加载文件,烧写程序建议使 用 “Hi3861_demo_allinone.bin + ├── Hi3861_wifiiot_app_allinone.bin # 产线工装烧写文件(已经包含独立烧写程序 和loader程序) + ├── Hi3861_wifiiot_app.asm # Kernel asm文件 + ├── Hi3861_wifiiot_app_burn.bin # 烧写文件,烧写程序建议使用 “Hi3861_wifiiot_app_allinone.bin” + ├── Hi3861_wifiiot_app_flash_boot_ota.bin # Flash Boot升级文件 + ├── Hi3861_wifiiot_app.map # Kernel map文件 + ├── Hi3861_wifiiot_app_ota.bin # Kernel 升级文件 + ├── Hi3861_wifiiot_app.out # Kernel 输出文件 + ├── Hi3861_wifiiot_app_vercfg.bin # 安全启动开启的时候,配置boot和kernel版本号,防版本回滚 + ├── libs # 库文件夹 + ├── NOTICE_FILE + ├── obj + ├── suites + └── toolchain.ninja +``` + +运行"python build.py ipcamera\_hi3518ev300",编译ipcamera\_hi3518ev300完成后,会有如下结果生成(同ipcamera\_hi3516dv300): + +``` +out/ +└── ipcamera_hi3518ev300 # 产品名 + ├── args.gn # gn编译,用户自定义变量 + ├── bin # 链接bin所在文件夹 + ├── bm_tool.map # map文件 + ├── build.log # 编译日志 + ├── build.ninja + ├── build.ninja.d + ├── bundle_daemon_tool.map # map文件 + ├── data + ├── dev_tools + ├── foundation.map # map文件 + ├── gen + ├── libaudio_api.so + ├── libs + ├── liteos.bin # liteos基础内核bin文件 + ├── media_server.map # map文件 + ├── NOTICE_FILE + ├── obj # 二进制文件,编译结果文件夹 + ├── OHOS_Image # liteos整包bin文件,未strip + ├── OHOS_Image.asm # 汇编代码 + ├── OHOS_Image.bin # liteos整包烧录bin文件 + ├── OHOS_Image.map # map文件 + ├── rootfs.img # 编译出的库和app的镜像 + ├── rootfs.tar # rootfs的压缩 + ├── suites # xts编译结果 + ├── test # 测试用例编译结果 + ├── toolchain.ninja + ├── userfs # 用户可读写的分区 + ├── userfs.img # img格式的用户可读写的分区,对应启动之后的/storage目录 + └── vendor # 芯片的Firmware文件及配置文件 +``` + +## 涉及仓 + +build\_lite + + + diff --git a/build/bundle.json b/build/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..8b62f58c9c0e4cbee698401ebefd2b56d29e41e2 --- /dev/null +++ b/build/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/build", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "编译构建提供了一个在GN与ninja基础上的编译构建框架。支持以下功能:-构建不同芯片平台的产品。如:Hi3518EV300平台的ipcamera产品,Hi3516DV300平台的ipcamera产品,Hi3861平台的wifi模组产品。构建HPM包管理配置生成的自定义产品。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/build &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "build" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "build" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a,liteos-m", + "board": "hi3516,hi3518,hi3861" + } +} \ No newline at end of file diff --git a/bundle_mgr/LICENSE b/bundle_mgr/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/bundle_mgr/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/bundle_mgr/README.md b/bundle_mgr/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b7422acf64010d14e54520acbce0389bcecd9749 --- /dev/null +++ b/bundle_mgr/README.md @@ -0,0 +1,207 @@ +# bundlemgr\_README + +# 项目介绍 + +## 简介 + +**轻量级包管理框架子系统**,是鸿蒙系统为开发者提供的安装包管理框架。轻量级包管理框架子系统的由如下模块组成: + +![](http://tools.harmonyos.com/mirrors/hpm-image/bundlemgr_README/figures/zh-cn_image_0000001054309949.png) + +**图1** 轻量级包管理框架子系统框架图 + +- **包扫描器**:用来解析本地预制或者安装的安装包,提取里面的各种信息,供管理子模块进行管理,持久化 + +- **包安装子模块**:安装,卸载,升级一个包;Installed一个单独进程的用于创建删除安装目录,具有较高的权限。 + +- **包管理子模块**:管理安装包相关的信息 + +- **安全子模块**:签名检查、权限授予、权限管理 + +## 目录 + +轻量级包管理框架子系统源代码目录结构如下图所示: + +**表 1** 轻量级包管理框架子系统代码目录结构 + + + + + + + + + + +

名称

+

描述

+

foundation/appexecfwk/frameworks/bundle_lite

+

foundation/appexecfwk/interfaces/innerkits/bundlemgr_lite

+

foundation/appexecfwk/interfaces/kits/bundle_lite

+

foundation/appexecfwk/services/bundlemgr_lite

+

用户程序运行的包信息、元能力信息、异步事件处理等基本接口

+

用户程序包管理服务对外接口

+

用户程序运行的包信息、元能力信息、异步事件处理机制的实现逻辑

+

用户程序包管理服务实现逻辑

+
+ +# 资源文档 + +## 开发指南 + +编译轻量级包管理框架子系统 + +- 添加对轻量级包管理框架子系统的编译,以hi3516dv300\_liteos\_a为例 + - 在build/lite/platform/hi3516dv300\_liteos\_a/platform.json中的subsystem\_list字段下面添加appexecfwk,代码如下: + + ``` + { + "name":"appexecfwk", + "project": "hmf/appexecfwk/services/bundlemgr_lite", + "path": "build/lite/config/subsystem/appexecfwk", + "dir": "foundation/appexecfwk/services/bundlemgr_lite", + "desc":"Bundle Services Manager", + "requirement":"yes", + "default":"yes", + "selected":"yes" + }, + ``` + + - 在build/lite/platform/hi3516dv300\_liteos\_a/template/ipcamera.json的“template\_subsystem\_list”字段下面添加"appexecfwk"和"aafwk",代码如下: + + ``` + "template_subsystem_list" : [ + ...... + "distributedschedule", + "appexecfwk", + "communication", + ...... + ], + ``` + + - 在build/lite/config/subsystem/aafwk/BUILD.gn和/build/lite/config/subsystem/appexecfwk/BUILD.gn中添加对用户程序框架中具体组件的编译,如下: + + ``` + import("//build/lite/config/subsystem/lite_subsystem.gni") + + lite_subsystem("appexecfwk") { + subsystem_components = [ + "//foundation/appexecfwk/kits/appkit_lite:appexecfwk_kit_lite", + "//foundation/appexecfwk/services/bundlemgr_lite:appexecfwk_services_lite", + ] + } + ``` + + - 在foundation/aafwk和foundation/appexecfwk下面添加对业务模块的编译,各个模块都有自己的BUILD.gn文件 + +- 添加完上述的配置后,执行如下命令编译整个系统: + +``` +python build.py ipcamera -p hi3516dv300_liteos_a -b release +``` + +运行轻量级包管理服务 + +- 轻量级包管理服务为BundleMs,服务运行于foudation进程中。 +- BundleMs注册到sa\_manager中,sa\_manager运行于foundation进程中,sa\_manager为BundleMs创建线程运行环境。具体创建BundleMs服务的方式以及使用该服务的方式,可参考[系统服务框架子系统](zh-cn_topic_0000001051589563.md)。 +- 在foundation/distributedschedule/services/safwk\_lite/BUILD.gn中添加对bundlems,如下: + +``` +deps = [ + "//foundation/distributedschedule/services/samgr_lite/samgr_server:server", + "//base/dfx/lite/liteos-a/source/log:hilog_a_shared", + "//foundation/appexecfwk/services/bundlemgr_lite:bundlems", + "//base/security/services/iam_lite:pms_target", + "//foundation/distributedschedule/services/dtbschedmgr_lite:dtbschedmgr", +] +``` + +- 刷机后系统启动,BundleMs会随系统启动而启动,在shell中运行如下命令,可以看到foudation进程中包含了libbundlems + +## 运行基于AbilityKit开发的Ability + +- 基于AbilityKit开发的Ability的Demo代码位于foundation/aafwk/frameworks/kits/ability\_lite/test路径下,如有需要修改其中的功能,可在unittest的文件中修改代码或增加代码文件,并在BUILD.gn中做相应的修改。 +- 编译该Demo,在shell中执行如下命令,编译成功后,在out/ipcamera\_hi3516dv300\_liteos\_a下面生成libLauncher.so文件: + + ``` + python build.py ipcamera -p hi3516dv300_liteos_a -T //foundation/aafwk/frameworks/kits/ability_lite/test:Launcher + ``` + +- 编写config.json,内容如下: + + ``` + { + "app": { + "bundleName": "com.huawei.launcher", + "vendor": "huawei", + "version": { + "code": 1, + "name": "1.0" + } + }, + "deviceConfig": { + "default": { + "reqSdk": { + "compatible": "zsdk 1.0.0", + "target": "zsdk 1.0.1" + }, + "keepAlive": false + }, + }, + "module": { + "deviceType": [ + "smartCamera" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "Launcher", + "moduleType": "entry" + }, + "abilities": [{ + "name": "MainAbility", + "icon": "res/drawable/phone.png", + "label": "test app 1", + "launchType": "standard", + "type": "page", + "visible": true + }, + { + "name": "SecondAbility", + "icon": "res/drawable/phone.png", + "label": "test app 2", + "launchType": "standard", + "type": "page", + "visible": true + }, + { + "name": "ServiceAbility", + "icon": "res/drawable/phone.png", + "label": "test app 2", + "launchType": "standard", + "type": "service", + "visible": true + } + ] + } + } + ``` + +- 生成hap包 + - 按照如下目录结构存放文件,res/drawable下面放置资源文件: + + ![](http://tools.harmonyos.com/mirrors/hpm-image/bundlemgr_README/figures/zh-cn_image_0000001054312178.png) + + - 将上述文件打包生成zip包,修改后缀为.hap,例如Launcher.hap + +- 安装hap包 + + - 将上述hap包放置到指定目录下面 + - 执行安装命令,安装hap包: + + ``` + ./bin/bm install -p /nfs/hap/Launcher.hap + ``` + + + + diff --git a/bundle_mgr/bundle.json b/bundle_mgr/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..c4999e49288f81b8ceae649237b6b07886d35db0 --- /dev/null +++ b/bundle_mgr/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/bundle_mgr", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "轻量级包管理框架子系统,是鸿蒙系统为开发者提供的安装包管理框架", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/appexecfwk &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "mgr" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "foundation" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/camera/LICENSE b/camera/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/camera/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/camera/README.md b/camera/README.md new file mode 100644 index 0000000000000000000000000000000000000000..22a934814d79bf225f6efb66264e2f43296b4c09 --- /dev/null +++ b/camera/README.md @@ -0,0 +1,638 @@ +# Camera\_README + +# 介绍 + +## 基本概念 + +相机是HarmonyOS多媒体进程提供的服务之一,提供了相机的录像、预览、拍照功能,支持多用户并发取流。 + +在进行应用的开发前,开发者应了解以下基本概念: + +- 视频帧 + + 视频流指的是将一系列图片数据按照固定时间间隔排列形成的数据流,每一张图片数据成为一帧,这样的一帧称为视频帧。 + +- 帧速率\(FPS: Frames Per Second\) + + 视频播放每秒钟刷新图片的速度,或是视频每秒的帧数,帧速率越高,视频的观感越流畅。 + +- 分辨率 + + 每一帧的图片信息都是由像素点组成的,分辨率描述了一张图片中像素点的个数。例如1920\*1080\(1080P\),是指图片宽1920像素,高1080像素。 + + +## 运作机制 + +- 多媒体服务进程 + + 多媒体服务作为系统服务,在系统启动时由Init进程拉起,并初始化和分配媒体硬件资源(内存/显示硬件/图像传感器/编解码器等)。初始化过程解析配置文件,确定了多媒体各个服务的能力和资源上限,通常由OEM厂商通过配置文件进行配置。相机服务在多媒体进程初始化时有以下配置项: + + - 内存池:所有媒体服务依赖于内存池中的内存轮转运行 + - 图像传感器:包括了传感器类型、分辨率、ISP等 + - 图像处理器:分辨率、码率、图像翻转等 + - 图像编码器:编码格式、码率、分辨率等 + + +- 关键类的解释 + + 应用通过持有下面4个类,配置和使用Camera的功能,包括了Camera类和它的三个异步回调类,三类回调分别对应了不同类型的异步处理场景,详见[表1](#table486418149411)。 + + **表 1** 关键类的解释 + + + + + + + + + + + + + + + + + + + + + + + + +

对象

+

用途

+

举例

+

Camera

+

对相机进行静态配置(通过配置类),触发相机基本功能

+

拍照/录像/预览

+

CameraDeviceCallback

+

处理相机硬件状态变化

+

可用/不可用

+

CameraStateCallback

+

处理camera自身状态变化

+

创建/释放

+

FrameStateCallback

+

处理帧状态的变化

+

拍照开始和结束/帧率发生变化

+
+ +- 流的传递 + + Surface是多媒体传递音视频的基本数据结构,Camera一般作为Surface中数据的生产者,在不同的场景下有特定的消费者。 + + 相机的预览和录像输出均为视频流,拍照输出为图像帧,二者均通过Surface类进行传递。Surface类可以屏蔽进程内/跨进程的场景,进行多媒体信息流的传递。 + + 以录像为例,用户首先创建Recorder实例,并从Recorder中获取对应Surface,再将此Surface传递给Camera实例,此时Camera将作为生产者向Surface注入视频流,而Recorder作为消费者从Surface中取出视频流进行保存,用户的行为类似桥接,把二者通过Surface连接起来。 + + 类似的,用户也可以自行创建Surface传递给Camera实例,并实现消费者逻辑(例如通过网络传输视频流,或是将拍照的帧数据保存成图片文件)。 + + 图形图像模块也通过Surface从Camera获取流资源,具体步骤详见[图形图像开发指导](zh-cn_topic_0000001051770388.md)。 + +- 相机运行流程 + 1. Camera创建流程 + + 本进程通过CameraManager创建Camera实例,并从服务端绑定camera设备,创建成功后异步通知user。类之间的时序图如下: + + **图 1** Camera创建时序图 + + + ![](http://tools.harmonyos.com/mirrors/hpm-image/camera_README/figures/zh-cn_image_0000001054080622.png) + + + 1. Camera录像/预览流程 + + 用户首先通过CameraKit创建Camera,然后FrameConfig类对录像或者预览帧属性进行配置。录像/预览时序如下: + + **图 2** Camera录像/预览时序图 + + + ![](http://tools.harmonyos.com/mirrors/hpm-image/camera_README/figures/zh-cn_image_0000001054400647.png) + + + +# 安装 + +相机相关动态库安装到设备/usr/lib中 + +# 使用 + +使用场景 + +使用Camera产生图片帧(拍照)。 + +接口说明 + +**表 1** API列表 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

类名

+

接口名

+

描述

+

CameraKit

+

int32_t GetCameraIdList(std::list<string> cameraList)

+

获取cameraId列表

+

CameraKit

+

CameraAbility& GetCameraAbility(string cameraId)

+

获取指定camera的能力

+

CameraKit

+

void RegisterCameraDeviceCallback(CameraDeviceCallback* callback, EventHandler* handler)

+

注册camera设备状态回调

+

CameraKit

+

void UnregisterCameraDeviceCallback(CameraDeviceCallback* callback)

+

去注册camera设备状态回调

+

CameraKit

+

void CreateCamera(string cameraId, CameraStateCallback* callback, EventHandler* handler)

+

创建camera实例

+

Camera

+

string GetCameraId()

+

获取cameraID

+

Camera

+

CameraConfig& GetCameraConfig()

+

获取camera配置信息

+

Camera

+

FrameConfig& GetFrameConfig(int32_t type)

+

获取捕获帧类型

+

Camera

+

void Configure(CameraConfig& config)

+

配置camera

+

Camera

+

void Release()

+

释放camera

+

Camera

+

int TriggerLoopingCapture(FrameConfig& frameConfig)

+

开始循环帧捕获

+

Camera

+

void StopLoopingCapture()

+

停止循环帧捕获

+

Camera

+

int32_t TriggerSingleCapture(FrameConfig& frameConfig)

+

抓图

+

CameraConfig

+

void SetFrameStateCallback(FrameStateCallback* callback, EventHandler* handler);

+

设置帧状态回调

+

CameraConfig

+

static CameraConfig* CreateCameraConfig()

+

创建camera配置信息实例

+

CameraAbility

+

std::list<Size> GetSupportedSizes(int format)

+

根据类型获取支持输出图像尺寸大小

+

CameraAbility

+

std::vector<int32_t> GetSupportedAeMode()

+

获取支持的ae模式

+

CameraAbility

+

std::list<uint32_t> GetSupportedParameters()

+

获取支持的参数

+

CameraAbility

+

std::list<T> GetParameterRange(uint32_t key)

+

获取支持的参数范围

+

CameraAbility

+

std::list<uint32_t> GetSupportedResults()

+

获取支持返回值

+

CameraAbility

+

std::list<uint32_t> GetSupportedProperties()

+

获取支持的属性

+

CameraAbility

+

T GetPropertyValue(uint32_t key)

+

获取支持的属性对应的值

+

CameraDevice

+

CameraDeviceCallback()

+

获取指定属性对应的值

+

CameraDevice

+

void OnCameraAccessPrioritiesChanged​(std::string cameraId)

+

camera设备构造函数

+

CameraDevice

+

void OnCameraStatus​(std::string cameraId, int32_t status)

+

camera设备状态变化时的回调

+

CameraStateCallback

+

CameraStateCallback​()

+

camera状态回调

+

CameraStateCallback

+

void OnConfigured​(Camera& camera)

+

camera配置成功回调

+

CameraStateCallback

+

void OnConfigureFailed​(Camera& camera,int32_t errorCode)

+

camera配置失败回调

+

CameraStateCallback

+

void OnCreated​(Camera& camera)

+

camera创建成功回调

+

CameraStateCallback

+

void OnCreateFailed​(std::string cameraId,int32_t errorCode)

+

camera创建失败回调

+

CameraStateCallback

+

void OnFatalError​(Camera& camera,int32_t errorCode)

+

camera内部错误回调

+

CameraStateCallback

+

void OnReleased​(Camera& camera)

+

camera释放回调

+

FrameStateCallback

+

FrameStateCallback​()

+

帧状态回调

+

FrameStateCallback

+

void OnFrameFinished(Camera& camera, FrameConfig& frameConfig, FrameResult& frameResult)

+

拍照帧完成回调

+

FrameStateCallback

+

void OnFrameError​(Camera& camera, FrameConfig& frameConfig, int32_t errorCode, FrameResult& frameResult)

+

拍照帧异常回调

+

FrameStateCallback

+

void OnFrameProgressed​(Camera& camera, FrameConfig& frameConfig, FrameResult& frameResult)

+

拍照帧处理中回调

+

FrameStateCallback

+

void OnFrameStarted​(Camera& camera, FrameConfig& frameConfig,long frameNumber,long timestamp)

+

拍照帧开始回调

+

FrameConfig

+

int32_t GetFrameConfigType()

+

获取帧配置类型

+

FrameConfig

+

std::list<HarmonyOS::Surface> GetSurfaces()

+

获取帧配置的surface

+

FrameConfig

+

int32_t GetAeMode()

+

获取AE模式

+

FrameConfig

+

Rect& GetAeRect()

+

获取AE位置

+

FrameConfig

+

int32_t GetImageRotation()

+

获取图片旋转状态

+

FrameConfig

+

T Get(uint32_t key)

+

获取指定key对应的值

+

FrameConfig

+

std::list<uint32_t> GetKeys()

+

获取当前key列表

+

FrameConfig

+

void AddSurface(HarmonyOS::AGP::UISurface& surface);

+

添加surface

+

FrameConfig

+

void RemoveSurface(HarmonyOS::AGP::UISurface& surface);

+

删除surface

+

FrameConfig

+

void SetAeMode(int32_t aeMode, Rect& rect)

+

配置AE模式

+

FrameConfig

+

void SetImageRotation(int32_t degrees)

+

配置图片旋转状态

+

FrameConfig

+

void SetParameter(uint32_t key, const T value)

+

配置指定参数

+

FrameConfig

+

void GetParameter(uint32_t key, const T value)

+

获取指定key对应的参数

+
+ +约束与限制 + +无。 + +开发步骤 + +1. 实现设备状态回调的派生类,用户在设备状态发生变更(如新插入相机设备/相机掉线)时,自定义操作。 + + ``` + class SampleCameraDeviceCallback : public CameraDeviceCallback { + void onCameraStatus(std::string cameraId, int32_t status) override + { + //do something when camera is available/unavailable + } + }; + ``` + +2. 实现帧事件回调的派生类,这里在拿到帧数据以后将其转存为文件。 + + ``` + class TestFrameStateCallback : public FrameStateCallback { + void OnFrameFinished(Camera &camera, FrameConfig &fc, FrameResult &result) override + { + cout << "Receive frame complete inform." << endl; + if (fc.GetFrameConfigType() == FRAME_CONFIG_CAPTURE) { + cout << "Capture frame received." << endl; + list surfaceList = fc.GetSurfaces(); + for (Surface *surface : surfaceList) { + SurfaceBuffer *buffer = surface->AcquireBuffer(); + if (buffer != nullptr) { + char *virtAddr = static_cast(buffer->GetVirAddr()); + if (virtAddr != nullptr) { + SampleSaveCapture(virtAddr, buffer->GetSize()); + } + surface->ReleaseBuffer(buffer); + } + delete surface; + } + delete &fc; + } + } + }; + ``` + +3. 实现相机状态回调的派生类,当相机状态发生变化(配置成功/失败,创建成功/失败\)时,自定义操作。 + + ``` + static void SampleSaveCapture(const char *p, uint32_t size) + { + cout << "Start saving picture" << endl; + struct timeval tv; + gettimeofday(&tv, NULL); + struct tm *ltm = localtime(&tv.tv_sec); + if (ltm != nullptr) { + ostringstream ss("Capture_"); + ss << "Capture" << ltm->tm_hour << "-" << ltm->tm_min << "-" << ltm->tm_sec << ".jpg"; + + ofstream pic("/tmp/" + ss.str(), ofstream::out | ofstream::trunc); + cout << "write " << size << " bytes" << endl; + pic.write(p, size); + cout << "Saving picture end" << endl; + } + } + + class TestFrameStateCallback : public FrameStateCallback { + void OnFrameFinished(Camera &camera, FrameConfig &fc, FrameResult &result) override + { + cout << "Receive frame complete inform." << endl; + if (fc.GetFrameConfigType() == FRAME_CONFIG_CAPTURE) { + cout << "Capture frame received." << endl; + list surfaceList = fc.GetSurfaces(); + for (Surface *surface : surfaceList) { + SurfaceBuffer *buffer = surface->AcquireBuffer(); + if (buffer != nullptr) { + char *virtAddr = static_cast(buffer->GetVirAddr()); + if (virtAddr != nullptr) { + SampleSaveCapture(virtAddr, buffer->GetSize()); + } + surface->ReleaseBuffer(buffer); + } + delete surface; + } + delete &fc; + } + } + }; + ``` + +4. 创建CameraKit,用于创建和获取camera信息。 + + ``` + CameraKit *camKit = CameraKit::GetInstance(); + list camList = camKit->GetCameraIdList(); + string camId; + for (auto &cam : camList) { + cout << "camera name:" << cam << endl; + const CameraAbility *ability = camKit->GetCameraAbility(cam); + /* find camera which fits user's ability */ + list sizeList = ability->GetSupportedSizes(0); + if (find(sizeList.begin(), sizeList.end(), CAM_PIC_1080P) != sizeList.end()) { + camId = cam; + break; + } + } + ``` + +5. 创建Camera实例。 + + ``` + EventHandler eventHdlr; // Create a thread to handle callback events + SampleCameraStateMng CamStateMng(eventHdlr); + + camKit->CreateCamera(camId, CamStateMng, eventHdlr); + ``` + +6. 根据[步骤1](zh-cn_topic_0000001050754209.md#li378084192111)、[步骤2](zh-cn_topic_0000001050754209.md#li8716104682913)、[步骤3](zh-cn_topic_0000001050754209.md#li6671035102514)中的回调设计,camera实例创建成功后会进行配置操作,主流程中app需要设计同步机制。 + + ``` + void OnCreated(Camera &c) override + { + cout << "Sample recv OnCreate camera." << endl; + auto config = CameraConfig::CreateCameraConfig(); + config->SetFrameStateCallback(&fsCb_, &eventHdlr_); + c.Configure(*config); + cam_ = &c; + } + + void Capture() + { + if (cam_ == nullptr) { + cout << "Camera is not ready." << endl; + return; + } + FrameConfig *fc = new FrameConfig(FRAME_CONFIG_CAPTURE); + Surface *surface = Surface::CreateSurface(); + if (surface == nullptr) { + delete fc; + } + surface->SetWidthAndHeight(1920, 1080); /* 1920:width,1080:height */ + fc->AddSurface(*surface); + cam_->TriggerSingleCapture(*fc); + } + ``` + + + + diff --git a/camera/bundle.json b/camera/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..cdf523d51b59617dce3a323f794e290c1df0c9ab --- /dev/null +++ b/camera/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/camera", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "相机是HarmonyOS多媒体进程提供的服务之一,提供了相机的录像、预览、拍照功能,支持多用户并发取流。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/multimedia &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "camera" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "foundation" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/camera_sample_app/LICENSE b/camera_sample_app/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/camera_sample_app/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/camera_sample_app/README.md b/camera_sample_app/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8178c76d627cade75005b40711b92f4177bc6cfc --- /dev/null +++ b/camera_sample_app/README.md @@ -0,0 +1 @@ +readme diff --git a/camera_sample_app/bundle.json b/camera_sample_app/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..fc2eb0d0c62f5e72aae002383ce88ca6ce488602 --- /dev/null +++ b/camera_sample_app/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/camera_sample_app", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "camera_sample_app", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/applications/sample/camera &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "app" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "application" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/cjson/LICENSE b/cjson/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/cjson/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/cjson/README.md b/cjson/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cd18c7c54519b0834576e6d8fd33e6da10c7e81d --- /dev/null +++ b/cjson/README.md @@ -0,0 +1,571 @@ +# cJSON + +Ultralightweight JSON parser in ANSI C. + +## Table of contents +* [License](#license) +* [Usage](#usage) + * [Welcome to cJSON](#welcome-to-cjson) + * [Building](#building) + * [Copying the source](#copying-the-source) + * [CMake](#cmake) + * [Makefile](#makefile) + * [Vcpkg](#Vcpkg) + * [Including cJSON](#including-cjson) + * [Data Structure](#data-structure) + * [Working with the data structure](#working-with-the-data-structure) + * [Basic types](#basic-types) + * [Arrays](#arrays) + * [Objects](#objects) + * [Parsing JSON](#parsing-json) + * [Printing JSON](#printing-json) + * [Example](#example) + * [Printing](#printing) + * [Parsing](#parsing) + * [Caveats](#caveats) + * [Zero Character](#zero-character) + * [Character Encoding](#character-encoding) + * [C Standard](#c-standard) + * [Floating Point Numbers](#floating-point-numbers) + * [Deep Nesting Of Arrays And Objects](#deep-nesting-of-arrays-and-objects) + * [Thread Safety](#thread-safety) + * [Case Sensitivity](#case-sensitivity) + * [Duplicate Object Members](#duplicate-object-members) + * [Enjoy cJSON!](#enjoy-cjson) + +## License + +MIT License + +> Copyright (c) 2009-2017 Dave Gamble and cJSON contributors +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +## Usage + +### Welcome to cJSON. + +cJSON aims to be the dumbest possible parser that you can get your job done with. +It's a single file of C, and a single header file. + +JSON is described best here: http://www.json.org/ +It's like XML, but fat-free. You use it to move data around, store things, or just +generally represent your program's state. + +As a library, cJSON exists to take away as much legwork as it can, but not get in your way. +As a point of pragmatism (i.e. ignoring the truth), I'm going to say that you can use it +in one of two modes: Auto and Manual. Let's have a quick run-through. + +I lifted some JSON from this page: http://www.json.org/fatfree.html +That page inspired me to write cJSON, which is a parser that tries to share the same +philosophy as JSON itself. Simple, dumb, out of the way. + +### Building + +There are several ways to incorporate cJSON into your project. + +#### copying the source + +Because the entire library is only one C file and one header file, you can just copy `cJSON.h` and `cJSON.c` to your projects source and start using it. + +cJSON is written in ANSI C (C89) in order to support as many platforms and compilers as possible. + +#### CMake + +With CMake, cJSON supports a full blown build system. This way you get the most features. CMake with an equal or higher version than 2.8.5 is supported. With CMake it is recommended to do an out of tree build, meaning the compiled files are put in a directory separate from the source files. So in order to build cJSON with CMake on a Unix platform, make a `build` directory and run CMake inside it. + +``` +mkdir build +cd build +cmake .. +``` + +This will create a Makefile and a bunch of other files. You can then compile it: + +``` +make +``` + +And install it with `make install` if you want. By default it installs the headers `/usr/local/include/cjson` and the libraries to `/usr/local/lib`. It also installs files for pkg-config to make it easier to detect and use an existing installation of CMake. And it installs CMake config files, that can be used by other CMake based projects to discover the library. + +You can change the build process with a list of different options that you can pass to CMake. Turn them on with `On` and off with `Off`: + +* `-DENABLE_CJSON_TEST=On`: Enable building the tests. (on by default) +* `-DENABLE_CJSON_UTILS=On`: Enable building cJSON_Utils. (off by default) +* `-DENABLE_TARGET_EXPORT=On`: Enable the export of CMake targets. Turn off if it makes problems. (on by default) +* `-DENABLE_CUSTOM_COMPILER_FLAGS=On`: Enable custom compiler flags (currently for Clang, GCC and MSVC). Turn off if it makes problems. (on by default) +* `-DENABLE_VALGRIND=On`: Run tests with [valgrind](http://valgrind.org). (off by default) +* `-DENABLE_SANITIZERS=On`: Compile cJSON with [AddressSanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer) and [UndefinedBehaviorSanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html) enabled (if possible). (off by default) +* `-DENABLE_SAFE_STACK`: Enable the [SafeStack](https://clang.llvm.org/docs/SafeStack.html) instrumentation pass. Currently only works with the Clang compiler. (off by default) +* `-DBUILD_SHARED_LIBS=On`: Build the shared libraries. (on by default) +* `-DBUILD_SHARED_AND_STATIC_LIBS=On`: Build both shared and static libraries. (off by default) +* `-DCMAKE_INSTALL_PREFIX=/usr`: Set a prefix for the installation. +* `-DENABLE_LOCALES=On`: Enable the usage of localeconv method. ( on by default ) +* `-DCJSON_OVERRIDE_BUILD_SHARED_LIBS=On`: Enable overriding the value of `BUILD_SHARED_LIBS` with `-DCJSON_BUILD_SHARED_LIBS`. + +If you are packaging cJSON for a distribution of Linux, you would probably take these steps for example: +``` +mkdir build +cd build +cmake .. -DENABLE_CJSON_UTILS=On -DENABLE_CJSON_TEST=Off -DCMAKE_INSTALL_PREFIX=/usr +make +make DESTDIR=$pkgdir install +``` + +On Windows CMake is usually used to create a Visual Studio solution file by running it inside the Developer Command Prompt for Visual Studio, for exact steps follow the official documentation from CMake and Microsoft and use the online search engine of your choice. The descriptions of the the options above still generally apply, although not all of them work on Windows. + +#### Makefile + +**NOTE:** This Method is deprecated. Use CMake if at all possible. Makefile support is limited to fixing bugs. + +If you don't have CMake available, but still have GNU make. You can use the makefile to build cJSON: + +Run this command in the directory with the source code and it will automatically compile static and shared libraries and a little test program (not the full test suite). + +``` +make all +``` + +If you want, you can install the compiled library to your system using `make install`. By default it will install the headers in `/usr/local/include/cjson` and the libraries in `/usr/local/lib`. But you can change this behavior by setting the `PREFIX` and `DESTDIR` variables: `make PREFIX=/usr DESTDIR=temp install`. And uninstall them with: `make PREFIX=/usr DESTDIR=temp uninstall`. + +#### Vcpkg + +You can download and install cJSON using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager: +``` +git clone https://github.com/Microsoft/vcpkg.git +cd vcpkg +./bootstrap-vcpkg.sh +./vcpkg integrate install +vcpkg install cjson +``` + +The cJSON port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. + +### Including cJSON + +If you installed it via CMake or the Makefile, you can include cJSON like this: + +```c +#include +``` + +### Data Structure + +cJSON represents JSON data using the `cJSON` struct data type: + +```c +/* The cJSON structure: */ +typedef struct cJSON +{ + struct cJSON *next; + struct cJSON *prev; + struct cJSON *child; + int type; + char *valuestring; + /* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */ + int valueint; + double valuedouble; + char *string; +} cJSON; +``` + +An item of this type represents a JSON value. The type is stored in `type` as a bit-flag (**this means that you cannot find out the type by just comparing the value of `type`**). + +To check the type of an item, use the corresponding `cJSON_Is...` function. It does a `NULL` check followed by a type check and returns a boolean value if the item is of this type. + +The type can be one of the following: + +* `cJSON_Invalid` (check with `cJSON_IsInvalid`): Represents an invalid item that doesn't contain any value. You automatically have this type if you set the item to all zero bytes. +* `cJSON_False` (check with `cJSON_IsFalse`): Represents a `false` boolean value. You can also check for boolean values in general with `cJSON_IsBool`. +* `cJSON_True` (check with `cJSON_IsTrue`): Represents a `true` boolean value. You can also check for boolean values in general with `cJSON_IsBool`. +* `cJSON_NULL` (check with `cJSON_IsNull`): Represents a `null` value. +* `cJSON_Number` (check with `cJSON_IsNumber`): Represents a number value. The value is stored as a double in `valuedouble` and also in `valueint`. If the number is outside of the range of an integer, `INT_MAX` or `INT_MIN` are used for `valueint`. +* `cJSON_String` (check with `cJSON_IsString`): Represents a string value. It is stored in the form of a zero terminated string in `valuestring`. +* `cJSON_Array` (check with `cJSON_IsArray`): Represent an array value. This is implemented by pointing `child` to a linked list of `cJSON` items that represent the values in the array. The elements are linked together using `next` and `prev`, where the first element has `prev.next == NULL` and the last element `next == NULL`. +* `cJSON_Object` (check with `cJSON_IsObject`): Represents an object value. Objects are stored same way as an array, the only difference is that the items in the object store their keys in `string`. +* `cJSON_Raw` (check with `cJSON_IsRaw`): Represents any kind of JSON that is stored as a zero terminated array of characters in `valuestring`. This can be used, for example, to avoid printing the same static JSON over and over again to save performance. cJSON will never create this type when parsing. Also note that cJSON doesn't check if it is valid JSON. + +Additionally there are the following two flags: + +* `cJSON_IsReference`: Specifies that the item that `child` points to and/or `valuestring` is not owned by this item, it is only a reference. So `cJSON_Delete` and other functions will only deallocate this item, not its `child`/`valuestring`. +* `cJSON_StringIsConst`: This means that `string` points to a constant string. This means that `cJSON_Delete` and other functions will not try to deallocate `string`. + +### Working with the data structure + +For every value type there is a `cJSON_Create...` function that can be used to create an item of that type. +All of these will allocate a `cJSON` struct that can later be deleted with `cJSON_Delete`. +Note that you have to delete them at some point, otherwise you will get a memory leak. +**Important**: If you have added an item to an array or an object already, you **mustn't** delete it with `cJSON_Delete`. Adding it to an array or object transfers its ownership so that when that array or object is deleted, +it gets deleted as well. You also could use `cJSON_SetValuestring` to change a `cJSON_String`'s `valuestring`, and you needn't to free the previous `valuestring` manually. + +#### Basic types + +* **null** is created with `cJSON_CreateNull` +* **booleans** are created with `cJSON_CreateTrue`, `cJSON_CreateFalse` or `cJSON_CreateBool` +* **numbers** are created with `cJSON_CreateNumber`. This will set both `valuedouble` and `valueint`. If the number is outside of the range of an integer, `INT_MAX` or `INT_MIN` are used for `valueint` +* **strings** are created with `cJSON_CreateString` (copies the string) or with `cJSON_CreateStringReference` (directly points to the string. This means that `valuestring` won't be deleted by `cJSON_Delete` and you are responsible for its lifetime, useful for constants) + +#### Arrays + +You can create an empty array with `cJSON_CreateArray`. `cJSON_CreateArrayReference` can be used to create an array that doesn't "own" its content, so its content doesn't get deleted by `cJSON_Delete`. + +To add items to an array, use `cJSON_AddItemToArray` to append items to the end. +Using `cJSON_AddItemReferenceToArray` an element can be added as a reference to another item, array or string. This means that `cJSON_Delete` will not delete that items `child` or `valuestring` properties, so no double frees are occurring if they are already used elsewhere. +To insert items in the middle, use `cJSON_InsertItemInArray`. It will insert an item at the given 0 based index and shift all the existing items to the right. + +If you want to take an item out of an array at a given index and continue using it, use `cJSON_DetachItemFromArray`, it will return the detached item, so be sure to assign it to a pointer, otherwise you will have a memory leak. + +Deleting items is done with `cJSON_DeleteItemFromArray`. It works like `cJSON_DetachItemFromArray`, but deletes the detached item via `cJSON_Delete`. + +You can also replace an item in an array in place. Either with `cJSON_ReplaceItemInArray` using an index or with `cJSON_ReplaceItemViaPointer` given a pointer to an element. `cJSON_ReplaceItemViaPointer` will return `0` if it fails. What this does internally is to detach the old item, delete it and insert the new item in its place. + +To get the size of an array, use `cJSON_GetArraySize`. Use `cJSON_GetArrayItem` to get an element at a given index. + +Because an array is stored as a linked list, iterating it via index is inefficient (`O(n²)`), so you can iterate over an array using the `cJSON_ArrayForEach` macro in `O(n)` time complexity. + +#### Objects + +You can create an empty object with `cJSON_CreateObject`. `cJSON_CreateObjectReference` can be used to create an object that doesn't "own" its content, so its content doesn't get deleted by `cJSON_Delete`. + +To add items to an object, use `cJSON_AddItemToObject`. Use `cJSON_AddItemToObjectCS` to add an item to an object with a name that is a constant or reference (key of the item, `string` in the `cJSON` struct), so that it doesn't get freed by `cJSON_Delete`. +Using `cJSON_AddItemReferenceToArray` an element can be added as a reference to another object, array or string. This means that `cJSON_Delete` will not delete that items `child` or `valuestring` properties, so no double frees are occurring if they are already used elsewhere. + +If you want to take an item out of an object, use `cJSON_DetachItemFromObjectCaseSensitive`, it will return the detached item, so be sure to assign it to a pointer, otherwise you will have a memory leak. + +Deleting items is done with `cJSON_DeleteItemFromObjectCaseSensitive`. It works like `cJSON_DetachItemFromObjectCaseSensitive` followed by `cJSON_Delete`. + +You can also replace an item in an object in place. Either with `cJSON_ReplaceItemInObjectCaseSensitive` using a key or with `cJSON_ReplaceItemViaPointer` given a pointer to an element. `cJSON_ReplaceItemViaPointer` will return `0` if it fails. What this does internally is to detach the old item, delete it and insert the new item in its place. + +To get the size of an object, you can use `cJSON_GetArraySize`, this works because internally objects are stored as arrays. + +If you want to access an item in an object, use `cJSON_GetObjectItemCaseSensitive`. + +To iterate over an object, you can use the `cJSON_ArrayForEach` macro the same way as for arrays. + +cJSON also provides convenient helper functions for quickly creating a new item and adding it to an object, like `cJSON_AddNullToObject`. They return a pointer to the new item or `NULL` if they failed. + +### Parsing JSON + +Given some JSON in a zero terminated string, you can parse it with `cJSON_Parse`. + +```c +cJSON *json = cJSON_Parse(string); +``` + +Given some JSON in a string (whether zero terminated or not), you can parse it with `cJSON_ParseWithLength`. + +```c +cJSON *json = cJSON_ParseWithLength(string, buffer_length); +``` + +It will parse the JSON and allocate a tree of `cJSON` items that represents it. Once it returns, you are fully responsible for deallocating it after use with `cJSON_Delete`. + +The allocator used by `cJSON_Parse` is `malloc` and `free` by default but can be changed (globally) with `cJSON_InitHooks`. + +If an error occurs a pointer to the position of the error in the input string can be accessed using `cJSON_GetErrorPtr`. Note though that this can produce race conditions in multithreading scenarios, in that case it is better to use `cJSON_ParseWithOpts` with `return_parse_end`. +By default, characters in the input string that follow the parsed JSON will not be considered as an error. + +If you want more options, use `cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated)`. +`return_parse_end` returns a pointer to the end of the JSON in the input string or the position that an error occurs at (thereby replacing `cJSON_GetErrorPtr` in a thread safe way). `require_null_terminated`, if set to `1` will make it an error if the input string contains data after the JSON. + +If you want more options giving buffer length, use `cJSON_ParseWithLengthOpts(const char *value, size_t buffer_length, const char **return_parse_end, cJSON_bool require_null_terminated)`. + +### Printing JSON + +Given a tree of `cJSON` items, you can print them as a string using `cJSON_Print`. + +```c +char *string = cJSON_Print(json); +``` + +It will allocate a string and print a JSON representation of the tree into it. Once it returns, you are fully responsible for deallocating it after use with your allocator. (usually `free`, depends on what has been set with `cJSON_InitHooks`). + +`cJSON_Print` will print with whitespace for formatting. If you want to print without formatting, use `cJSON_PrintUnformatted`. + +If you have a rough idea of how big your resulting string will be, you can use `cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt)`. `fmt` is a boolean to turn formatting with whitespace on and off. `prebuffer` specifies the first buffer size to use for printing. `cJSON_Print` currently uses 256 bytes for its first buffer size. Once printing runs out of space, a new buffer is allocated and the old gets copied over before printing is continued. + +These dynamic buffer allocations can be completely avoided by using `cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format)`. It takes a buffer to a pointer to print to and its length. If the length is reached, printing will fail and it returns `0`. In case of success, `1` is returned. Note that you should provide 5 bytes more than is actually needed, because cJSON is not 100% accurate in estimating if the provided memory is enough. + +### Example + +In this example we want to build and parse the following JSON: + +```json +{ + "name": "Awesome 4K", + "resolutions": [ + { + "width": 1280, + "height": 720 + }, + { + "width": 1920, + "height": 1080 + }, + { + "width": 3840, + "height": 2160 + } + ] +} +``` + +#### Printing + +Let's build the above JSON and print it to a string: + +```c +//create a monitor with a list of supported resolutions +//NOTE: Returns a heap allocated string, you are required to free it after use. +char *create_monitor(void) +{ + const unsigned int resolution_numbers[3][2] = { + {1280, 720}, + {1920, 1080}, + {3840, 2160} + }; + char *string = NULL; + cJSON *name = NULL; + cJSON *resolutions = NULL; + cJSON *resolution = NULL; + cJSON *width = NULL; + cJSON *height = NULL; + size_t index = 0; + + cJSON *monitor = cJSON_CreateObject(); + if (monitor == NULL) + { + goto end; + } + + name = cJSON_CreateString("Awesome 4K"); + if (name == NULL) + { + goto end; + } + /* after creation was successful, immediately add it to the monitor, + * thereby transferring ownership of the pointer to it */ + cJSON_AddItemToObject(monitor, "name", name); + + resolutions = cJSON_CreateArray(); + if (resolutions == NULL) + { + goto end; + } + cJSON_AddItemToObject(monitor, "resolutions", resolutions); + + for (index = 0; index < (sizeof(resolution_numbers) / (2 * sizeof(int))); ++index) + { + resolution = cJSON_CreateObject(); + if (resolution == NULL) + { + goto end; + } + cJSON_AddItemToArray(resolutions, resolution); + + width = cJSON_CreateNumber(resolution_numbers[index][0]); + if (width == NULL) + { + goto end; + } + cJSON_AddItemToObject(resolution, "width", width); + + height = cJSON_CreateNumber(resolution_numbers[index][1]); + if (height == NULL) + { + goto end; + } + cJSON_AddItemToObject(resolution, "height", height); + } + + string = cJSON_Print(monitor); + if (string == NULL) + { + fprintf(stderr, "Failed to print monitor.\n"); + } + +end: + cJSON_Delete(monitor); + return string; +} +``` + +Alternatively we can use the `cJSON_Add...ToObject` helper functions to make our lifes a little easier: + +```c +//NOTE: Returns a heap allocated string, you are required to free it after use. +char *create_monitor_with_helpers(void) +{ + const unsigned int resolution_numbers[3][2] = { + {1280, 720}, + {1920, 1080}, + {3840, 2160} + }; + char *string = NULL; + cJSON *resolutions = NULL; + size_t index = 0; + + cJSON *monitor = cJSON_CreateObject(); + + if (cJSON_AddStringToObject(monitor, "name", "Awesome 4K") == NULL) + { + goto end; + } + + resolutions = cJSON_AddArrayToObject(monitor, "resolutions"); + if (resolutions == NULL) + { + goto end; + } + + for (index = 0; index < (sizeof(resolution_numbers) / (2 * sizeof(int))); ++index) + { + cJSON *resolution = cJSON_CreateObject(); + + if (cJSON_AddNumberToObject(resolution, "width", resolution_numbers[index][0]) == NULL) + { + goto end; + } + + if (cJSON_AddNumberToObject(resolution, "height", resolution_numbers[index][1]) == NULL) + { + goto end; + } + + cJSON_AddItemToArray(resolutions, resolution); + } + + string = cJSON_Print(monitor); + if (string == NULL) + { + fprintf(stderr, "Failed to print monitor.\n"); + } + +end: + cJSON_Delete(monitor); + return string; +} +``` + +#### Parsing + +In this example we will parse a JSON in the above format and check if the monitor supports a Full HD resolution while printing some diagnostic output: + +```c +/* return 1 if the monitor supports full hd, 0 otherwise */ +int supports_full_hd(const char * const monitor) +{ + const cJSON *resolution = NULL; + const cJSON *resolutions = NULL; + const cJSON *name = NULL; + int status = 0; + cJSON *monitor_json = cJSON_Parse(monitor); + if (monitor_json == NULL) + { + const char *error_ptr = cJSON_GetErrorPtr(); + if (error_ptr != NULL) + { + fprintf(stderr, "Error before: %s\n", error_ptr); + } + status = 0; + goto end; + } + + name = cJSON_GetObjectItemCaseSensitive(monitor_json, "name"); + if (cJSON_IsString(name) && (name->valuestring != NULL)) + { + printf("Checking monitor \"%s\"\n", name->valuestring); + } + + resolutions = cJSON_GetObjectItemCaseSensitive(monitor_json, "resolutions"); + cJSON_ArrayForEach(resolution, resolutions) + { + cJSON *width = cJSON_GetObjectItemCaseSensitive(resolution, "width"); + cJSON *height = cJSON_GetObjectItemCaseSensitive(resolution, "height"); + + if (!cJSON_IsNumber(width) || !cJSON_IsNumber(height)) + { + status = 0; + goto end; + } + + if ((width->valuedouble == 1920) && (height->valuedouble == 1080)) + { + status = 1; + goto end; + } + } + +end: + cJSON_Delete(monitor_json); + return status; +} +``` + +Note that there are no NULL checks except for the result of `cJSON_Parse` because `cJSON_GetObjectItemCaseSensitive` checks for `NULL` inputs already, so a `NULL` value is just propagated and `cJSON_IsNumber` and `cJSON_IsString` return `0` if the input is `NULL`. + +### Caveats + +#### Zero Character + +cJSON doesn't support strings that contain the zero character `'\0'` or `\u0000`. This is impossible with the current API because strings are zero terminated. + +#### Character Encoding + +cJSON only supports UTF-8 encoded input. In most cases it doesn't reject invalid UTF-8 as input though, it just propagates it through as is. As long as the input doesn't contain invalid UTF-8, the output will always be valid UTF-8. + +#### C Standard + +cJSON is written in ANSI C (or C89, C90). If your compiler or C library doesn't follow this standard, correct behavior is not guaranteed. + +NOTE: ANSI C is not C++ therefore it shouldn't be compiled with a C++ compiler. You can compile it with a C compiler and link it with your C++ code however. Although compiling with a C++ compiler might work, correct behavior is not guaranteed. + +#### Floating Point Numbers + +cJSON does not officially support any `double` implementations other than IEEE754 double precision floating point numbers. It might still work with other implementations but bugs with these will be considered invalid. + +The maximum length of a floating point literal that cJSON supports is currently 63 characters. + +#### Deep Nesting Of Arrays And Objects + +cJSON doesn't support arrays and objects that are nested too deeply because this would result in a stack overflow. To prevent this cJSON limits the depth to `CJSON_NESTING_LIMIT` which is 1000 by default but can be changed at compile time. + +#### Thread Safety + +In general cJSON is **not thread safe**. + +However it is thread safe under the following conditions: + +* `cJSON_GetErrorPtr` is never used (the `return_parse_end` parameter of `cJSON_ParseWithOpts` can be used instead) +* `cJSON_InitHooks` is only ever called before using cJSON in any threads. +* `setlocale` is never called before all calls to cJSON functions have returned. + +#### Case Sensitivity + +When cJSON was originally created, it didn't follow the JSON standard and didn't make a distinction between uppercase and lowercase letters. If you want the correct, standard compliant, behavior, you need to use the `CaseSensitive` functions where available. + +#### Duplicate Object Members + +cJSON supports parsing and printing JSON that contains objects that have multiple members with the same name. `cJSON_GetObjectItemCaseSensitive` however will always only return the first one. + +# Enjoy cJSON! + +- Dave Gamble (original author) +- Max Bruckner and Alan Wang (current maintainer) +- and the other [cJSON contributors](CONTRIBUTORS.md) diff --git a/cjson/bundle.json b/cjson/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..dc31c3b53ad01ff675ec91db22b64aa9c04acd79 --- /dev/null +++ b/cjson/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/cjson", + "version": "1.8.0", + "description": "Ultralightweight JSON parser in ANSI C", + "publishAs": "code-segment", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/cJSON && mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "json" + ], + "author": {}, + "repository": "https://github.com/DaveGamble/cJSON", + "license": "Apache V2", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/cmsis/LICENSE b/cmsis/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/cmsis/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/cmsis/README.md b/cmsis/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e80769ff8865b6425eab83d7b0cb8035c24c23d0 --- /dev/null +++ b/cmsis/README.md @@ -0,0 +1,138 @@ +# CMSIS Version 5 + +The branch *master* of this GitHub repository contains the CMSIS Version 5.6.0. The [documentation](http://arm-software.github.io/CMSIS_5/General/html/index.html) is available under http://arm-software.github.io/CMSIS_5/General/html/index.html + +Use [Issues](https://github.com/ARM-software/CMSIS_5#issues-and-labels) to provide feedback and report problems for CMSIS Version 5. + +**Note:** The branch *develop* of this GitHub repository reflects our current state of development and is constantly updated. It gives our users and partners contiguous access to the CMSIS development. It allows you to review the work and provide feedback or create pull requests for contributions. + +A [pre-built documentation](http://www.keil.com/pack/doc/CMSIS_Dev/index.html) is updated from time to time, but may be also generated using the instructions under [Generate CMSIS Pack for Release](https://github.com/ARM-software/CMSIS_5#generate-cmsis-pack-for-release). + +## Overview of CMSIS Components + +The following is an list of all CMSIS components that are available. + +| CMSIS-... | Target Processors | Description | +|:----------|:--------------------|:-------------| +|[Core(M)](http://arm-software.github.io/CMSIS_5/Core/html/index.html) | All Cortex-M, SecurCore | Standardized API for the Cortex-M processor core and peripherals. Includes intrinsic functions for Cortex-M4/M7/M33/M35P SIMD instructions.| +|[Core(A)](http://arm-software.github.io/CMSIS_5/Core_A/html/index.html)| Cortex-A5/A7/A9 | API and basic run-time system for the Cortex-A5/A7/A9 processor core and peripherals.| +|[Driver](http://arm-software.github.io/CMSIS_5/Driver/html/index.html) | All Cortex-M, SecurCore | Generic peripheral driver interfaces for middleware. Connects microcontroller peripherals with middleware that implements for example communication stacks, file systems, or graphic user interfaces.| +|[DSP](http://arm-software.github.io/CMSIS_5/DSP/html/index.html) | All Cortex-M | DSP library collection with over 60 Functions for various data types: fixed-point (fractional q7, q15, q31) and single precision floating-point (32-bit). Implementations optimized for the SIMD instruction set are available for Cortex-M4/M7/M33/M35P.| +|[NN](http://arm-software.github.io/CMSIS_5/NN/html/index.html) | All Cortex-M | Collection of efficient neural network kernels developed to maximize the performance and minimize the memory footprint on Cortex-M processor cores.| +|[RTOS v1](http://arm-software.github.io/CMSIS_5/RTOS/html/index.html) | Cortex-M0/M0+/M3/M4/M7 | Common API for real-time operating systems along with a reference implementation based on RTX. It enables software components that can work across multiple RTOS systems.| +|[RTOS v2](http://arm-software.github.io/CMSIS_5/RTOS2/html/index.html)| All Cortex-M, Cortex-A5/A7/A9 | Extends CMSIS-RTOS v1 with Armv8-M support, dynamic object creation, provisions for multi-core systems, binary compatible interface. | +|[Pack](http://arm-software.github.io/CMSIS_5/Pack/html/index.html) | All Cortex-M, SecurCore, Cortex-A5/A7/A9 | Describes a delivery mechanism for software components, device parameters, and evaluation board support. It simplifies software re-use and product life-cycle management (PLM). | +|[SVD](http://arm-software.github.io/CMSIS_5/SVD/html/index.html) | All Cortex-M, SecurCore | Peripheral description of a device that can be used to create peripheral awareness in debuggers or CMSIS-Core header files.| +|[DAP](http://arm-software.github.io/CMSIS_5/DAP/html/index.html) | All Cortex | Firmware for a debug unit that interfaces to the CoreSight Debug Access Port. | +|[Zone](http://arm-software.github.io/CMSIS_5/Zone/html/index.html) | All Cortex | Defines methods to describe system resources and to partition these resources into multiple projects and execution areas. | + +## Implemented Enhancements + - CMSIS-Core-A, RTX5: implementation for Cortex-A5/A7/A9 + - Support for Armv8-M Architecture (Mainline and Baseline) as well as devices Cortex-M23 and Cortex-M33 + - CMSIS-RTOS2: RTX 5 is now available for IAR, GCC, Arm Compiler 5, Arm Compiler 6 + - CMSIS-RTOS2: FreeRTOS adoption (release) is available https://github.com/ARM-software/CMSIS-FreeRTOS + - CMSIS-NN: Bare metal Neural Network function library. + - CMSIS-DAP v2: with WinUSB for faster communication and separate pipe for SWO support + - Config Wizard extension: access enum’s for configuration information + +## Further Planned Enhancements + - CMSIS-Zone: management of complex system + - CMSIS-Pack: + - System Description SDF Format: describe more complex debug topologies than with a Debug Description in a tool agnostic way + - Github based workflow: allows to develop software packs using github infra-structure + - Flash algorithm via debugger: Some TurstZone enable devices cannot execute RAM. Commands that allow flash programming will be added to Debug Description. + - CPDSC project file format: allows project templates that are agnostic of an IDE + - Minimize need for IDE specific settings: CMSIS-Pack supports IDE specific parameters. Analyze and minimize + +For further details see also the [Slides of the Embedded World CMSIS Partner Meeting](https://github.com/ARM-software/CMSIS_5/blob/develop/CMSIS_EW2019.pdf). + +## Other related GitHub repositories + +| Repository | Description | +|:--------------------------- |:--------------------------------------------------------- | +| [cmsis-pack-eclipse](https://github.com/ARM-software/cmsis-pack-eclipse) | CMSIS-Pack Management for Eclipse reference implementation Pack support | +| [CMSIS-FreeRTOS](https://github.com/arm-software/CMSIS-FreeRTOS) | CMSIS-RTOS adoption of FreeRTOS | +| [CMSIS-Driver](https://github.com/arm-software/CMSIS-Driver) | Generic MCU driver implementations and templates for Ethernet MAC/PHY and Flash. | +| [CMSIS-Driver_Validation](https://github.com/ARM-software/CMSIS-Driver_Validation) | CMSIS-Driver Validation can be used to verify CMSIS-Driver in a user system | +| [CMSIS-Zone](https://github.com/ARM-software/CMSIS-Zone) | CMSIS-Zone Utility along with example projects and FreeMarker templates | +| [NXP_LPC](https://github.com/ARM-software/NXP_LPC) | CMSIS Driver Implementations for the NXP LPC Microcontroller Series | +| [mdk-packs](https://github.com/mdk-packs) | IoT cloud connectors as trail implementations for MDK (help us to make it generic)| +| [trustedfirmware.org](https://www.trustedfirmware.org/) | Arm Trusted Firmware provides a reference implementation of secure world software for Armv8-A and Armv8-M.| + + +## Directory Structure + +| Directory | Content | +|:-------------------- |:--------------------------------------------------------- | +| CMSIS/Core | CMSIS-Core(M) related files (for release) | +| CMSIS/Core_A | CMSIS-Core(A) related files (for release) | +| CMSIS/CoreValidation | Validation for Core(M) and Core(A) (NOT part of release) | +| CMSIS/DAP | CMSIS-DAP related files and examples | +| CMSIS/Driver | CMSIS-Driver API headers and template files | +| CMSIS/DSP | CMSIS-DSP related files | +| CMSIS/NN | CMSIS-NN related files | +| CMSIS/RTOS | RTOS v1 related files (for Cortex-M) | +| CMSIS/RTOS2 | RTOS v2 related files (for Cortex-M & Armv8-M) | +| CMSIS/Pack | CMSIS-Pack examples and tutorials | +| CMSIS/DoxyGen | Source of the documentation | +| CMSIS/Utilities | Utility programs | + +## Generate CMSIS Pack for Release + +This GitHub development repository contains already pre-built libraries (stored in Git-LFS) of various software components (DSP, RTOS, RTOS2). +These libraries are validated for release. Git-LFS needs to be installed to retrieve the actual binary files, please see https://git-lfs.github.com/. + +To build a complete CMSIS pack for installation the following additional tools are required: + - **doxygen.exe** Version: 1.8.6 (Documentation Generator) + - **mscgen.exe** Version: 0.20 (Message Sequence Chart Converter) + - **7z.exe (7-Zip)** Version: 16.02 (File Archiver) + +Using these tools, you can generate on a Windows PC: + - **CMSIS Software Pack** using the batch file **gen_pack.bat** (located in ./CMSIS/Utilities). This batch file also generates the documentation. + + - **CMSIS Documentation** using the batch file **genDoc.bat** (located in ./CMSIS/Doxygen). + +The file ./CMSIS/DoxyGen/How2Doc.txt describes the rules for creating API documentation. + +## License + +Arm CMSIS is licensed under Apache-2.0. + +## Contributions and Pull Requests + +Contributions are accepted under Apache-2.0. Only submit contributions where you have authored all of the code. + +### Issues and Labels + +Please feel free to raise an [issue on GitHub](https://github.com/ARM-software/CMSIS_5/issues) +to report misbehavior (i.e. bugs) or start discussions about enhancements. This +is your best way to interact directly with the maintenance team and the community. +We encourage you to append implementation suggestions as this helps to decrease the +workload of the very limited maintenance team. + +We will be monitoring and responding to issues as best we can. +Please attempt to avoid filing duplicates of open or closed items when possible. +In the spirit of openness we will be tagging issues with the following: + +- **bug** – We consider this issue to be a bug that will be investigated. + +- **wontfix** - We appreciate this issue but decided not to change the current behavior. + +- **enhancement** – Denotes something that will be implemented soon. + +- **future** - Denotes something not yet schedule for implementation. + +- **out-of-scope** - We consider this issue loosely related to CMSIS. It might by implemented outside of CMSIS. Let us know about your work. + +- **question** – We have further questions to this issue. Please review and provide feedback. + +- **documentation** - This issue is a documentation flaw that will be improved in future. + +- **review** - This issue is under review. Please be patient. + +- **DONE** - We consider this issue as resolved - please review and close it. In case of no further activity this issues will be closed after a week. + +- **duplicate** - This issue is already addressed elsewhere, see comment with provided references. + +- **Important Information** - We provide essential informations regarding planned or resolved major enhancements. + diff --git a/cmsis/bundle.json b/cmsis/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..713495970dff9c0970ab54dc918fb15fe2c4c9ae --- /dev/null +++ b/cmsis/bundle.json @@ -0,0 +1,25 @@ +{ + "name": "@ohos/cmsis", + "version": "1.8.0", + "description": "Provides standard, universal real-time operating system (RTOS) APIs", + "publishAs": "code-segment", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/cmsis && mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "api", + "rtos" + ], + "author": {}, + "homepage": "https://hpm.cbg.huawei.com", + "repository": "", + "license": "Apache V2", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/crypto/LICENSE b/crypto/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/crypto/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/crypto/README.md b/crypto/README.md new file mode 100644 index 0000000000000000000000000000000000000000..87a19ec4ddf0109685cedc63347d3e26e9aedfff --- /dev/null +++ b/crypto/README.md @@ -0,0 +1,33 @@ +# crypto\_README + +# 数据加解密模块 + +## 简介 + +数据加解密模块,配合轻量级ACE开发框架子系统,提供支持RSA及AES加解密功能的js api。 + +## 目录 + +``` +base +├──security 安全子系统根目录 +└──── frameworks + ├── crypto_lite 数据加解密模块 + ├── cipher + ├── BUILD.gn cipher模块编译配置 + ├── include cipher模块头文件目录 + └── src cipher模块源文件目录 + ├── js + ├── builtin + ├── BUILD.gn js对接模块编译配置 + ├── include js对接模块头文件目录 + └── src js对接模块源文件目录 + └── LICENSE 开源LICENSE文件 +``` + +## 约束 + +目前仅支持Hi3516DV300版本。 + + + diff --git a/crypto/bundle.json b/crypto/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..3cbe0e77a80c4e124a27956ee82071c9a3026b08 --- /dev/null +++ b/crypto/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/crypto", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "数据加解密模块,配合轻量级ACE开发框架子系统,提供支持RSA及AES加解密功能的js api。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/security &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "crypto" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/curl/LICENSE b/curl/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/curl/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/curl/README.md b/curl/README.md new file mode 100644 index 0000000000000000000000000000000000000000..16e4b006cfb99ed9b261d04c4d5c6d98e194d369 --- /dev/null +++ b/curl/README.md @@ -0,0 +1,86 @@ +![curl logo](https://curl.haxx.se/logo/curl-logo.svg) + +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/63/badge)](https://bestpractices.coreinfrastructure.org/projects/63) +[![Coverity passed](https://scan.coverity.com/projects/curl/badge.svg)](https://scan.coverity.com/projects/curl) +[![Travis-CI Build Status](https://travis-ci.org/curl/curl.svg?branch=master)](https://travis-ci.org/curl/curl) +[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/l1vv31029huhf4g4?svg=true)](https://ci.appveyor.com/project/curlorg/curl) +[![Azure DevOps Build Status](https://dev.azure.com/daniel0244/curl/_apis/build/status/curl.curl?branchName=master)](https://dev.azure.com/daniel0244/curl/_build/latest?definitionId=1&branchName=master) +[![Cirrus Build Status](https://api.cirrus-ci.com/github/curl/curl.svg?branch=master)](https://cirrus-ci.com/github/curl/curl) +[![Backers on Open Collective](https://opencollective.com/curl/backers/badge.svg)](#backers) +[![Sponsors on Open Collective](https://opencollective.com/curl/sponsors/badge.svg)](#sponsors) +[![Language Grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/curl/curl.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/curl/curl/context:cpp) +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d11483a0cc5c4ebd9da4ff9f7cd56690)](https://www.codacy.com/app/curl/curl?utm_source=github.com&utm_medium=referral&utm_content=curl/curl&utm_campaign=Badge_Grade) +[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/curl.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:curl) + +Curl is a command-line tool for transferring data specified with URL +syntax. Find out how to use curl by reading [the curl.1 man +page](https://curl.haxx.se/docs/manpage.html) or [the MANUAL +document](https://curl.haxx.se/docs/manual.html). Find out how to install Curl +by reading [the INSTALL document](https://curl.haxx.se/docs/install.html). + +libcurl is the library curl is using to do its job. It is readily available to +be used by your software. Read [the libcurl.3 man +page](https://curl.haxx.se/libcurl/c/libcurl.html) to learn how! + +You can find answers to the most frequent questions we get in [the FAQ +document](https://curl.haxx.se/docs/faq.html). + +Study [the COPYING file](https://curl.haxx.se/docs/copyright.html) for +distribution terms and similar. If you distribute curl binaries or other +binaries that involve libcurl, you might enjoy [the LICENSE-MIXING +document](https://curl.haxx.se/legal/licmix.html). + +## Contact + +If you have problems, questions, ideas or suggestions, please contact us by +posting to a suitable [mailing list](https://curl.haxx.se/mail/). + +All contributors to the project are listed in [the THANKS +document](https://curl.haxx.se/docs/thanks.html). + +## Website + +Visit the [curl web site](https://curl.haxx.se/) for the latest news and +downloads. + +## Git + +To download the very latest source from the Git server do this: + + git clone https://github.com/curl/curl.git + +(you'll get a directory named curl created, filled with the source code) + +## Security problems + +Report suspected security problems via [our HackerOne +page](https://hackerone.com/curl) and not in public! + +## Notice + +Curl contains pieces of source code that is Copyright (c) 1998, 1999 Kungliga +Tekniska Högskolan. This notice is included here to comply with the +distribution terms. + +## Backers + +Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/curl#backer)] + + + +## Sponsors + +Support this project by becoming a sponsor. Your logo will show up here with a +link to your website. [[Become a +sponsor](https://opencollective.com/curl#sponsor)] + + + + + + + + + + + diff --git a/curl/bundle.json b/curl/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..e39936973b1cdfa2ba78cf90916ea960d61bc414 --- /dev/null +++ b/curl/bundle.json @@ -0,0 +1,24 @@ +{ + "name": "@ohos/curl", + "version": "1.8.0", + "description": "A command line tool and library for transferring data with URL syntax, supporting HTTP, HTTPS, FTP, FTPS, GOPHER, TFTP, SCP, SFTP, SMB, TELNET, DICT, LDAP, LDAPS, FILE, IMAP, SMTP, POP3, RTSP and RTMP. libcurl offers a myriad of powerful features.", + "publishAs": "code-segment", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/curl && mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "json" + ], + "author": {}, + "homepage": "https://curl.haxx.se/", + "repository": "https://github.com/curl/curl.git", + "license": "Apache V2", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/developer_test/LICENSE b/developer_test/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/developer_test/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/developer_test/README.md b/developer_test/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4fd2afc489c63c4f9503534a46d217d1c8211e04 --- /dev/null +++ b/developer_test/README.md @@ -0,0 +1,430 @@ +# 测试子系统README + +# 测试子系统 + +## 简介 + +开发过程采用测试驱动开发模式,开发者基于系统新增特性可以通过开发者自己开发用例保证,对于系统已有特性的修改,也可通过修改项目中原有自测试用例保证,开发者自测试旨在帮助开发者在开发阶段就能开发出高质量代码 + +## 目录 + +**表 1** 开发者自测试工具源代码目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

developertest

+

开发自测试框架

+

developertest/src

+

测试框架源码

+

developertest/src/core

+

测试执行器

+

developertest/src/core/build

+

自测试用例编译

+

developertest/src/core/command

+

对用户输入的命令行处理

+

developertest/src/core/config

+

测试框架配置管理

+

developertest/src/core/driver

+

测试框架驱动执行器

+

developertest/src/core/resource

+

测试框架配置文件

+

developertest/src/core/testcase

+

测试用例管理

+

developertest/src/core/common.py

+

测试框架公共操作

+

developertest/src/core/constants.py

+

测试框架全局常量

+

developertest/src/core/exception.py

+

测试框架异常定义

+

developertest/src/core/utils.py

+

测试框架工具方法

+

developertest/src/main

+

测试框架平台

+

developertest/src/main/__main__.py

+

测试框架内部入口

+

developertest/example

+

测试框架demo用例

+

developertest/third_party

+

测试框架依赖第三方组件适配

+

developertest/BUILD.gn

+

测试子系统编译配置

+

developertest/start.bat

+

开发者自测试入口(Windows)

+

developertest/start.sh

+

开发者自测试入口(Linux)

+
+ +## 约束 + +测试工具环境依赖 + +1. python版本\>=3.7.5 +2. NFS版本\>=V4 +3. 运行操作系统:Windows版本\>=Win10,Linux为Ubuntu18.04 + +## 安装 + +依赖python环境: + +需要本地的python安装串口插件pyserial,在shell界面执行安装命令pip intall pyserial,安装成功如下图 + +![](http://tools.harmonyos.com/mirrors/hpm-image/developer_test_README/figures/zh-cn_image_0000001052278423.png) + +## 编写测试用例 + +- 自测试用例规范 + - 命名规范 + + 测试用例源文件名称和测试套内容保持一致,测试套与用例之间关系1:N,测试套与测试源文件之间关系1:1,每个源文件全局唯一,格式:\[特性\]\_\[功能\]\_\[子功能1\]\_\[子功能1.1\],子功能支持向下细分。 + + 文件命名采用大驼峰方式命名,以Test结尾,如demo用例:developertest/example/cxx\_demo + + - 用例编码规范 + + 开发者自测试用例原则上与特性代码编码规范保持一致,另外需要添加必要的用例描述信息,详见[•自测试用例模板](#li2069415903917) + + - 测试用例编译配置规范 + + 用例采用GN方式编译,配置遵循本开源项目的编译指导[使用](zh-cn_topic_0000001051580775.md) + + +- 自测试用例模板 + + 详见测试demo用例developertest/example/cxx\_demo/test/unittest/common/calc\_subtraction\_test.cpp + + >![](http://tools.harmonyos.com/mirrors/hpm-image/camera_README/public_sys-resources/icon-note.gif) **说明:** + >Feature: 被测特性的描述 + >Function: 被测特性功能 + >SubFunction:被测特性子功能 + >FunctionPoints:被测的功能点 + >EnvConditions:被测特性的环境与被测条件 + >CaseDescription:测试用例描述 + >step:测试复杂逻辑时注明用例执行的步骤 + +- 自测试用例目录规划 + + ``` + subsystem(子系统,系统组件) + ├── module(模块) + │ └── test(模块测试目录) + │ └── unittest(单元测试) + │ ├── common(公共用例) + │ ├── liteos(仅liteos核用例) + │ └── linux(仅Linux核用例) + │ └── moduletest(模块测试) + │ ├── common + │ ├── liteos + │ └── linux + └── test(子系统测试目录) + └── unittest(单元测试) + ├── common + ├── liteos + ├── linux + └── moduletest(模块测试) + ├── common + ├── liteos + ├── linux + + ``` + + >![](http://tools.harmonyos.com/mirrors/hpm-image/camera_README/public_sys-resources/icon-note.gif) **说明:** + >其中liteos和Linux仅不同设备形态举例,对于同一特性在不同开发板上,如果用例没有差异,则用例放置common目录下,如果同一特性,用例区分不同设备形态,可能包含内核差异,芯片平台差异,则用例以目录区分 + +- 编写自测试用例步骤 + 1. 添加用例文件头注释说明 + 2. 引用gtest头文件和ext命名空间 + 3. 添加被测试类头文件 + 4. 定义测试套(测试类) + 5. 实现该测试套具体的测试用例,包括用例注释和用例逻辑实现 + 6. 编写用例编译配置 + + >![](http://tools.harmonyos.com/mirrors/hpm-image/developer_test_README/public_sys-resources/icon-note.gif) **说明:** + >\*样例参考:developertest/example/cxx\_demo/test/unittest/common/calc\_subtraction\_test.cpp + >注意点如下: + >a、SetUp & TearDown是针对该测试套下每条用例执行前和执行后的处理逻辑 + >b、SetUpTestCase & TearDownTestCase是针对该测试套下所有用例执行前和执行后的处理逻辑 + >c、HWTEST的使用:特点:只适合做简单测试(执行不依赖Setup & Teardown)缺点:多个测试场景需要相同数据配置的情况不适用,测试用例之间可能相互影响,不具备独立性 + >d、使用printf函数打印日志 + + +- 编写用例编译文件 + - 定义用例编译构建目标 + 1. 添加用例编译文件头注释信息 + 2. 导入用例编译模板文件 + 3. 指定用例文件输出路径 + 4. 配置用例编译依赖包含目录 + 5. 指定用例编译目标输出的用例执行文件名称 + 6. 编写具体的用例编译脚本(添加需要参与编译的源文件、配置和依赖 ) + 7. 对目标用例文件进行条件分组(分组名称固定为:unittest/moduletest\) + + - 如果存在多个测试套,定义公共编译配置 + - 将测试用例添加到构建系统中 + + >![](http://tools.harmonyos.com/mirrors/hpm-image/developer_test_README/public_sys-resources/icon-note.gif) **说明:** + >\*样例参考:developertest/example/cxx\_demo/test/unittest/common/BUILD.gn + + +- 测试用例级别定义 + - 基本(Level1):<1s + - 重要(Level2):<10s + - 一般(Level3):<5min + - 生僻(Level4):\>5min + + +## 使用测试框架 + +- 安装xdevice基础框架 + 1. 以Windows环境为例,打开xdevice安装目录:test\\xdevice + 2. 打开控制台窗口,执行如下命令 + + ``` + python setup.py install + ``` + + 3. 安装成功如下图 + + ![](http://tools.harmonyos.com/mirrors/hpm-image/developer_test_README/figures/zh-cn_image_0000001054501634.png) + + +- 修改xdevice基础框架配置 + + 文件:xdevice/config/user\_config.xml + + 1. \[device\] \# 配置标签为ipcamera的串口信息,COM口和波特率,例如 + + ``` + + + COM1 + cmd + 115200 + 8 + 1 + 1 + + + ``` + + +- 修改developertest组件配置 + + 文件:resource/config/user\_config.xml + + 1. \[test\_cases\] \# 指定测试用例的输出路径,编译输出目录,例如 + + ``` + + S:\out\ipcamera_hi3518ev300_liteos_a\test + + ``` + + 2. \[NFS\] \# 指定NFS的映射路径,host\_dir为PC侧的NFS目录,board\_dir为板侧创建的目录,例如 + + ``` + + D:\nfs + user + + ``` + + +- 执行自测试用例前的环境检查 + - 系统镜像与文件系统已烧录进开发板,开发板上系统正常运行,在系统模式下,如shell登录时设备提示符OHOS\# + - 开发主机和开发板串口连接正常,网口连接正常 + - 开发主机IP与开发板IP处在同一小网网段,相互可以ping通 + - 开发主机侧创建空目录用于开发板通过NFS挂载测试用例,并且NFS服务启动正常 + +- 运行测试套 + - 启动测试框架 + 1. Windows环境启动测试框架 + + ``` + start.bat + ``` + + 2. Linux环境启动测试框架 + + ``` + ./strat.sh + ``` + + + - 设备形态选择 + + 根据实际的开发板选择,设备形态配置:developertest/src/core/resource/config/framework\_config.xml + + - 执行测试指令 + 1. 执行测试指令示例,其中-t ut为必选,-ss和-tm为可选字段 + + ``` + run -t ut -ss test -tm example + ``` + + 2. 参数说明:指定参数可以执行特定特性、模块对应的测试套 + + ``` + usage: __main__.py [-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 + + optional arguments: + -h, --help show this help message and exit + -p PRODUCTFORM, --productform PRODUCTFORM Specified product form + -t [TESTTYPE [TESTTYPE ...]], --testtype [TESTTYPE [TESTTYPE ...]] + Specify test type(UT,MST,ST,PERF,ALL) + -ss SUBSYSTEM, --subsystem SUBSYSTEM Specify test subsystem + -tm TESTMODULE, --testmodule TESTMODULE Specified test module + -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 + ``` + + + +- 测试框架帮助 + - 帮助指令,用于查询测试平台支持哪些测试指令 + + ``` + help + ``` + + + +## 测试结果与日志 + +- 通过在测试框架中执行测试指令,即可以生成测试日志和测试报告 +- 测试结果 + - 测试用例的结果会直接显示在控制台上,执行一次的测试结果根路径如下: + + ``` + reports/xxxx-xx-xx-xx-xx-xx + ``` + + - 测试用例格式化结果 + + ``` + result/ + ``` + + - 测试用例日志 + + ``` + log/plan_log_xxxx-xx-xx-xx-xx-xx.log + ``` + + - 测试报告概率 + + ``` + summary_report.html + ``` + + - 测试报告详情 + + ``` + details_report.html + ``` + + +- 测试框架日志 + + ``` + reports/platform_log_xxxx-xx-xx-xx-xx-xx.log + ``` + +- 最近一次测试报告 + + ``` + reports/latest + ``` + + +## 涉及仓 + +test\_developertest + +test\_xdevice + + + diff --git a/developer_test/bundle.json b/developer_test/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..06113e534ddd341981937c09dd04482eb98be5d9 --- /dev/null +++ b/developer_test/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/developer_test", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "开发过程采用测试驱动开发模式,开发者基于系统新增特性可以通过开发者自己开发用例保证,对于系统已有特性的修改,也可通过修改项目中原有自测试用例保证,开发者自测试旨在帮助开发者在开发阶段就能开发出高质量代码", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/test &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "test" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "test" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/dfx_common/LICENSE b/dfx_common/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/dfx_common/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/dfx_common/README.md b/dfx_common/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f345bdac76ca08bb15f45d4f818dd8de91a23fe9 --- /dev/null +++ b/dfx_common/README.md @@ -0,0 +1,12 @@ +# dfxcommon\_README + +# DFX子系统通用介绍 + +Log:日志支持流水实时输出和文件落盘。 + +Event:提供事件打点统一抽象接口,记录重要事件。 + +Dump:提供系统故障自动dump机制,暂不支持。 + + + diff --git a/dfx_common/bundle.json b/dfx_common/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..0ad90b904b9aadabfa74169885519b26b764798e --- /dev/null +++ b/dfx_common/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/dfx_common", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "Log:日志支持流水实时输出和文件落盘。-Event:提供事件打点统一抽象接口,记录重要事件。Dump:提供系统故障自动dump机制,暂不支持。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/hiviewdfx/utils/lite &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "dfxcommon" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-m", + "board": "hi3861" + } +} \ No newline at end of file diff --git a/distributed_scheduler/LICENSE b/distributed_scheduler/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/distributed_scheduler/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/distributed_scheduler/README.md b/distributed_scheduler/README.md new file mode 100644 index 0000000000000000000000000000000000000000..346468c43fbb9af2581f6b3c3cc270b452ff6146 --- /dev/null +++ b/distributed_scheduler/README.md @@ -0,0 +1,139 @@ +# 分布式任务调度子系统 + +## 简介 + +分布式任务调度模块,通过主(智慧屏设备)从设备(运动手表等小内存设备)服务代理机制,在异构操作系统上建立起分布式服务平台,支持OpenHarmony智慧屏与拉起其它OpenHarmony设备FA的能力。轻量分布式调度模块组成如下图所示: + +![](http://tools.harmonyos.com/mirrors/hpm-image/distributed_scheduler_README/figures/zh-cn_image_0000001055199362.png) + +## 目录 + +分布式任务调度源代码目录结构如下表所示: + +**表1 **主要源代码目录结构 + + + + + + + + + + + + + + + + +

名称

+

描述

+

dtbschedmgr_lite

+

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

+

safwk_lite

+

系统服务进程实现。

+

samgr_lite

+

本地服务管理实现。

+
+ +其中轻量级分布式任务调度的源代码目录结构如下: + +``` +├── BUILD.gn +├── include +│ ├── distributed_schedule_service.h # 分布式调度对外接口文件 +│ ├── dmslite_check_remote_permission.h # 分布式调度权限管理模块 +│ ├── dmslite_famgr.h # 分布式调度FA管理模块 +│ ├── dmslite_inner_common.h # 分布式调度服务文件 +│ ├── dmslite.h # 分布式调度实现 +│ ├── dmslite_log.h # 日志模块 +│ ├── dmslite_msg_parser.h # 通讯数据反序列化 +│ ├── dmslite_tlv_common.h # TLV格式数据解析模块 +│ └── dmslite_session.h # 跨设备通信辅助文件 +├── README.md +├── LICENSE +├── source + ├── distributed_schedule_service.c + ├── dmslite.c + ├── dmslite_check_remote_permission.c + ├── dmslite_famgr.c + ├── dmslite_msg_parser.c + ├── dmslite_tlv_common.c + └── dmslite_session.c +``` + +## 约束 + +语言限制:C语言。 组网环境:必须确保设备在同一个局域网中。操作系统限制:OpenHarmony操作系统。 + +**远程启动的约束与限制:** + +- 支持远程启动FA,不支持远程启动SA。 +- 远程启动前必须确保主设备(智慧屏设备)与从设备间(运动手表等小内存设备)分布式组网成功(需要在同一网段内,可互相ping通),否则无法远程启动。 + +## 使用 + +**轻量级分布式调度模块编译** + +轻量级分布式调度模块通过一些特性宏来定制不同平台上参与编译的功能代码,该部分代码位于build\\lite\\config\\subsystem\\distributedschedule\\目录下,目录结构如下: + +``` +build/lite/config/subsystem/distributedschedule +├── BUILD.gn +``` + +在编译不同的平台目标时,需要使用对BUILD.gn进行修改,以下以平台hi3518ev300和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", // 轻量级分布式调度模块配置 + ] + } +} +``` + +**\* 主设备程序开发**(以拉起FA为例) + +构造want,首先使用ElementName类表明需要启动的远端设备ID,包名,元能力类名,传入want中,然后设置want中的分布式标志位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.setElement(name); // 将待启动的FA信息添加到Want中 +want.setFlags(Want.FLAG_ABILITYSLICE_MULTI_DEVICE); // 设置分布式标记,若不设置将无法使用分布式能力 +startAbility(want); // 按照Want启动指定FA,Want参数命名以实际开发平台API为准 +``` + +**\* 预置条件** + +**主从设备间组网**:远程启动前必须确保主从设备分布式组网成功(需要在同一网段内,可互相ping通),否则无法远程启 + +**从设备FA安装:**安装测试或者自开发的FA到从设备 + +**\* 运行**(以拉起FA为例) + +执行主设备(智慧屏)侧的startAbility即可拉起从设备(运动手表等小内存设备)FA + +## 涉及仓 + +distributedschedule\_interfaces\_kits\_samgr\_lite + +distributedschedule\_services\_dtbschedmgr\_lite + +distributedschedule\_services\_safwk\_lite + + + diff --git a/distributed_scheduler/bundle.json b/distributed_scheduler/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..bd91ff93e5f011dcd10357cf7bc3328d1e0667d7 --- /dev/null +++ b/distributed_scheduler/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/distributed_scheduler", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "分布式任务调度模块,通过主(智慧屏设备)从设备(运动手表等小内存设备)服务代理机制,在异构操作系统上建立起分布式服务平台,支持OpenHarmony智慧屏与拉起其它OpenHarmony设备FA的能力。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/distributedschedule/services/dtbschedmgr_lite &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "distributedscheduler" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "foundation" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516" + } +} \ No newline at end of file diff --git a/fatfs/LICENSE b/fatfs/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/fatfs/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/fatfs/README.md b/fatfs/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8178c76d627cade75005b40711b92f4177bc6cfc --- /dev/null +++ b/fatfs/README.md @@ -0,0 +1 @@ +readme diff --git a/fatfs/bundle.json b/fatfs/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..8b9bdc2b321d3ce3fd8e5bc9ca4e5ce58b28e085 --- /dev/null +++ b/fatfs/bundle.json @@ -0,0 +1,24 @@ +{ + "name": "@ohos/fatfs", + "version": "1.8.0", + "publishAs": "code-segment", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/FatFs && mkdir -p $DEST_PATH&& cp -r ./* $DEST_PATH" + }, + "description": "FatFs is a generic FAT/exFAT filesystem module for small embedded systems. The FatFs module is written in compliance with ANSI C (C89) and completely separated from the disk I/O layer. Therefore it is independent of the platform. It can be incorporated into small microcontrollers with limited resource, such as 8051, PIC, AVR, ARM, Z80, RX and etc. Also Petit FatFs module for tiny microcontrollers is available here.", + "keywords": [ + "thirdparty", + "fatfs" + ], + "license": "Apache V2", + "repository": "", + "homepage": "http://elm-chan.org/fsw/ff/00index_e.html", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/foundation/LICENSE b/foundation/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/foundation/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/foundation/README.md b/foundation/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a92100d0a6e837768d4afc9d83b0152a0f1ca831 --- /dev/null +++ b/foundation/README.md @@ -0,0 +1,628 @@ +# 系统服务框架子系统 + +## 简介 + +由于平台资源有限,且硬件平台多样,因此需要屏蔽不同硬件架构和资源的不同、以及运行形态的不同,提供统一化的系统服务开发框架。根据RISC-V、Cortex-M、Cortex-A不同硬件平台,分为两种硬件平台,以下简称M核、A核。 + +M核:处理架构为Cortex-M或同等处理能力的硬件平台,系统内存一般低于512KB,无文件系统或者仅提供一个可有限使用的轻量级文件系统,遵循CMSIS接口规范。 + +A核:处理架构为Cortex-A或同等处理能力的硬件平台,内存资源大于512KB,文件系统完善,可存储大量数据,遵循POSIX接口规范。 + +系统服务框架基于面向服务的架构,提供了服务开发、服务的子功能开发、对外接口的开发、以及多服务共进程、进程间服务调用等开发能力。其中: + +- M核:包含服务开发、服务的子功能开发、对外接口的开发以及多服务共进程的开发框架。 +- A核:在M核能力基础之上,包含了进程间服务调用、进程间服务调用权限控制、进程间服务接口的开发等能力。 + +面向服务的架构: + +![](http://tools.harmonyos.com/mirrors/hpm-image/system_ability_manager_README/figures/zh-cn_image_0000001051351505.png) + +Provider:服务的提供者,为系统提供能力(对外接口)。 + +Consumer:服务的消费者,调用服务提供的功能(对外接口)。 + +Samgr:做为中介者,管理Provider提供的能力,同时帮助Consumer发现Provider的能力。 + +系统服务开发框架主体对象: + +![](http://tools.harmonyos.com/mirrors/hpm-image/foundation_README/figures/zh-cn_image_0000001051990283.png) + +- SamgrLite:主要提供服务的注册与发现能力。 +- Service:开发服务时,需要实现的服务的生命周期接口。 +- Feature:开发功能时,需要实现的功能的生命周期接口。 +- IUnknown:基于IUnknown开发服务或功能的对外接口。 +- IClientProxy:IPC调用时,消费者的消息发送代理。 +- IServerProxy:IPC调用时,开发者需要实现提供者的消息处理接口。 + +## 目录 + +**表 1** 系统服务框架源代码目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

interfaces/kits/samgr_lite/samgr

+

M核和A核系统服务框架对外接口定义。

+

interfaces/kits/samgr_lite/registry

+

A核进程间服务调用的对外接口定义。

+

interfaces/kits/samgr_lite/communication/broadcast

+

M核和A核进程内事件广播服务的对外接口定义。

+

services/samgr_lite/samgr/adapter

+

POSIX和CMSIS接口适配层来屏蔽A核M核接口差异。

+

services/samgr_lite/samgr/registry

+

M核服务注册发现的桩函数。

+

services/samgr_lite/samgr/source

+

M核和A核系统服务开发框架基础代码。

+

services/samgr_lite/samgr_client

+

A核进程间服务调用的注册与发现。

+

services/samgr_lite/samgr_server

+

A核进程间服务调用的IPC地址管理和访问控制。

+

services/samgr_lite/samgr_endpoint

+

A核IPC通信消息收发包管理。

+

services/samgr_lite/communication/broadcast

+

M核和A核进程内事件广播服务。

+
+ +## 约束 + +系统服务开发框架统一使用C开发。 + +同进程内服务间调用统一使用IUnknown接口对外象,消息接口统一由IUnknown接口传递给本服务。 + +服务名和功能名必需使用常量字符串且长度小于16个字节。 + +M核:系统依赖上bootstrap服务,在系统启动函数中调用OHOS\_SystemInit\(\)函数。 + +A核:系统依赖samgr库,在main函数中调用SAMGR\_Bootstrap\(\)函数。 + +## 开发服务 + +- 继承并重新定义服务: + + ``` + typedef struct ExampleService { + INHERIT_SERVICE; + INHERIT_IUNKNOWNENTRY(DefaultFeatureApi); + Identity identity; + } ExampleService; + ``` + +- 实现服务的生命周期函数: + + ``` + static const char *GetName(Service *service) + { + return EXAMPLE_SERVICE; + } + + static BOOL Initialize(Service *service, Identity identity) + { + ExampleService *example = (ExampleService *)service; + // 保存服务的唯一身份标识,用来自己的IUnknown接口对服务发消息时使用。 + example->identity = identity; + return TRUE; + } + static BOOL MessageHandle(Service *service, Request *msg) + { + ExampleService *example = (ExampleService *)service; + switch (msg->msgId) { + case MSG_SYNC: + // 业务处理 + break; + default:break; + } + return FALSE; + } + static TaskConfig GetTaskConfig(Service *service) + { + TaskConfig config = {LEVEL_HIGH, PRI_BELOW_NORMAL, + 0x800, 20, SHARED_TASK}; + return config; + } + ``` + +- 创建服务对象: + + ``` + static ExampleService g_example = { + .GetName = GetName, + .Initialize = Initialize, + .MessageHandle = MessageHandle, + .GetTaskConfig = GetTaskConfig, + SERVER_IPROXY_IMPL_BEGIN, + .Invoke = NULL, + .SyncCall = SyncCall, + IPROXY_END, + }; + ``` + +- 向SAMGR注册服务及接口: + + ``` + static void Init(void) + { + SAMGR_GetInstance()->RegisterService((Service *)&g_example); + SAMGR_GetInstance()->RegisterDefaultFeatureApi(EXAMPLE_SERVICE, GET_IUNKNOWN(g_example)); + } + ``` + +- 定义服务的初始化入口: + + ``` + SYSEX_SERVICE_INIT(Init); + + ``` + + +## 开发服务的子功能 + +- 继承并重新定义功能: + + ``` + typedef struct DemoFeature { + INHERIT_FEATURE; + INHERIT_IUNKNOWNENTRY(DemoApi); + Identity identity; + Service *parent; + } DemoFeature; + ``` + +- 实现功能的生命周期函数: + + ``` + static const char *FEATURE_GetName(Feature *feature) + { + return EXAMPLE_FEATURE; + } + + static void FEATURE_OnInitialize(Feature *feature, Service *parent, Identity identity) + { + DemoFeature *demoFeature = (DemoFeature *)feature; + demoFeature->identity = identity; + demoFeature->parent = parent; + } + + static void FEATURE_OnStop(Feature *feature, Identity identity) + { + g_example.identity.queueId = NULL; + g_example.identity.featureId = -1; + g_example.identity.serviceId = -1; + } + + static BOOL FEATURE_OnMessage(Feature *feature, Request *request) + { + if (request->msgId == MSG_PROC) { + Response response = {.data = "Yes, you did!", .len = 0}; + SAMGR_SendResponse(request, &response); + return TRUE; + } else { + if (request->msgId == MSG_TIME_PROC) { + LOS_Msleep(WAIT_FEATURE_PROC * 10); + if (request->msgValue) { + SAMGR_PrintServices(); + } else { + SAMGR_PrintOperations(); + } + AsyncTimeCall(GET_IUNKNOWN(g_example)); + return FALSE; + } + } + return FALSE; + } + ``` + +- 创建功能对象: + + ``` + static DemoFeature g_example = { + .GetName = FEATURE_GetName, + .OnInitialize = FEATURE_OnInitialize, + .OnStop = FEATURE_OnStop, + .OnMessage = FEATURE_OnMessage, + DEFAULT_IUNKNOWN_ENTRY_BEGIN, + .AsyncCall = AsyncCall, + .AsyncTimeCall = AsyncTimeCall, + .SyncCall = SyncCall, + .AsyncCallBack = AsyncCallBack, + DEFAULT_IUNKNOWN_ENTRY_END, + .identity = {-1, -1, NULL}, + }; + ``` + +- 向SAMGR注册功能及接口: + + ``` + static void Init(void){ + SAMGR_GetInstance()->RegisterFeature(EXAMPLE_SERVICE, (Feature *)&g_example); + SAMGR_GetInstance()->RegisterFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE, GET_IUNKNOWN(g_example)); + } + ``` + +- 定义功能的初始化入口: + + ``` + SYSEX_FEATURE_INIT(Init); + + ``` + + +## 开发进程内对外接口 + +- 定义IUnknown接口: + + ``` + typedef struct DemoApi { + INHERIT_IUNKNOWN; + BOOL (*AsyncCall)(IUnknown *iUnknown, const char *buff); + BOOL (*AsyncTimeCall)(IUnknown *iUnknown); + BOOL (*SyncCall)(IUnknown *iUnknown, struct Payload *payload); + BOOL (*AsyncCallBack)(IUnknown *iUnknown, const char *buff, Handler handler); + } DemoApi; + ``` + +- 定义IUnknown的引用对象: + + ``` + typedef struct DemoRefApi { + INHERIT_IUNKNOWNENTRY(DemoApi); + } DemoRefApi; + ``` + +- 初始化接口对象: + + ``` + static DemoRefApi api = { + DEFAULT_IUNKNOWN_ENTRY_BEGIN, + .AsyncCall = AsyncCall, + .AsyncTimeCall = AsyncTimeCall, + .SyncCall = SyncCall, + .AsyncCallBack = AsyncCallBack, + DEFAULT_IUNKNOWN_ENTRY_END, + }; + ``` + +- 注册服务接口: + + ``` + SAMGR_GetInstance()->RegisterFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE, GET_IUNKNOWN(api)); + + ``` + + +## 调用进程内服务 + +- 获取服务的对外接口: + + ``` + DemoApi *demoApi = NULL; + IUnknown *iUnknown = SAMGR_GetInstance()->GetFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE); + if (iUnknown == NULL) { + return NULL; + } + int result = iUnknown->QueryInterface(iUnknown, DEFAULT_VERSION, (void **)&demoApi); + if (result != 0 || demoApi == NULL) { + return NULL; + } + ``` + +- 接口调用: + + ``` + if (demoApi->AsyncCallBack == NULL) { + return NULL; + } + demoApi->AsyncCallBack((IUnknown *)demoApi, "I wanna async call callback good result!", AsyncHandler); + ``` + +- 释放接口: + + ``` + int32 ref = demoApi->Release((IUnknown *)demoApi); + + ``` + + +## 开发跨进程间对外接口 + +- 继承IServerProxy替代继承IUnknown:INHERIT\_SERVER\_IPROXY + + ``` + typedef struct DemoFeatureApi { + INHERIT_SERVER_IPROXY; + BOOL (*AsyncCall)(IUnknown *iUnknown, const char *buff); + BOOL (*AsyncTimeCall)(IUnknown *iUnknown); + BOOL (*SyncCall)(IUnknown *iUnknown, struct Payload *payload); + BOOL (*AsyncCallBack)(IUnknown *iUnknown, const char *buff, IOwner notify, INotifyFunc handler); + } DemoFeatureApi; + ``` + +- 初始化IServerProxy对象: + + ``` + static DemoFeature g_example = { + SERVER_IPROXY_IMPL_BEGIN, + .Invoke = Invoke, + .AsyncCall = AsyncCall, + .AsyncTimeCall = AsyncTimeCall, + .SyncCall = SyncCall, + .AsyncCallBack = AsyncCallBack, + IPROXY_END, + }; + ``` + +- 实现Invoke函数来处理Ipc消息: + + ``` + static int32 Invoke(IServerProxy *iProxy, int funcId, void *origin, IpcIo *req, IpcIo *reply) + { + DemoFeatureApi *api = (DemoFeatureApi *)iProxy; + BOOL ret; + size_t len = 0; + switch (funcId) { + case ID_ASYNCALL: + ret = api->AsyncCall((IUnknown *)iProxy, (char *)IpcIoPopString(req, &len)); + IpcIoPushBool(reply, ret); + break; + case ID_ASYNTIMECALL: + ret = api->AsyncTimeCall((IUnknown *)iProxy); + IpcIoPushBool(reply, ret); + break; + case ID_SYNCCALL: { + struct Payload payload; + payload.id = IpcIoPopInt32(req); + payload.value = IpcIoPopInt32(req); + payload.name = (char *)IpcIoPopString(req, &len); + ret = api->SyncCall((IUnknown *)iProxy, &payload); + IpcIoPushString(reply, ret ? "TRUE" : "FALSE"); + } + break; + case ID_ASYNCCALLBACK: { // convert to sync proxy + IpcIoPushString(reply, "Yes, you did!"); + IpcIoPushBool(reply, TRUE); + } + break; + default: + IpcIoPushBool(reply, FALSE); + break; + } + return EC_SUCCESS; + } + ``` + +- 注册接口:与进程内接口注册一致 + + ``` + SAMGR_GetInstance()->RegisterFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE, GET_IUNKNOWN(g_example)); + + ``` + + +## 调用跨进程间服务 + +- 获取跨进程服务的对外接口: + + ``` + IClientProxy *demoApi = NULL; + IUnknown *iUnknown = SAMGR_GetInstance()->GetFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE); + if (iUnknown == NULL) { + return NULL; + } + int result = iUnknown->QueryInterface(iUnknown, CLIENT_PROXY_VER, (void **)&demoApi); + if (result != 0 || demoApi == NULL) { + return NULL; + } + ``` + +- 调用Ipc消息接口: + + ``` + IpcIo request;char data[250]; + IpcIoInit(&request, data, sizeof(data), 0); + demoApi->Invoke(demoApi, 0, &request, NULL, NULL); + ``` + +- 释放接口: + + ``` + int32 ref = demoApi->Release((IUnknown *)demoApi); + + ``` + + +## 开发跨进程间服务调用客户端代理 + +- 定义IPC接口客户端代理: + + ``` + typedef struct DemoClientProxy { + INHERIT_CLIENT_IPROXY; + BOOL (*AsyncCall)(IUnknown *iUnknown, const char *buff); + BOOL (*AsyncTimeCall)(IUnknown *iUnknown); + BOOL (*SyncCall)(IUnknown *iUnknown, struct Payload *payload); + BOOL (*AsyncCallBack)(IUnknown *iUnknown, const char *buff, IOwner notify, INotifyFunc handler); + } DemoClientProxy; + typedef struct DemoClientEntry { + INHERIT_IUNKNOWNENTRY(DemoClientProxy); + } DemoClientEntry; + ``` + +- 实现客户端代理封装Ipc消息接口: + + ``` + static BOOL AsyncCall(IUnknown *iUnknown, const char *buff) + { + DemoClientProxy *proxy = (DemoClientProxy *)iUnknown; + IpcIo request; + char data[MAX_DATA_LEN]; + IpcIoInit(&request, data, MAX_DATA_LEN, 0); + IpcIoPushString(&request, buff); + int ret = proxy->Invoke((IClientProxy *)proxy, ID_ASYNCALL, &request, NULL, NULL); + return ret == EC_SUCCESS; + } + + static BOOL AsyncTimeCall(IUnknown *iUnknown) + { + DemoClientProxy *proxy = (DemoClientProxy *)iUnknown; + IpcIo request; + char data[MAX_DATA_LEN]; + IpcIoInit(&request, data, MAX_DATA_LEN, 0); + int ret = proxy->Invoke((IClientProxy *)proxy, ID_ASYNTIMECALL, &request, NULL, NULL); + return ret == EC_SUCCESS; + } + + static int Callback(IOwner owner, int code, IpcIo *reply) + { + size_t len = 0; + return strcpy_s(owner, MAX_DATA_LEN, (char *)IpcIoPopString(reply, &len)); + } + + static BOOL SyncCall(IUnknown *iUnknown, struct Payload *payload) + { + DemoClientProxy *proxy = (DemoClientProxy *)iUnknown; + IpcIo request; + char data[MAX_DATA_LEN]; + IpcIoInit(&request, data, MAX_DATA_LEN, 0); + IpcIoPushInt32(&request, payload->id); + IpcIoPushInt32(&request, payload->value); + IpcIoPushString(&request, payload->name); + int ret = proxy->Invoke((IClientProxy *)proxy, ID_SYNCCALL, &request, data, Callback); + data[MAX_DATA_LEN - 1] = 0; + HILOG_INFO(HILOG_MODULE_APP, "[TID:0x%lx]Remote response is %s!", pthread_self(), data); + return ret == EC_SUCCESS; + } + + struct CurrentNotify { + IOwner notify; + INotifyFunc handler; + }; + + static int CurrentCallback(IOwner owner, int code, IpcIo *reply) + { + struct CurrentNotify *notify = (struct CurrentNotify *)owner; + size_t len = 0; + char *response = (char *)IpcIoPopString(reply, &len); + HILOG_INFO(HILOG_MODULE_APP, "[TID:0x%lx]Notify Remote response is %s!", pthread_self(), response); + notify->handler(notify->notify, response); + return EC_SUCCESS; + } + + static BOOL AsyncCallBack(IUnknown *iUnknown, const char *buff, IOwner notify, INotifyFunc handler) + { + struct CurrentNotify owner = {notify, handler}; + DemoClientProxy *proxy = (DemoClientProxy *)iUnknown; + IpcIo request; + char data[MAX_DATA_LEN]; + IpcIoInit(&request, data, MAX_DATA_LEN, 0); + IpcIoPushString(&request, buff); + int ret = proxy->Invoke((IClientProxy *)proxy, ID_ASYNCCALLBACK, &request, &owner, CurrentCallback); + return ret == EC_SUCCESS; + } + ``` + +- 实现客户端代理的工厂方法: + + ``` + void *DEMO_CreatClient(const char *service, const char *feature, uint32 size) + { + (void)service; + (void)feature; + uint32 len = size + sizeof(DemoClientEntry); + uint8 *client = malloc(len); + (void)memset_s(client, len, 0, len); + DemoClientEntry *entry = (DemoClientEntry *)&client[size]; + entry->ver = ((uint16)CLIENT_PROXY_VER | (uint16)DEFAULT_VERSION); + entry->ref = 1; + entry->iUnknown.QueryInterface = IUNKNOWN_QueryInterface; + entry->iUnknown.AddRef = IUNKNOWN_AddRef; + entry->iUnknown.Release = IUNKNOWN_Release; + entry->iUnknown.Invoke = NULL; + entry->iUnknown.AsyncCall = AsyncCall; + entry->iUnknown.AsyncTimeCall = AsyncTimeCall; + entry->iUnknown.SyncCall = SyncCall; + entry->iUnknown.AsyncCallBack = AsyncCallBack; + return client; + } + void DEMO_DestroyClient(const char *service, const char *feature, void *iproxy) + { + free(iproxy); + } + ``` + +- 将客户端代理的工厂方法注册到SAMGR: + + ``` + SAMGR_RegisterFactory(EXAMPLE_SERVICE, EXAMPLE_FEATURE, DEMO_CreatClient, DEMO_DestroyClient); + ``` + +- 获取跨进程服务的对外接口: + + ``` + DemoClientProxy *demoApi = NULL; + IUnknown *iUnknown = SAMGR_GetInstance()->GetFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE); + if (iUnknown == NULL) { + return NULL; + } + int result = iUnknown->QueryInterface(iUnknown, DEFAULT_VERSION, (void **)&demoApi); + if (result != 0 || demoApi == NULL) { + return NULL; + } + ``` + +- 调用跨进程服务的客户端代理接口: + + ``` + if (demoApi->AsyncCallBack == NULL) { + return NULL; + } + demoApi->AsyncCallBack((IUnknown *)demoApi, + "I wanna async call callback good result!", NULL, AsyncHandler); + ``` + +- 释放接口: + + ``` + int32 ref = demoApi->Release((IUnknown *)demoApi); + ``` + + +## 涉及仓 + +distributedschedule\_interfaces\_kits\_samgr\_lite + +distributedschedule\_services\_samgr\_lite + diff --git a/foundation/bundle.json b/foundation/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..50023dea9197d558e2079507fa712932e779a28b --- /dev/null +++ b/foundation/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/foundation", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "由于平台资源有限,且硬件平台多样,因此需要屏蔽不同硬件架构和资源的不同、以及运行形态的不同,提供统一化的系统服务开发框架。根据RISC-V、Cortex-M、Cortex-A不同硬件平台,分为两种硬件平台,以下简称M核、A核。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/distributedschedule/services/safwk_lite&&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "foundation" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "foundation" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/freebsd/LICENSE b/freebsd/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/freebsd/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/freebsd/README.md b/freebsd/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b17a499ece8d4847f8e91a31bf54cb07a69ed7c6 --- /dev/null +++ b/freebsd/README.md @@ -0,0 +1,86 @@ +This is the top level of the FreeBSD source directory. This file +was last revised on: +$FreeBSD: releng/11.4/README 329145 2018-02-12 01:08:44Z kevans $ + +For copyright information, please see the file COPYRIGHT in this +directory (additional copyright information also exists for some +sources in this tree - please see the specific source directories for +more information). + +The Makefile in this directory supports a number of targets for +building components (or all) of the FreeBSD source tree. See build(7) +and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html +for more information, including setting make(1) variables. + +The `buildkernel` and `installkernel` targets build and install +the kernel and the modules (see below). Please see the top of +the Makefile in this directory for more information on the +standard build targets and compile-time flags. + +Building a kernel is a somewhat more involved process. See build(7), config(8), +and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html +for more information. + +Note: If you want to build and install the kernel with the +`buildkernel` and `installkernel` targets, you might need to build +world before. More information is available in the handbook. + +The kernel configuration files reside in the sys//conf +sub-directory. GENERIC is the default configuration used in release builds. +NOTES contains entries and documentation for all possible +devices, not just those commonly used. + + +Source Roadmap: +--------------- + +bin System/user commands. + +cddl Various commands and libraries under the Common Development + and Distribution License. + +contrib Packages contributed by 3rd parties. + +crypto Cryptography stuff (see crypto/README). + +etc Template files for /etc. + +gnu Various commands and libraries under the GNU Public License. + Please see gnu/COPYING* for more information. + +include System include files. + +kerberos5 Kerberos5 (Heimdal) package. + +lib System libraries. + +libexec System daemons. + +release Release building Makefile & associated tools. + +rescue Build system for statically linked /rescue utilities. + +sbin System commands. + +secure Cryptographic libraries and commands. + +share Shared resources. + +stand Boot loader sources. + +sys Kernel sources. + +tests Regression tests which can be run by Kyua. See tests/README + for additional information. + +tools Utilities for regression testing and miscellaneous tasks. + +usr.bin User commands. + +usr.sbin System administration commands. + + +For information on synchronizing your source tree with one or more of +the FreeBSD Project's development branches, please see: + + https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/updating-src.html diff --git a/freebsd/bundle.json b/freebsd/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..382a061afcd8a258d662b9940587d16e49bebd99 --- /dev/null +++ b/freebsd/bundle.json @@ -0,0 +1,24 @@ +{ + "name": "@ohos/freebsd", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "FreeBSD", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/FreeBSD &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "thirdparty", + "freebsd" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/freetype/LICENSE b/freetype/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/freetype/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/freetype/README.md b/freetype/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8f3e2bc03bfd22ab27ed70878a6b27112f6812da --- /dev/null +++ b/freetype/README.md @@ -0,0 +1,84 @@ + FreeType 2.10.1 + =============== + + Homepage: https://www.freetype.org + + FreeType is a freely available software library to render fonts. + + It is written in C, designed to be small, efficient, highly + customizable, and portable while capable of producing high-quality + output (glyph images) of most vector and bitmap font formats. + + Please read the docs/CHANGES file, it contains IMPORTANT + INFORMATION. + + Read the files `docs/INSTALL*' for installation instructions; see + the file `docs/LICENSE.TXT' for the available licenses. + + The FreeType 2 API reference is located in `docs/reference/site'; + use the file `index.html' as the top entry point. Additional + documentation is available as a separate package from our sites. Go + to + + https://download.savannah.gnu.org/releases/freetype/ + + and download one of the following files. + + freetype-doc-2.10.1.tar.xz + freetype-doc-2.10.1.tar.gz + ftdoc2101.zip + + To view the documentation online, go to + + https://www.freetype.org/freetype2/docs/ + + + Mailing Lists + ============= + + The preferred way of communication with the FreeType team is using + e-mail lists. + + general use and discussion: freetype@nongnu.org + engine internals, porting, etc.: freetype-devel@nongnu.org + announcements: freetype-announce@nongnu.org + git repository tracker: freetype-commit@nongnu.org + + The lists are moderated; see + + https://www.freetype.org/contact.html + + how to subscribe. + + + Bugs + ==== + + Please submit bug reports at + + https://savannah.nongnu.org/bugs/?group=freetype + + Alternatively, you might report bugs by e-mail to + `freetype-devel@nongnu.org'. Don't forget to send a detailed + explanation of the problem -- there is nothing worse than receiving + a terse message that only says `it doesn't work'. + + + Enjoy! + + + The FreeType Team + +---------------------------------------------------------------------- + +Copyright (C) 2006-2019 by +David Turner, Robert Wilhelm, and Werner Lemberg. + +This file is part of the FreeType project, and may only be used, +modified, and distributed under the terms of the FreeType project +license, LICENSE.TXT. By continuing to use, modify, or distribute +this file you indicate that you have read the license and understand +and accept it fully. + + +--- end of README --- diff --git a/freetype/bundle.json b/freetype/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..ad248ab47d75f7d67f6e00cca2b23386e0ce5cac --- /dev/null +++ b/freetype/bundle.json @@ -0,0 +1,24 @@ +{ + "name": "@ohos/freetype", + "version": "1.8.0", + "description": "FreeType is a freely available software library to render fonts.", + "publishAs": "code-segment", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/freetype && mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "font" + ], + "author": {}, + "homepage": "https://www.freetype.org", + "repository": "https://github.com/DaveGamble/cJSON", + "license": "Apache V2", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/global_resource_manager/LICENSE b/global_resource_manager/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/global_resource_manager/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/global_resource_manager/README.md b/global_resource_manager/README.md new file mode 100644 index 0000000000000000000000000000000000000000..af2986faa9ebd015b47609182ee3d47a7df30b58 --- /dev/null +++ b/global_resource_manager/README.md @@ -0,0 +1,18 @@ +# 项目介绍 + +## 全球化子系统 + +OpenHarmony设备上用户可以设置语言和地区,规划中预计会支持68种语言;考虑到OpenHarmony设备间互联时,会涉及从OpenHarmony设备同步语言和地区设置到另一台OpenHarmony设备。因此需要考虑多语言资源回溯和多偏好语言支持的能力。 + +全球化资源管理模块主要提供语言资源回溯和多偏好语言支持的能力: + +- 多语言资源回溯:系统在运行的时候会面临使用不同母语、来至不同地区各种文化背景的用户,如何用有限的翻译语言、最小的冗余来提供匹配该用户文化背景的翻译内容是资源加载中的一项核心功能,是系统支持多语言本地化的基本能力。 + +- 多偏好语言支持:系统可以根据用户设置的多个偏好语言来选择符合用户习惯的语言来显示,解决多母语用户尤其是像瑞士这样使用多母语用户的需求。 + +## 涉及仓 + +global\_frameworks\_resmgr\_lite + +global\_interfaces\_innerkits\_resmgr\_lite + diff --git a/global_resource_manager/bundle.json b/global_resource_manager/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..5dd16a5cfbab153a2aeb76eaa04e09404399ff6f --- /dev/null +++ b/global_resource_manager/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/global_resource_manager", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "OpenHarmony设备上用户可以设置语言和地区,规划中预计会支持68种语言;考虑到OpenHarmony设备间互联时,会涉及从OpenHarmony设备同步语言和地区设置到另一台OpenHarmony设备。因此需要考虑多语言资源回溯和多偏好语言支持的能力。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/global &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "app" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516" + } +} \ No newline at end of file diff --git a/googletest/LICENSE b/googletest/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/googletest/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/googletest/README.md b/googletest/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fe5694148640480c55d583f505a2608f93a8e894 --- /dev/null +++ b/googletest/README.md @@ -0,0 +1,130 @@ + +# Google Test # + +[![Build Status](https://travis-ci.org/google/googletest.svg?branch=master)](https://travis-ci.org/google/googletest) +[![Build status](https://ci.appveyor.com/api/projects/status/4o38plt0xbo1ubc8/branch/master?svg=true)](https://ci.appveyor.com/project/GoogleTestAppVeyor/googletest/branch/master) + +**Future Plans**: +* 1.8.x Release - the 1.8.x will be the last release that works with pre-C++11 compilers. The 1.8.x will not accept any requests for any new features and any bugfix requests will only be accepted if proven "critical" +* Post 1.8.x - work to improve/cleanup/pay technical debt. When this work is completed there will be a 1.9.x tagged release +* Post 1.9.x googletest will follow [Abseil Live at Head philosophy](https://abseil.io/about/philosophy) + + +Welcome to **Google Test**, Google's C++ test framework! + +This repository is a merger of the formerly separate GoogleTest and +GoogleMock projects. These were so closely related that it makes sense to +maintain and release them together. + +Please see the project page above for more information as well as the +mailing list for questions, discussions, and development. There is +also an IRC channel on [OFTC](https://webchat.oftc.net/) (irc.oftc.net) #gtest available. Please +join us! + +Getting started information for **Google Test** is available in the +[Google Test Primer](googletest/docs/primer.md) documentation. + +**Google Mock** is an extension to Google Test for writing and using C++ mock +classes. See the separate [Google Mock documentation](googlemock/README.md). + +More detailed documentation for googletest (including build instructions) are +in its interior [googletest/README.md](googletest/README.md) file. + +## Features ## + + * An [xUnit](https://en.wikipedia.org/wiki/XUnit) test framework. + * Test discovery. + * A rich set of assertions. + * User-defined assertions. + * Death tests. + * Fatal and non-fatal failures. + * Value-parameterized tests. + * Type-parameterized tests. + * Various options for running the tests. + * XML test report generation. + +## Platforms ## + +Google test has been used on a variety of platforms: + + * Linux + * Mac OS X + * Windows + * Cygwin + * MinGW + * Windows Mobile + * Symbian + +## Who Is Using Google Test? ## + +In addition to many internal projects at Google, Google Test is also used by +the following notable projects: + + * The [Chromium projects](http://www.chromium.org/) (behind the Chrome + browser and Chrome OS). + * The [LLVM](http://llvm.org/) compiler. + * [Protocol Buffers](https://github.com/google/protobuf), Google's data + interchange format. + * The [OpenCV](http://opencv.org/) computer vision library. + * [tiny-dnn](https://github.com/tiny-dnn/tiny-dnn): header only, dependency-free deep learning framework in C++11. + +## Related Open Source Projects ## + +[GTest Runner](https://github.com/nholthaus/gtest-runner) is a Qt5 based automated test-runner and Graphical User Interface with powerful features for Windows and Linux platforms. + +[Google Test UI](https://github.com/ospector/gtest-gbar) is test runner that runs +your test binary, allows you to track its progress via a progress bar, and +displays a list of test failures. Clicking on one shows failure text. Google +Test UI is written in C#. + +[GTest TAP Listener](https://github.com/kinow/gtest-tap-listener) is an event +listener for Google Test that implements the +[TAP protocol](https://en.wikipedia.org/wiki/Test_Anything_Protocol) for test +result output. If your test runner understands TAP, you may find it useful. + +[gtest-parallel](https://github.com/google/gtest-parallel) is a test runner that +runs tests from your binary in parallel to provide significant speed-up. + +[GoogleTest Adapter](https://marketplace.visualstudio.com/items?itemName=DavidSchuldenfrei.gtest-adapter) is a VS Code extension allowing to view Google Tests in a tree view, and run/debug your tests. + +## Requirements ## + +Google Test is designed to have fairly minimal requirements to build +and use with your projects, but there are some. Currently, we support +Linux, Windows, Mac OS X, and Cygwin. We will also make our best +effort to support other platforms (e.g. Solaris, AIX, and z/OS). +However, since core members of the Google Test project have no access +to these platforms, Google Test may have outstanding issues there. If +you notice any problems on your platform, please notify +[googletestframework@googlegroups.com](https://groups.google.com/forum/#!forum/googletestframework). Patches for fixing them are +even more welcome! + +### Linux Requirements ### + +These are the base requirements to build and use Google Test from a source +package (as described below): + + * GNU-compatible Make or gmake + * POSIX-standard shell + * POSIX(-2) Regular Expressions (regex.h) + * A C++98-standard-compliant compiler + +### Windows Requirements ### + + * Microsoft Visual C++ 2015 or newer + +### Cygwin Requirements ### + + * Cygwin v1.5.25-14 or newer + +### Mac OS X Requirements ### + + * Mac OS X v10.4 Tiger or newer + * Xcode Developer Tools + +## Contributing change + +Please read the [`CONTRIBUTING.md`](CONTRIBUTING.md) for details on +how to contribute to this project. + +Happy testing! diff --git a/googletest/bundle.json b/googletest/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..5a3e33e04cf706963ff97120d5821225e24cf1f7 --- /dev/null +++ b/googletest/bundle.json @@ -0,0 +1,25 @@ +{ + "name": "@ohos/googletest", + "version": "1.8.0", + "description": "The 1.8.x is the last release supporting pre-C++11 compilers. The 1.8.x will not accept any requests for any new features and any bugfix requests will only be accepted if proven critical", + "publishAs": "code-segment", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/googletest && mkdir -p $DEST_PATH &&cp -r ./* $DEST_PATH" + }, + "keywords": [ + "googletest" + ], + "envs": {}, + "author": {}, + "homepage": "", + "repository": "", + "license": "Apache V2", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/graphic/LICENSE b/graphic/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/graphic/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/graphic/README.md b/graphic/README.md new file mode 100644 index 0000000000000000000000000000000000000000..29380c3dccdc457835483ed21c9db182f55a1b39 --- /dev/null +++ b/graphic/README.md @@ -0,0 +1,107 @@ +# 图形子系统 + +## 简介 + +图形子系统主要包括UI组件、布局、动画、字体、输入事件、窗口管理、渲染绘制等模块,构建基于轻量OS的应用框架,满足硬件资源较小的物联网设备的OpenHarmony系统应用开发。 + +各模块介绍: + +- Components: 应用组件,包括UIView、UIViewGoup、UIButton、UILabel、UILabelButton、UIList、UISlider等。 +- Layout:布局控件,包括Flexlayout、GridLayout、ListLayout等。 +- Animator:动画模块,开发者可以自定义动画。 +- Font:字体处理模块。 +- Event:事件模块,包括click、press、drag、long press等基础事件。 +- Task:任务管理模块。 +- Input:输入事件处理模块。 +- Display:显示处理模块。 +- Render:渲染绘制模块。 +- Draw2d:2d绘制模块,包括直线、矩形、圆、弧、图片、文字等绘制。包括软件绘制和硬件加速能力对接。 +- Surface:共享内存。 +- Window:窗口管理模块,包括窗口创建、显示隐藏、合成等处理。 +- Adapter:适配层,对接底层适配层接口。 + +## 目录 + +**表 1** 图形子系统源代码目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

config

+

配置文件目录。

+

frameworks/surface

+

Surface共享内存。

+

frameworks/ui

+

UI模块,包括UI控件、动画、字体等功能。

+

hals

+

HAL适配层逻辑。

+

interfaces/ui

+

UI模块对外接口头文件。

+

interfaces/utils

+

图形子系统公共库头文件。

+

services/ims

+

输入管理服务,处理点击、按键等输入事件处理、分发。

+

services/wms

+

窗口管理服务,处理窗口的创建、管理和合成。

+

utils

+

图形子系统公共库。

+
+ +## 约束 + +- 语言版本 + - C++11版本或以上 + +- 框架针对不同的芯片平台和底层OS能力,规格有所区别 + - Cortex-M RAM/ROM: + - RAM:建议大于100K + - ROM: \> 300K + + - Cortex-A RAM/ROM: + - RAM:建议大于1M + - ROM:\> 1M + + + +## 新增一个UI控件 + +所有的控件都继承UIView,有通用的属性和样式。UI控件分为两大类:普通控件和容器控件。普通控件不能添加子节点,容器控件作为父容器可以添加子节点。 + +新增控件头文件放到interfaces/ui/components,cpp文件放到frameworks/ui/src/components目录。组件Override OnDraw绘制接口,在这个接口里实现本控件的绘制流程。在frameworks/ui/BUILD.gn添加对应的新增文件,构建时会编译到libui.so。 + +## 涉及仓 + +graphic\_lite + diff --git a/graphic/bundle.json b/graphic/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..f3642dd19fbb3d813fcd29ff77bfc6089a4d9896 --- /dev/null +++ b/graphic/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/graphic", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "图形子系统主要包括UI组件、布局、动画、字体、输入事件、窗口管理、渲染绘制等模块,构建基于轻量OS的应用框架,满足硬件资源较小的物联网设备的OpenHarmony系统应用开发。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/graphic &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "graphic" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "foundation" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/harfbuzz/LICENSE b/harfbuzz/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/harfbuzz/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/harfbuzz/README.md b/harfbuzz/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c3cc0c26e948e4771de115a55285fbead11778fd --- /dev/null +++ b/harfbuzz/README.md @@ -0,0 +1,25 @@ +[![Travis Build Status](https://travis-ci.org/harfbuzz/harfbuzz.svg?branch=master)](https://travis-ci.org/harfbuzz/harfbuzz) +[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/0t0flrxpstj9lb9w?svg=true&branch=master)](https://ci.appveyor.com/project/harfbuzz/harfbuzz) +[![CircleCI Build Status](https://circleci.com/gh/harfbuzz/harfbuzz/tree/master.svg?style=svg)](https://circleci.com/gh/harfbuzz/harfbuzz/tree/master) +[![OSS-Fuzz Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/harfbuzz.svg)](https://oss-fuzz-build-logs.storage.googleapis.com/index.html) +[![Coverity Code Health](https://img.shields.io/coverity/scan/5450.svg)](https://scan.coverity.com/projects/behdad-harfbuzz) +[![Codacy Code Health](https://api.codacy.com/project/badge/Grade/f17f1708783c447488bc8dd317150eaa)](https://app.codacy.com/app/behdad/harfbuzz) +[![Codecov Code Coverage](https://codecov.io/gh/harfbuzz/harfbuzz/branch/master/graph/badge.svg)](https://codecov.io/gh/harfbuzz/harfbuzz) +[![Coverals Code Coverage](https://img.shields.io/coveralls/harfbuzz/harfbuzz.svg)](https://coveralls.io/r/harfbuzz/harfbuzz) +[ABI Tracker](http://abi-laboratory.pro/tracker/timeline/harfbuzz/) + +This is HarfBuzz, a text shaping library. + +For bug reports, mailing list, and other information please visit: + + http://harfbuzz.org/ + +For license information, see [COPYING](COPYING). + +For build information, see [BUILD.md](BUILD.md). + +For custom configurations, see [CONFIG.md](CONFIG.md). + +For test execution, see [TESTING.md](TESTING.md). + +Documentation: https://harfbuzz.github.io diff --git a/harfbuzz/bundle.json b/harfbuzz/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..779e2a372eb999e1e5c1d2d27e213188db58fb36 --- /dev/null +++ b/harfbuzz/bundle.json @@ -0,0 +1,25 @@ +{ + "name": "@ohos/harfbuzz", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "HarfBuzz is a text shaping engine. It primarily supports OpenType, but also Apple Advanced Typography. HarfBuzz is used in Android, Chrome, ChromeOS, Firefox, GNOME, GTK+, KDE, LibreOffice, OpenJDK, PlayStation, Qt, XeTeX, and other places.", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/harfbuzz &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "harbfuzz" + ], + "envs": {}, + "author": {}, + "homepage": "", + "repository": "", + "license": "Apache V2", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/hdf/LICENSE b/hdf/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/hdf/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/hdf/README.md b/hdf/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d4a5af4e860cebaed9ba7f4eeece89597901f922 --- /dev/null +++ b/hdf/README.md @@ -0,0 +1,254 @@ +# 驱动子系统 + +## 简介 + +OpenHarmony驱动子系统采用采用C面向对象编程模型构建,通过平台解耦、内核解耦,兼容不同内核,提供了归一化的驱动平台底座,旨在为开发者提供更精准、更高效的开发环境,力求做到一次开发,多系统部署。 + +为了缩减驱动开发者的驱动开发周期,降低三方设备驱动集成难度,OpenHarmony驱动子系统支持以下关键特性和能力。 + +- 弹性化的框架能力: + + 在传统的驱动框架能力的基础上,OpenHarmony驱动子系统通过构建弹性化的框架能力,可支持在百K级别到百兆级容量的终端产品形态部署。 + + +- 规范化的驱动接口: + + 定义了常见驱动接口,为驱动开发者和使用者提供丰富、稳定接口,并和未来开放的面向手机、平板、智慧屏等设备驱动接口保持API兼容性。 + + +- 组件化的驱动模型: + + 支持组件化的驱动模型,开发者提供更精细化的驱动管理,开发者可以对驱动进行组件化拆分,使得驱动开发者可以更多关注驱动与硬件交互部分。 + + 同时系统也预置了部分模板化的驱动模型组件,如网络设备模型等。 + + +- 归一化的配置界面: + + 提供统一的配置界面,构建跨平台的配置转换和生成工具,实现跨平台的无缝切换 + + +为了方便驱动开发者更易于开发OpenHarmony驱动程序,OpenHarmony驱动子系统在DevEco集成驱动开发套件工具,支持驱动工程管理,驱动模板生成、配置管理等界面化的操作。 + +## 架构 + +OpenHarmony驱动框架采用主从架构设计模式,围绕着框架、模型、能力库和工具四个维度能力展开构建。 + +**图 1** 驱动和框架交互流程 + + +![](http://tools.harmonyos.com/mirrors/hpm-image/hdf_README/figures/zh-cn_image_0000001053805078.png) + +- 驱动框架 -位于frameworks/core目录 + - 提供驱动框架能力,主要完成驱动加载和启动功能。 + - 通过对象管理器方式可实现驱动框架的弹性化部署和扩展。 + +- 驱动模型 - 位于frameworks/model目录 + - 提供了模型化驱动能力,如网络设备模型。 + +- 驱动能力库 - 位于frameworks/ability目录 + - 提供基础驱动能力模型,如IO通信能力模型。 + +- 驱动工具 - 位于frameworks\\tools目录 + - 提供HDI接口转换、驱动配置编译等工具。 + +- 驱动接口 - 位于lite\\hdi + - 提供规范化的驱动接口。 + +- Support - 位于frameworks/support目录, + - 提供规范化的平台驱动接口和系统接口抽象能力。 + + +## 目录 + +**表 1** OpenHarmony驱动框架源代码目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

hdf

+

OpenHarmony驱动框架。

+

hdf\frameworks

+

完成驱动框架、驱动模型和能力模型库相关代码。

+

hdf\frameworks\ability

+

提供驱动开发的功能能力支持,如消息模型库等。

+

hdf\frameworks\core

+

实现OpenHarmony驱动框架的核心代码部分。

+

hdf\frameworks\core\host

+

提供驱动宿主环境框架功能,主要包含:

+

1、驱动加载、启动以及对外发布设备节点功能。

+

2、提供驱动事件分发。

+

3、驱动内部电源状态管理功能。

+

4、提供公共的驱动资源配置管理。

+

hdf\frameworks\core\manager

+

驱动框架管理模块主要包含:

+

1、驱动对外服务接口管理。

+

2、驱动设备信息配置管理。

+

3、驱动设备节点管理。

+

4、安全管理模块。

+

5、驱动故障恢复管理功能模块。

+

hdf\frameworks\core\shared

+

提供host和manager共享模块代码。

+

hdf\frameworks\model

+

提供驱动通用框架模型。

+

hdf\frameworks\model\network

+

提供驱动网络设备模型。

+

hdf\frameworks\support\

+

提供驱动使用的系统接口资源和硬件资源,如GPIO、I2C、SPI等通用平台接口能力。

+

该接口部分与平台无关可支持跨平台迁移。

+

hdf\frameworks\support\osal

+

提供通用平台适配接口,如内存、线程、锁等资源。

+

hdf\frameworks\support\platform

+

提供通用平台硬件资源支撑接口,如GPIO、I2C、SPI等能力。

+

hdf\frameworks\tools

+

提供驱动功能能力库,如HCS驱动配置编译工具等。

+

hdf\frameworks\utils

+

提供基础数据结构和算法等。

+

hdf\lite\adapter

+

实现对内核操作接口适配,提供抽象化的接口供开发者使用。

+

hdf\lite\include

+

提供OpenHarmony驱动框架面向轻量化设备开放的驱动接口接口。

+

hdf\lite\hdi

+

提供OpenHarmony驱动程序接口。

+
+ +## 约束 + +无。 + +## 使用 + +**图 2** 驱动和框架交互流程 + + +![](http://tools.harmonyos.com/mirrors/hpm-image/hdf_README/figures/zh-cn_image_0000001052764349.png) + +驱动框架完成大部分驱动加载的动作,用户只需注册自己所需的接口和配置,然后驱动框架就会根据解析,完成驱动加载和初始化动作。 + +开发者基于HDF驱动框架开发的驱动主要包含三大部分: + +1、驱动程序部分 - 完成驱动的功能逻辑 + +2、驱动配置信息 - 指示驱动的加载信息内容 + +3、驱动资源配置 - 配置驱动的硬件配置信息。 + +驱动程序主要是完成驱动功能的开发部分: + +对于开发者首先看到的是驱动入口部分,驱动入口部分通过DriverEntry对齐进行描述。 + +其中主要包含bind, init 和release三个接口。 + +``` +struct HdfDriverEntry g_deviceSample = { + .moduleVersion = 1, + .moduleName = "sample_driver", + .Bind = SampleDriverBind, + .Init = SampleDriverInit, + .Release = SampleDriverRelease, +}; +``` + +Bind接口描述:该接口的作用主要是完成驱动设备和设备服务接口的bind动作。 + +``` +int32_t SampleDriverBind(struct HdfDeviceObject *deviceObject) +{ + //TODO: Bind and device service to device object. + //And you can also initialize device resources here. + return HDF_SUCCESS; +} +``` + +Init接口描述:当框架完成设备绑定动作后,就开始调用驱动初始化接口,当初始化成功后,驱动框架根据配置文件决定是否对外创建设备服务 + +接口,还是只是对当前服务接口可见。如果Init初始化失败的话,驱动框架就会主动释放创建的设备接口等信息。 + +``` +int32_t SampleDriverInit(struct HdfDeviceObject *deviceObject) +{ + return HDF_SUCCESS; +} +``` + +Release接口描述:当用户需要卸载驱动时,驱动框架先通过该接口通知驱动程序释放资源。然后在执行其他内部资源释放。 + +``` +void SampleDriverRelease(struct HdfDeviceObject *deviceObject) +{ + //Release all driver resources. + return; +} +``` + +## 安装 + +OpenHarmony驱动主要部署在内核态,当前主要采用静态链接方式,随内核子系统编译和系统镜像打包。 + +**图 3** 驱动安装部署图 + + +![](http://tools.harmonyos.com/mirrors/hpm-image/hdf_README/figures/zh-cn_image_0000001053044331.png) + +## 涉及仓 + +drivers\_hdf\_frameworks + +drivers\_hdf\_lite + diff --git a/hdf/bundle.json b/hdf/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..cdb26885d308f4d88905662425ecd086d41cf54c --- /dev/null +++ b/hdf/bundle.json @@ -0,0 +1,24 @@ +{ + "name": "@ohos/hdf", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "OpenHarmony驱动子系统采用采用C面向对象编程模型构建,通过平台解耦、内核解耦,兼容不同内核,提供了归一化的驱动平台底座,旨在为开发者提供更精准、更高效的开发环境,力求做到一次开发,多系统部署。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/ &&mkdir -p $DEST_PATH && cp -r drivers vendor $DEST_PATH" + }, + "keywords": [ + "hdf" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "drivers", + "vendor" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/hi3516dv300/LICENSE b/hi3516dv300/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/hi3516dv300/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/hi3516dv300/README.md b/hi3516dv300/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b3086f9e83b4f45a78c1c5864e29c9f41a5e9da7 --- /dev/null +++ b/hi3516dv300/README.md @@ -0,0 +1,298 @@ +# Hi3516dv300介绍 + +## 简介 + +海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应"媒体子系统"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。 + +**图 1** 多媒体子系统框架图 +![](http://tools.harmonyos.com/mirrors/hpm-image/hi3516dv300_README/figures/多媒体子系统框架图.png "多媒体子系统框架图") + +## 目录 + +海思(上海)媒体软件开发包目录结构如表1所示: + +**表 1** hardware目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\hardware

+

媒体南向接口实现、框架及芯片对接层库目录

+
+ +**表 2** hi35xx\_init目录结构 + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi35xx_init\hi3516dv300

+

编译打包16dv300内核镜像的编译脚本

+

hi35xx\hi35xx_init\hi3518ev300

+

编译打包18ev300内核镜像的编译脚本

+
+ +**表 3** hi3516dv300目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi3516dv300

+

Hi3516DV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件

+

hi35xx\hi3516dv300\module_init\lib

+

Hi3516DV300芯片媒体各模块驱动对应的库、LICENSE文件

+

hi35xx\hi3516dv300\module_init\src

+

内核驱动初始化源代码、LICENSE文件

+

hi35xx\hi3516dv300\soc\lib

+

Hi3516DV300芯片的媒体库文件、LICENSE文件

+

hi35xx\hi3516dv300\uboot\out\boot

+

采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3516dv300\uboot\reg\reg_info_hi3516dv300.bin编译成的uboot、README文件

+

hi35xx\hi3516dv300\uboot\reg

+

uboot配置文件、LICENSE文件

+

hi35xx\hi3516dv300\uboot\secureboot_ohos

+

鸿蒙OS安全启动相关的编译脚本

+

hi35xx\hi3516dv300\uboot\secureboot_release

+

生成安全uboot的源代码、License目录

+
+ +**表 4** hi3518ev300目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi3518ev300

+

Hi3518EV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件

+

hi35xx\hi3518ev300\module_init\lib

+

Hi3518EV300芯片媒体各模块驱动对应的库、LICENSE文件

+

hi35xx\hi3518ev300\module_init\src

+

内核驱动初始化源代码、LICENSE文件

+

hi35xx\hi3518ev300\soc\lib

+

Hi3518EV300芯片的媒体库文件、LICENSE文件

+

hi35xx\hi3518ev300\uboot\out\boot

+

采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3518ev300\uboot\reg\reg_info_hi3518ev300.bin编译成的uboot、README文件

+

hi35xx\hi3518ev300\uboot\reg

+

uboot配置文件、LICENSE文件

+

hi35xx\hi3518ev300\uboot\secureboot_ohos

+

鸿蒙OS安全启动相关的编译脚本

+

hi35xx\hi3518ev300\uboot\secureboot_release

+

生成安全uboot的源代码、License目录

+
+ +**表 5** middleware目录结构 + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\middleware\source\common

+

南向组件公共模块库目录

+

hi35xx\middleware\source\component

+

南向组件非公共模块库目录

+

hi35xx\middleware\source\thirdparty

+

南向插件依赖第三方开源软件目录

+
+ +**表 6** platform目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\platform

+

hi35xx平台驱动

+
+ +**表 7** third\_party目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\third_party\uboot\u-boot-2020.01

+

uboot开源代码

+
+ +## 约束 + +当前支持Hi3518EV300、Hi3516DV300芯片。 + +## 许可协议 + +## hi3516dv300许可说明 + +- hi35xx\\hi3516dv300\\module\_init\\lib和hi35xx\\hi3516dv300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3516dv300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * / + ``` + +- hi35xx\\hi3516dv300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3516dv300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3516dv300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 +- hi35xx\\hi3516dv300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * ... * / + ``` + + +- hi35xx\\hi3516dv300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。 + +## hi3518ev300许可说明 + +- hi35xx\\hi3518ev300\\module\_init\\lib和hi35xx\\hi3518ev300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3518ev300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * / + ``` + +- hi35xx\\hi3518ev300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3518ev300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3518ev300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 +- hi35xx\\hi3518ev300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * ... * / + ``` + +- hi35xx\\hi3518ev300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。 + +## third\_party许可说明 + +hi35xx\\third\_party\\uboot\\u-boot-2020.01为uboot开源代码,遵循软件版本自带的开源许可声明,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 + diff --git a/hi3516dv300/bundle.json b/hi3516dv300/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..98d53a856ad9f1196c94f3e72548585772ede714 --- /dev/null +++ b/hi3516dv300/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/hi3516dv300", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应\"媒体子系统\"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/vendor/hisi/hi35xx &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "vender" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "vendor" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516" + } +} \ No newline at end of file diff --git a/hi3516dv300_adapter/LICENSE b/hi3516dv300_adapter/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/hi3516dv300_adapter/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/hi3516dv300_adapter/README.md b/hi3516dv300_adapter/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6e662ffaa67b5c96b7051e988ef5d6579695edbb --- /dev/null +++ b/hi3516dv300_adapter/README.md @@ -0,0 +1,298 @@ +# Hi3516dv300介绍 + +## 简介 + +海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应"媒体子系统"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。 + +**图 1** 多媒体子系统框架图 +![](http://tools.harmonyos.com/mirrors/hpm-image/hi3516dv300_adapter_README/figures/多媒体子系统框架图.png "多媒体子系统框架图") + +## 目录 + +海思(上海)媒体软件开发包目录结构如表1所示: + +**表 1** hardware目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\hardware

+

媒体南向接口实现、框架及芯片对接层库目录

+
+ +**表 2** hi35xx\_init目录结构 + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi35xx_init\hi3516dv300

+

编译打包16dv300内核镜像的编译脚本

+

hi35xx\hi35xx_init\hi3518ev300

+

编译打包18ev300内核镜像的编译脚本

+
+ +**表 3** hi3516dv300目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi3516dv300

+

Hi3516DV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件

+

hi35xx\hi3516dv300\module_init\lib

+

Hi3516DV300芯片媒体各模块驱动对应的库、LICENSE文件

+

hi35xx\hi3516dv300\module_init\src

+

内核驱动初始化源代码、LICENSE文件

+

hi35xx\hi3516dv300\soc\lib

+

Hi3516DV300芯片的媒体库文件、LICENSE文件

+

hi35xx\hi3516dv300\uboot\out\boot

+

采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3516dv300\uboot\reg\reg_info_hi3516dv300.bin编译成的uboot、README文件

+

hi35xx\hi3516dv300\uboot\reg

+

uboot配置文件、LICENSE文件

+

hi35xx\hi3516dv300\uboot\secureboot_ohos

+

鸿蒙OS安全启动相关的编译脚本

+

hi35xx\hi3516dv300\uboot\secureboot_release

+

生成安全uboot的源代码、License目录

+
+ +**表 4** hi3518ev300目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi3518ev300

+

Hi3518EV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件

+

hi35xx\hi3518ev300\module_init\lib

+

Hi3518EV300芯片媒体各模块驱动对应的库、LICENSE文件

+

hi35xx\hi3518ev300\module_init\src

+

内核驱动初始化源代码、LICENSE文件

+

hi35xx\hi3518ev300\soc\lib

+

Hi3518EV300芯片的媒体库文件、LICENSE文件

+

hi35xx\hi3518ev300\uboot\out\boot

+

采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3518ev300\uboot\reg\reg_info_hi3518ev300.bin编译成的uboot、README文件

+

hi35xx\hi3518ev300\uboot\reg

+

uboot配置文件、LICENSE文件

+

hi35xx\hi3518ev300\uboot\secureboot_ohos

+

鸿蒙OS安全启动相关的编译脚本

+

hi35xx\hi3518ev300\uboot\secureboot_release

+

生成安全uboot的源代码、License目录

+
+ +**表 5** middleware目录结构 + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\middleware\source\common

+

南向组件公共模块库目录

+

hi35xx\middleware\source\component

+

南向组件非公共模块库目录

+

hi35xx\middleware\source\thirdparty

+

南向插件依赖第三方开源软件目录

+
+ +**表 6** platform目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\platform

+

hi35xx平台驱动

+
+ +**表 7** third\_party目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\third_party\uboot\u-boot-2020.01

+

uboot开源代码

+
+ +## 约束 + +当前支持Hi3518EV300、Hi3516DV300芯片。 + +## 许可协议 + +## hi3516dv300许可说明 + +- hi35xx\\hi3516dv300\\module\_init\\lib和hi35xx\\hi3516dv300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3516dv300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * / + ``` + +- hi35xx\\hi3516dv300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3516dv300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3516dv300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 +- hi35xx\\hi3516dv300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * ... * / + ``` + + +- hi35xx\\hi3516dv300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。 + +## hi3518ev300许可说明 + +- hi35xx\\hi3518ev300\\module\_init\\lib和hi35xx\\hi3518ev300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3518ev300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * / + ``` + +- hi35xx\\hi3518ev300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3518ev300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3518ev300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 +- hi35xx\\hi3518ev300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * ... * / + ``` + +- hi35xx\\hi3518ev300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。 + +## third\_party许可说明 + +hi35xx\\third\_party\\uboot\\u-boot-2020.01为uboot开源代码,遵循软件版本自带的开源许可声明,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 + diff --git a/hi3516dv300_adapter/bundle.json b/hi3516dv300_adapter/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..c314bd91dae8857d4ce17b7e58a20db8e23ad5fc --- /dev/null +++ b/hi3516dv300_adapter/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/hi3516dv300_adapter", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应\"媒体子系统\"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/vendor/hisi/hi35xx/ &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "vender" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "vendor" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516" + } +} \ No newline at end of file diff --git a/hi3516dv300_uboot/LICENSE b/hi3516dv300_uboot/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/hi3516dv300_uboot/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/hi3516dv300_uboot/README.md b/hi3516dv300_uboot/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a88f73eb7154017ef791b9f993032e1fd68c1b90 --- /dev/null +++ b/hi3516dv300_uboot/README.md @@ -0,0 +1,298 @@ +# Hi3516dv300介绍 + +## 简介 + +海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应"媒体子系统"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。 + +**图 1** 多媒体子系统框架图 +![](http://tools.harmonyos.com/mirrors/hpm-image/hi3516dv300_uboot_README/figures/多媒体子系统框架图.png "多媒体子系统框架图") + +## 目录 + +海思(上海)媒体软件开发包目录结构如表1所示: + +**表 1** hardware目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\hardware

+

媒体南向接口实现、框架及芯片对接层库目录

+
+ +**表 2** hi35xx\_init目录结构 + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi35xx_init\hi3516dv300

+

编译打包16dv300内核镜像的编译脚本

+

hi35xx\hi35xx_init\hi3518ev300

+

编译打包18ev300内核镜像的编译脚本

+
+ +**表 3** hi3516dv300目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi3516dv300

+

Hi3516DV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件

+

hi35xx\hi3516dv300\module_init\lib

+

Hi3516DV300芯片媒体各模块驱动对应的库、LICENSE文件

+

hi35xx\hi3516dv300\module_init\src

+

内核驱动初始化源代码、LICENSE文件

+

hi35xx\hi3516dv300\soc\lib

+

Hi3516DV300芯片的媒体库文件、LICENSE文件

+

hi35xx\hi3516dv300\uboot\out\boot

+

采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3516dv300\uboot\reg\reg_info_hi3516dv300.bin编译成的uboot、README文件

+

hi35xx\hi3516dv300\uboot\reg

+

uboot配置文件、LICENSE文件

+

hi35xx\hi3516dv300\uboot\secureboot_ohos

+

鸿蒙OS安全启动相关的编译脚本

+

hi35xx\hi3516dv300\uboot\secureboot_release

+

生成安全uboot的源代码、License目录

+
+ +**表 4** hi3518ev300目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi3518ev300

+

Hi3518EV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件

+

hi35xx\hi3518ev300\module_init\lib

+

Hi3518EV300芯片媒体各模块驱动对应的库、LICENSE文件

+

hi35xx\hi3518ev300\module_init\src

+

内核驱动初始化源代码、LICENSE文件

+

hi35xx\hi3518ev300\soc\lib

+

Hi3518EV300芯片的媒体库文件、LICENSE文件

+

hi35xx\hi3518ev300\uboot\out\boot

+

采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3518ev300\uboot\reg\reg_info_hi3518ev300.bin编译成的uboot、README文件

+

hi35xx\hi3518ev300\uboot\reg

+

uboot配置文件、LICENSE文件

+

hi35xx\hi3518ev300\uboot\secureboot_ohos

+

鸿蒙OS安全启动相关的编译脚本

+

hi35xx\hi3518ev300\uboot\secureboot_release

+

生成安全uboot的源代码、License目录

+
+ +**表 5** middleware目录结构 + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\middleware\source\common

+

南向组件公共模块库目录

+

hi35xx\middleware\source\component

+

南向组件非公共模块库目录

+

hi35xx\middleware\source\thirdparty

+

南向插件依赖第三方开源软件目录

+
+ +**表 6** platform目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\platform

+

hi35xx平台驱动

+
+ +**表 7** third\_party目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\third_party\uboot\u-boot-2020.01

+

uboot开源代码

+
+ +## 约束 + +当前支持Hi3518EV300、Hi3516DV300芯片。 + +## 许可协议 + +## hi3516dv300许可说明 + +- hi35xx\\hi3516dv300\\module\_init\\lib和hi35xx\\hi3516dv300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3516dv300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * / + ``` + +- hi35xx\\hi3516dv300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3516dv300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3516dv300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 +- hi35xx\\hi3516dv300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * ... * / + ``` + + +- hi35xx\\hi3516dv300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。 + +## hi3518ev300许可说明 + +- hi35xx\\hi3518ev300\\module\_init\\lib和hi35xx\\hi3518ev300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3518ev300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * / + ``` + +- hi35xx\\hi3518ev300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3518ev300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3518ev300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 +- hi35xx\\hi3518ev300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * ... * / + ``` + +- hi35xx\\hi3518ev300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。 + +## third\_party许可说明 + +hi35xx\\third\_party\\uboot\\u-boot-2020.01为uboot开源代码,遵循软件版本自带的开源许可声明,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 + diff --git a/hi3516dv300_uboot/bundle.json b/hi3516dv300_uboot/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..e5d2723f223ecbb27f4fffff18a215b28d99c73f --- /dev/null +++ b/hi3516dv300_uboot/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/hi3516dv300_uboot", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应\"媒体子系统\"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/vendor/hisi/hi35xx/hi3516dv300/uboot &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "vender" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "vendor" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516" + } +} \ No newline at end of file diff --git a/hi3518ev300/LICENSE b/hi3518ev300/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/hi3518ev300/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/hi3518ev300/README.md b/hi3518ev300/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1f979a3f0d9511d19aa2c13d5c1f886e840fddbb --- /dev/null +++ b/hi3518ev300/README.md @@ -0,0 +1,300 @@ +# Hi3518ev300介绍 + +项目介绍 + +## 简介 + +海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应"媒体子系统"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。 + +**图 1** 多媒体子系统框架图 +![](http://tools.harmonyos.com/mirrors/hpm-image/hi3518ev300_README/figures/多媒体子系统框架图.png "多媒体子系统框架图") + +## 目录 + +海思(上海)媒体软件开发包目录结构如表1所示: + +**表 1** hardware目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\hardware

+

媒体南向接口实现、框架及芯片对接层库目录

+
+ +**表 2** hi35xx\_init目录结构 + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi35xx_init\hi3516dv300

+

编译打包16dv300内核镜像的编译脚本

+

hi35xx\hi35xx_init\hi3518ev300

+

编译打包18ev300内核镜像的编译脚本

+
+ +**表 3** hi3516dv300目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi3516dv300

+

Hi3516DV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件

+

hi35xx\hi3516dv300\module_init\lib

+

Hi3516DV300芯片媒体各模块驱动对应的库、LICENSE文件

+

hi35xx\hi3516dv300\module_init\src

+

内核驱动初始化源代码、LICENSE文件

+

hi35xx\hi3516dv300\soc\lib

+

Hi3516DV300芯片的媒体库文件、LICENSE文件

+

hi35xx\hi3516dv300\uboot\out\boot

+

采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3516dv300\uboot\reg\reg_info_hi3516dv300.bin编译成的uboot、README文件

+

hi35xx\hi3516dv300\uboot\reg

+

uboot配置文件、LICENSE文件

+

hi35xx\hi3516dv300\uboot\secureboot_ohos

+

鸿蒙OS安全启动相关的编译脚本

+

hi35xx\hi3516dv300\uboot\secureboot_release

+

生成安全uboot的源代码、License目录

+
+ +**表 4** hi3518ev300目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi3518ev300

+

Hi3518EV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件

+

hi35xx\hi3518ev300\module_init\lib

+

Hi3518EV300芯片媒体各模块驱动对应的库、LICENSE文件

+

hi35xx\hi3518ev300\module_init\src

+

内核驱动初始化源代码、LICENSE文件

+

hi35xx\hi3518ev300\soc\lib

+

Hi3518EV300芯片的媒体库文件、LICENSE文件

+

hi35xx\hi3518ev300\uboot\out\boot

+

采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3518ev300\uboot\reg\reg_info_hi3518ev300.bin编译成的uboot、README文件

+

hi35xx\hi3518ev300\uboot\reg

+

uboot配置文件、LICENSE文件

+

hi35xx\hi3518ev300\uboot\secureboot_ohos

+

鸿蒙OS安全启动相关的编译脚本

+

hi35xx\hi3518ev300\uboot\secureboot_release

+

生成安全uboot的源代码、License目录

+
+ +**表 5** middleware目录结构 + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\middleware\source\common

+

南向组件公共模块库目录

+

hi35xx\middleware\source\component

+

南向组件非公共模块库目录

+

hi35xx\middleware\source\thirdparty

+

南向插件依赖第三方开源软件目录

+
+ +**表 6** platform目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\platform

+

hi35xx平台驱动

+
+ +**表 7** third\_party目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\third_party\uboot\u-boot-2020.01

+

uboot开源代码

+
+ +## 约束 + +当前支持Hi3518EV300、Hi3516DV300芯片。 + +## 许可协议 + +## hi3516dv300许可说明 + +- hi35xx\\hi3516dv300\\module\_init\\lib和hi35xx\\hi3516dv300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3516dv300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * / + ``` + +- hi35xx\\hi3516dv300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3516dv300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3516dv300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 +- hi35xx\\hi3516dv300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * ... * / + ``` + + +- hi35xx\\hi3516dv300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。 + +## hi3518ev300许可说明 + +- hi35xx\\hi3518ev300\\module\_init\\lib和hi35xx\\hi3518ev300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3518ev300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * / + ``` + +- hi35xx\\hi3518ev300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3518ev300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3518ev300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 +- hi35xx\\hi3518ev300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * ... * / + ``` + +- hi35xx\\hi3518ev300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。 + +## third\_party许可说明 + +hi35xx\\third\_party\\uboot\\u-boot-2020.01为uboot开源代码,遵循软件版本自带的开源许可声明,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 + diff --git a/hi3518ev300/bundle.json b/hi3518ev300/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..81126fdcd142449e30f6393545ae1f5e5fafc62b --- /dev/null +++ b/hi3518ev300/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/hi3518ev300", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应\"媒体子系统\"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/vendor/hisi/hi35xx/ &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "vender" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "vendor" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3518" + } +} \ No newline at end of file diff --git a/hi3518ev300_adapter/LICENSE b/hi3518ev300_adapter/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/hi3518ev300_adapter/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/hi3518ev300_adapter/README.md b/hi3518ev300_adapter/README.md new file mode 100644 index 0000000000000000000000000000000000000000..78c108a39a399370e096242266c5dffa6ab30376 --- /dev/null +++ b/hi3518ev300_adapter/README.md @@ -0,0 +1,300 @@ +# Hi3518ev300介绍 + +项目介绍 + +## 简介 + +海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应"媒体子系统"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。 + +**图 1** 多媒体子系统框架图 +![](http://tools.harmonyos.com/mirrors/hpm-image/hi3518ev300_adapter_README/figures/多媒体子系统框架图.png "多媒体子系统框架图") + +## 目录 + +海思(上海)媒体软件开发包目录结构如表1所示: + +**表 1** hardware目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\hardware

+

媒体南向接口实现、框架及芯片对接层库目录

+
+ +**表 2** hi35xx\_init目录结构 + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi35xx_init\hi3516dv300

+

编译打包16dv300内核镜像的编译脚本

+

hi35xx\hi35xx_init\hi3518ev300

+

编译打包18ev300内核镜像的编译脚本

+
+ +**表 3** hi3516dv300目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi3516dv300

+

Hi3516DV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件

+

hi35xx\hi3516dv300\module_init\lib

+

Hi3516DV300芯片媒体各模块驱动对应的库、LICENSE文件

+

hi35xx\hi3516dv300\module_init\src

+

内核驱动初始化源代码、LICENSE文件

+

hi35xx\hi3516dv300\soc\lib

+

Hi3516DV300芯片的媒体库文件、LICENSE文件

+

hi35xx\hi3516dv300\uboot\out\boot

+

采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3516dv300\uboot\reg\reg_info_hi3516dv300.bin编译成的uboot、README文件

+

hi35xx\hi3516dv300\uboot\reg

+

uboot配置文件、LICENSE文件

+

hi35xx\hi3516dv300\uboot\secureboot_ohos

+

鸿蒙OS安全启动相关的编译脚本

+

hi35xx\hi3516dv300\uboot\secureboot_release

+

生成安全uboot的源代码、License目录

+
+ +**表 4** hi3518ev300目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi3518ev300

+

Hi3518EV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件

+

hi35xx\hi3518ev300\module_init\lib

+

Hi3518EV300芯片媒体各模块驱动对应的库、LICENSE文件

+

hi35xx\hi3518ev300\module_init\src

+

内核驱动初始化源代码、LICENSE文件

+

hi35xx\hi3518ev300\soc\lib

+

Hi3518EV300芯片的媒体库文件、LICENSE文件

+

hi35xx\hi3518ev300\uboot\out\boot

+

采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3518ev300\uboot\reg\reg_info_hi3518ev300.bin编译成的uboot、README文件

+

hi35xx\hi3518ev300\uboot\reg

+

uboot配置文件、LICENSE文件

+

hi35xx\hi3518ev300\uboot\secureboot_ohos

+

鸿蒙OS安全启动相关的编译脚本

+

hi35xx\hi3518ev300\uboot\secureboot_release

+

生成安全uboot的源代码、License目录

+
+ +**表 5** middleware目录结构 + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\middleware\source\common

+

南向组件公共模块库目录

+

hi35xx\middleware\source\component

+

南向组件非公共模块库目录

+

hi35xx\middleware\source\thirdparty

+

南向插件依赖第三方开源软件目录

+
+ +**表 6** platform目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\platform

+

hi35xx平台驱动

+
+ +**表 7** third\_party目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\third_party\uboot\u-boot-2020.01

+

uboot开源代码

+
+ +## 约束 + +当前支持Hi3518EV300、Hi3516DV300芯片。 + +## 许可协议 + +## hi3516dv300许可说明 + +- hi35xx\\hi3516dv300\\module\_init\\lib和hi35xx\\hi3516dv300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3516dv300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * / + ``` + +- hi35xx\\hi3516dv300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3516dv300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3516dv300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 +- hi35xx\\hi3516dv300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * ... * / + ``` + + +- hi35xx\\hi3516dv300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。 + +## hi3518ev300许可说明 + +- hi35xx\\hi3518ev300\\module\_init\\lib和hi35xx\\hi3518ev300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3518ev300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * / + ``` + +- hi35xx\\hi3518ev300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3518ev300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3518ev300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 +- hi35xx\\hi3518ev300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * ... * / + ``` + +- hi35xx\\hi3518ev300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。 + +## third\_party许可说明 + +hi35xx\\third\_party\\uboot\\u-boot-2020.01为uboot开源代码,遵循软件版本自带的开源许可声明,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 + diff --git a/hi3518ev300_adapter/bundle.json b/hi3518ev300_adapter/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..6cc815452888fe7f5f79901da17d4eee5b297834 --- /dev/null +++ b/hi3518ev300_adapter/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/hi3518ev300_adapter", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应\"媒体子系统\"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/vendor/hisi/hi35xx/ &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "vender" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "vendor" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3518" + } +} \ No newline at end of file diff --git a/hi3518ev300_uboot/LICENSE b/hi3518ev300_uboot/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/hi3518ev300_uboot/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/hi3518ev300_uboot/README.md b/hi3518ev300_uboot/README.md new file mode 100644 index 0000000000000000000000000000000000000000..dd925e826ef8e6bc96a86ce8d5de300dceab971f --- /dev/null +++ b/hi3518ev300_uboot/README.md @@ -0,0 +1,300 @@ +# Hi3518ev300介绍 + +项目介绍 + +## 简介 + +海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应"媒体子系统"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。 + +**图 1** 多媒体子系统框架图 +![](http://tools.harmonyos.com/mirrors/hpm-image/hi3518ev300_uboot_README/figures/多媒体子系统框架图.png "多媒体子系统框架图") + +## 目录 + +海思(上海)媒体软件开发包目录结构如表1所示: + +**表 1** hardware目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\hardware

+

媒体南向接口实现、框架及芯片对接层库目录

+
+ +**表 2** hi35xx\_init目录结构 + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi35xx_init\hi3516dv300

+

编译打包16dv300内核镜像的编译脚本

+

hi35xx\hi35xx_init\hi3518ev300

+

编译打包18ev300内核镜像的编译脚本

+
+ +**表 3** hi3516dv300目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi3516dv300

+

Hi3516DV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件

+

hi35xx\hi3516dv300\module_init\lib

+

Hi3516DV300芯片媒体各模块驱动对应的库、LICENSE文件

+

hi35xx\hi3516dv300\module_init\src

+

内核驱动初始化源代码、LICENSE文件

+

hi35xx\hi3516dv300\soc\lib

+

Hi3516DV300芯片的媒体库文件、LICENSE文件

+

hi35xx\hi3516dv300\uboot\out\boot

+

采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3516dv300\uboot\reg\reg_info_hi3516dv300.bin编译成的uboot、README文件

+

hi35xx\hi3516dv300\uboot\reg

+

uboot配置文件、LICENSE文件

+

hi35xx\hi3516dv300\uboot\secureboot_ohos

+

鸿蒙OS安全启动相关的编译脚本

+

hi35xx\hi3516dv300\uboot\secureboot_release

+

生成安全uboot的源代码、License目录

+
+ +**表 4** hi3518ev300目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\hi3518ev300

+

Hi3518EV300芯片驱动软件,包括:媒体驱动子目录、媒体用户态库子目录、uboot的差异化内容目录、NOTICE文件

+

hi35xx\hi3518ev300\module_init\lib

+

Hi3518EV300芯片媒体各模块驱动对应的库、LICENSE文件

+

hi35xx\hi3518ev300\module_init\src

+

内核驱动初始化源代码、LICENSE文件

+

hi35xx\hi3518ev300\soc\lib

+

Hi3518EV300芯片的媒体库文件、LICENSE文件

+

hi35xx\hi3518ev300\uboot\out\boot

+

采用hi35xx\third_party\uboot\u-boot-2020.01和hi35xx\hi3518ev300\uboot\reg\reg_info_hi3518ev300.bin编译成的uboot、README文件

+

hi35xx\hi3518ev300\uboot\reg

+

uboot配置文件、LICENSE文件

+

hi35xx\hi3518ev300\uboot\secureboot_ohos

+

鸿蒙OS安全启动相关的编译脚本

+

hi35xx\hi3518ev300\uboot\secureboot_release

+

生成安全uboot的源代码、License目录

+
+ +**表 5** middleware目录结构 + + + + + + + + + + + + + + + + +

名称

+

描述

+

hi35xx\middleware\source\common

+

南向组件公共模块库目录

+

hi35xx\middleware\source\component

+

南向组件非公共模块库目录

+

hi35xx\middleware\source\thirdparty

+

南向插件依赖第三方开源软件目录

+
+ +**表 6** platform目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\platform

+

hi35xx平台驱动

+
+ +**表 7** third\_party目录结构 + + + + + + + + + + +

名称

+

描述

+

hi35xx\third_party\uboot\u-boot-2020.01

+

uboot开源代码

+
+ +## 约束 + +当前支持Hi3518EV300、Hi3516DV300芯片。 + +## 许可协议 + +## hi3516dv300许可说明 + +- hi35xx\\hi3516dv300\\module\_init\\lib和hi35xx\\hi3516dv300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3516dv300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * / + ``` + +- hi35xx\\hi3516dv300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3516dv300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3516dv300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 +- hi35xx\\hi3516dv300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * ... * / + ``` + + +- hi35xx\\hi3516dv300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。 + +## hi3518ev300许可说明 + +- hi35xx\\hi3518ev300\\module\_init\\lib和hi35xx\\hi3518ev300\\soc\\lib里面为海思(上海)的自研库,遵循海思(上海)的LICENSE,这两个目录下均有LICENSE文件,LICENSE文件结尾可以看到版权信息: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3518ev300\\module\_init\\src目录下为海思(上海)自研代码,使用基于Apache License Version 2.0许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有Apache License Version 2.0的LICENSE文件,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. Licensed under the Apache License,* ... * / + ``` + +- hi35xx\\hi3518ev300\\uboot\\reg为海思(上海)的二进制文件,遵循海思(上海)的LICENSE,该目录下有LICENSE文件,LICENSE文件结尾可以看到: + + ``` + Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + ``` + +- hi35xx\\hi3518ev300\\uboot\\out\\boot是由u-boot-2020.01和reg\_info\_hi3518ev300.bin编译成的uboot二进制文件,完全遵从u-boot-2020.01的整体协议,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 +- hi35xx\\hi3518ev300\\uboot\\secureboot\_release为安全uboot的开源代码,其中自研的部分使用基于GPL许可的Hisilicon \(Shanghai\) 版权声明,在该目录下有License目录,许可信息和版权信息通常可以在文件开头看到: + + ``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * ... * / + ``` + +- hi35xx\\hi3518ev300\\NOTICE文件描述了使用到的三款开源软件:Das U-Boot 2020.01、mbed TLS 2.16.6、fdk-aac v2.0.1。 + +## third\_party许可说明 + +hi35xx\\third\_party\\uboot\\u-boot-2020.01为uboot开源代码,遵循软件版本自带的开源许可声明,具体请参看hi35xx\\third\_party\\uboot\\u-boot-2020.01\\Licenses目录下的README。 + diff --git a/hi3518ev300_uboot/bundle.json b/hi3518ev300_uboot/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..0ba5901858ece838d23c68f6b2967e80201ed713 --- /dev/null +++ b/hi3518ev300_uboot/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/hi3518ev300_uboot", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "海思(上海)媒体软件开发包用于适配不同芯片复杂的底层处理,为“媒体子系统”提供基础的多媒体处理功能。主要功能有:音视频采集、音视频编解码、音视频输出、视频前处理、封装、解封装、文件管理、存储管理、日志系统等。该软件包功能对应\"媒体子系统\"框架中红色框标注部分,如图1所示。所对应的目录为:vendor\\hisi\\hi35xx。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/vendor/hisi/hi35xx/hi3518ev300/uboot &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "vender" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "vendor" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3518" + } +} \ No newline at end of file diff --git a/hi3861/LICENSE b/hi3861/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/hi3861/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/hi3861/README.md b/hi3861/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8dd400ef7d58acf946958895bc4833faa70a378c --- /dev/null +++ b/hi3861/README.md @@ -0,0 +1,178 @@ +# Hi3861V100介绍 + +## 简介 + +Hi3861V100是一款高度集成的2.4GHz WiFi SoC芯片,集成IEEE 802.11b/g/n基带和RF电路,RF电路包括功率放大器PA、低 噪声放大器LNA、RF balun、天线开关以及电源管理等模块;支持20MHz标准带宽和5MHz/10MHz窄带宽,提供最大72.2Mbit/s 物理层速率。 Hi3861V100 WiFi基带支持正交频分复用(OFDM)技术,并向下兼容直接序列扩频(DSSS)和补码键控(CCK)技术,支 持IEEE 802.11 b/g/n协议的各种数据速率。 Hi3861V100芯片集成高性能32bit微处理器、硬件安全引擎以及丰富的外设接口,外设接口包括SPI、UART、I2C、PWM、 GPIO和多路ADC,同时支持高速SDIO2.0 Slave接口,最高时钟可达50MHz;芯片内置SRAM和Flash,可独立运行,并支持 在Flash上运行程序。 Hi3861V100芯片适应于智能家电等物联网智能终端领域。 + +## 架构 + +海思Hi3861系列的平台软件对应用层实现了底层屏蔽,并对应用软件直接提供API\(Application Programming Interface\)接口完成相应功能。典型的系统应用架构如下: + +**图 1** 系统应用框架图 + + +![](http://tools.harmonyos.com/mirrors/hpm-image/hi3861_README/figures/zh-cn_image_0000001054797626.png) + +该框架可以分为以下几个层次: + +- APP层:即应用层。SDK提供的代码示例在SDK的代码目录:app\\demo\\src。 +- API层:提供基于SDK开发的通用接口。 +- Platform平台层:提供SOC系统板级支持包,包括如下功能: + - 芯片和外围器件驱动 + - 操作系统 + - 系统管理 + +- Service服务层:提供包含WiFi等应用协议栈。用于上层应用软件进行数据收发等操作。 +- 第三方库:提供给Service服务层或提供给应用层使用的第三方软件库。 + +## 特点 + +**稳定、可靠的通信能力** + +- 支持复杂环境下 TPC、自动速率、弱干扰免疫等可靠性通信算法 + +**灵活的组网能力** + +- 支持 256 节点 Mesh 组网 +- 支持标准 20M 带宽组网和 5M/10M 窄带组网 + +**完善的网络支持** + +- 支持 IPv4/IPv6 网络功能 +- 支持 DHCPv4/DHCPv6 Client/Server +- 支持 DNS Client 功能 +- 支持 mDNS 功能 +- 支持 CoAP/MQTT/HTTP/JSON 基础组件 + +**强大的安全引擎** + +- 硬件实现 AES128/256 加解密算法 +- 硬件实现 HASH-SHA256、HMAC\_SHA256 算法 +- 硬件实现 RSA、ECC 签名校验算法 +- 硬件实现真随机数生成,满足 FIPS140-2 随机测试标准 +- 硬件支持 TLS/DTLS 加速 +- 内部集成 EFUSE,支持安全存储、安全启动、硬件 ID +- 内部集成 MPU 特性,支持内存隔离特性 + +**开放的操作系统** + +- 丰富的低功耗、小内存、高稳定性、高实时性机制 +- 灵活的协议支撑和扩展能力 +- 二次开发接口 +- 多层级开发接口:操作系统适配接口和系统诊断接口、 链路层接口、网络层接口 + +## 目录 + +SDK根目录结构如下图所示: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

目录

+

说明

+

app

+

应用层代码(其中包含demo程序为参考示例)。

+

boot

+

Flash bootloader代码。

+

build

+

SDK构建所需的库文件、链接文件、配置文件。

+

config

+

SDK系统配置文件。

+

documents

+

文档目录(包括:SDK说明文档)。

+

include

+

API头文件存放目录。

+

license

+

SDK开源license声明

+

output

+

编译时生成的目标文件与中间文件(包括:库文件、打印log、生成的二进制文件等)。

+

platform

+

SDK平台相关的文件(包括:镜像、内核驱动模块等)。

+

third_party

+

开源第三方软件目录。

+

tools

+

SDK提供的Linux系统和Windows系统上使用的工具(包括:NV制作工具、签名工具、Menuconfig等)。

+

SConstruct

+

SCons编译脚本。

+

build.sh

+

启动编译脚本,同时支持“sh build.sh menuconfig”进行客制化配置。

+

build_patch.sh

+

解压开源源码包和patch文件编译脚本。

+

Makefile

+

支持makefile编译,使用“make”或“make all”启动编译。

+

non_factory.mk

+

非厂测版本编译脚本。

+

factory.mk

+

厂测版本编译脚本。

+

NOTICE

+

第三方软件开源声明

+
+ +## 许可协议 + +- Hi3861V100自研代码使用基于Apache License Version 2.0许可的hisi版权声明。许可信息和版权信息通常可以在代码开头看到: + +``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.Licensed under the Apache License,* ... * / +``` + +- Hi3861V100使用的第三方代码遵循软件版本自带的开源许可声明。 +- 将生成的库文件统一存放于根目录下的build/libs下。 + diff --git a/hi3861/bundle.json b/hi3861/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..5a2e660d67bc2817695eff683b45ada235479431 --- /dev/null +++ b/hi3861/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/hi3861", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "Hi3861V100是一款高度集成的2.4GHz WiFi SoC芯片,集成IEEE 802.11b/g/n基带和RF电路,RF电路包括功率放大器PA、低 噪声放大器LNA、RF balun、天线开关以及电源管理等模块;支持20MHz标准带宽和5MHz/10MHz窄带宽,提供最大72.2Mbit/s 物理层速率。 Hi3861V100 WiFi基带支持正交频分复用(OFDM)技术,并向下兼容直接序列扩频(DSSS)和补码键控(CCK)技术,支 持IEEE 802.11 b/g/n协议的各种数据速率。 Hi3861V100芯片集成高性能32bit微处理器、硬件安全引擎以及丰富的外设接口,外设接口包括SPI、UART、I2C、PWM、 GPIO和多路ADC,同时支持高速SDIO2.0 Slave接口,最高时钟可达50MHz;芯片内置SRAM和Flash,可独立运行,并支持 在Flash上运行程序。 Hi3861V100芯片适应于智能家电等物联网智能终端领域。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/vendor/hisi/hi3861/hi3861 &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "vender" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "vendor" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-m", + "board": "hi3861" + } +} \ No newline at end of file diff --git a/hi3861_adapter/LICENSE b/hi3861_adapter/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/hi3861_adapter/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/hi3861_adapter/README.md b/hi3861_adapter/README.md new file mode 100644 index 0000000000000000000000000000000000000000..38cc82702af6e038b5c9ee4e2fbef4f97bcaba34 --- /dev/null +++ b/hi3861_adapter/README.md @@ -0,0 +1,178 @@ +# Hi3861V100介绍 + +## 简介 + +Hi3861V100是一款高度集成的2.4GHz WiFi SoC芯片,集成IEEE 802.11b/g/n基带和RF电路,RF电路包括功率放大器PA、低 噪声放大器LNA、RF balun、天线开关以及电源管理等模块;支持20MHz标准带宽和5MHz/10MHz窄带宽,提供最大72.2Mbit/s 物理层速率。 Hi3861V100 WiFi基带支持正交频分复用(OFDM)技术,并向下兼容直接序列扩频(DSSS)和补码键控(CCK)技术,支 持IEEE 802.11 b/g/n协议的各种数据速率。 Hi3861V100芯片集成高性能32bit微处理器、硬件安全引擎以及丰富的外设接口,外设接口包括SPI、UART、I2C、PWM、 GPIO和多路ADC,同时支持高速SDIO2.0 Slave接口,最高时钟可达50MHz;芯片内置SRAM和Flash,可独立运行,并支持 在Flash上运行程序。 Hi3861V100芯片适应于智能家电等物联网智能终端领域。 + +## 架构 + +海思Hi3861系列的平台软件对应用层实现了底层屏蔽,并对应用软件直接提供API\(Application Programming Interface\)接口完成相应功能。典型的系统应用架构如下: + +**图 1** 系统应用框架图 + + +![](http://tools.harmonyos.com/mirrors/hpm-image/hi3861_adapter_README/figures/zh-cn_image_0000001054797626.png) + +该框架可以分为以下几个层次: + +- APP层:即应用层。SDK提供的代码示例在SDK的代码目录:app\\demo\\src。 +- API层:提供基于SDK开发的通用接口。 +- Platform平台层:提供SOC系统板级支持包,包括如下功能: + - 芯片和外围器件驱动 + - 操作系统 + - 系统管理 + +- Service服务层:提供包含WiFi等应用协议栈。用于上层应用软件进行数据收发等操作。 +- 第三方库:提供给Service服务层或提供给应用层使用的第三方软件库。 + +## 特点 + +**稳定、可靠的通信能力** + +- 支持复杂环境下 TPC、自动速率、弱干扰免疫等可靠性通信算法 + +**灵活的组网能力** + +- 支持 256 节点 Mesh 组网 +- 支持标准 20M 带宽组网和 5M/10M 窄带组网 + +**完善的网络支持** + +- 支持 IPv4/IPv6 网络功能 +- 支持 DHCPv4/DHCPv6 Client/Server +- 支持 DNS Client 功能 +- 支持 mDNS 功能 +- 支持 CoAP/MQTT/HTTP/JSON 基础组件 + +**强大的安全引擎** + +- 硬件实现 AES128/256 加解密算法 +- 硬件实现 HASH-SHA256、HMAC\_SHA256 算法 +- 硬件实现 RSA、ECC 签名校验算法 +- 硬件实现真随机数生成,满足 FIPS140-2 随机测试标准 +- 硬件支持 TLS/DTLS 加速 +- 内部集成 EFUSE,支持安全存储、安全启动、硬件 ID +- 内部集成 MPU 特性,支持内存隔离特性 + +**开放的操作系统** + +- 丰富的低功耗、小内存、高稳定性、高实时性机制 +- 灵活的协议支撑和扩展能力 +- 二次开发接口 +- 多层级开发接口:操作系统适配接口和系统诊断接口、 链路层接口、网络层接口 + +## 目录 + +SDK根目录结构如下图所示: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

目录

+

说明

+

app

+

应用层代码(其中包含demo程序为参考示例)。

+

boot

+

Flash bootloader代码。

+

build

+

SDK构建所需的库文件、链接文件、配置文件。

+

config

+

SDK系统配置文件。

+

documents

+

文档目录(包括:SDK说明文档)。

+

include

+

API头文件存放目录。

+

license

+

SDK开源license声明

+

output

+

编译时生成的目标文件与中间文件(包括:库文件、打印log、生成的二进制文件等)。

+

platform

+

SDK平台相关的文件(包括:镜像、内核驱动模块等)。

+

third_party

+

开源第三方软件目录。

+

tools

+

SDK提供的Linux系统和Windows系统上使用的工具(包括:NV制作工具、签名工具、Menuconfig等)。

+

SConstruct

+

SCons编译脚本。

+

build.sh

+

启动编译脚本,同时支持“sh build.sh menuconfig”进行客制化配置。

+

build_patch.sh

+

解压开源源码包和patch文件编译脚本。

+

Makefile

+

支持makefile编译,使用“make”或“make all”启动编译。

+

non_factory.mk

+

非厂测版本编译脚本。

+

factory.mk

+

厂测版本编译脚本。

+

NOTICE

+

第三方软件开源声明

+
+ +## 许可协议 + +- Hi3861V100自研代码使用基于Apache License Version 2.0许可的hisi版权声明。许可信息和版权信息通常可以在代码开头看到: + +``` + / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.Licensed under the Apache License,* ... * / +``` + +- Hi3861V100使用的第三方代码遵循软件版本自带的开源许可声明。 +- 将生成的库文件统一存放于根目录下的build/libs下。 + diff --git a/hi3861_adapter/bundle.json b/hi3861_adapter/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..7b4d497f0e5d2d09ce98c35c6290222045ceb888 --- /dev/null +++ b/hi3861_adapter/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/hi3861_adapter", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "Hi3861V100是一款高度集成的2.4GHz WiFi SoC芯片,集成IEEE 802.11b/g/n基带和RF电路,RF电路包括功率放大器PA、低 噪声放大器LNA、RF balun、天线开关以及电源管理等模块;支持20MHz标准带宽和5MHz/10MHz窄带宽,提供最大72.2Mbit/s 物理层速率。 Hi3861V100 WiFi基带支持正交频分复用(OFDM)技术,并向下兼容直接序列扩频(DSSS)和补码键控(CCK)技术,支 持IEEE 802.11 b/g/n协议的各种数据速率。 Hi3861V100芯片集成高性能32bit微处理器、硬件安全引擎以及丰富的外设接口,外设接口包括SPI、UART、I2C、PWM、 GPIO和多路ADC,同时支持高速SDIO2.0 Slave接口,最高时钟可达50MHz;芯片内置SRAM和Flash,可独立运行,并支持 在Flash上运行程序。 Hi3861V100芯片适应于智能家电等物联网智能终端领域。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE} && mkdir -p $DEST_PATH && cp -r vendor kernel $DEST_PATH" + }, + "keywords": [ + "vender" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "vendor" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-m", + "board": "hi3861" + } +} \ No newline at end of file diff --git a/hichainsdk/LICENSE b/hichainsdk/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/hichainsdk/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/hichainsdk/README.md b/hichainsdk/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b19406dcacc440fe0639ddae39aedabaaace08d3 --- /dev/null +++ b/hichainsdk/README.md @@ -0,0 +1,38 @@ +# 项目介绍 + +## HiChain + +**设备互联安全** + +为了实现用户数据在设备互联场景下在各个设备之间的安全流转,需要保证设备之间相互正确可信,即设备和设备之间建立信任关系,并能够在验证信任关系后,搭建安全的连接通道,实现用户数据的安全传输。设备之间的信任关系在本文档中涉及IoT主控设备和IoT设备之间建立的可信关系。 + +![](http://tools.harmonyos.com/mirrors/hpm-image/hichainsdk_README/figures/zh-cn_image_0000001054308773.png) + +- **IoT设备互联安全** + + +设备互联支持基于系统的IoT设备(如AI音箱、智能家居、智能穿戴等设备)与IoT主控设备(手机、平板等)间建立点对点的信任关系,并在具备信任关系的设备间,搭建安全的连接通道,实现用户数据端到端加密传输。 + +- **IoT主控设备的IoT业务身份标识** + + +IoT主控设备为不同的IoT设备管理业务生成不同的身份标识,形成不同IoT管理业务间的隔离,该标识用于IoT主控设备与IoT设备之间的认证以及通信。IoT业务身份标识为椭圆曲线公私钥对(Ed25519公私钥对); + +- **IoT设备身份标识** + + +IoT设备会生成各自的设备身份标识,用来与IoT主控设备通信。该身份标识同样为椭圆曲线公私钥对(Ed25519公私钥对);IoT设备私钥不出IoT设备,设备每次恢复出厂设置,会重置这个公私钥对。 + +上述身份标识可用于IoT主控设备与IoT设备间的安全通信:当IoT主控设备与IoT设备通过信任绑定流程交换业务身份标识或设备标识后,可以进行密钥协商并建立安全通信通道。 + +- **设备间点对点的信任绑定** + + +IoT主控设备和IoT设备建立点对点信任关系的过程,实际上是相互交换IoT设备的身份标识的过程。 + +在点对点建立信任关系的过程中,用户需要在IoT主控设备上,输入IoT设备上提供的PIN码:对于有屏幕的设备,该PIN码动态生成;对于没有屏幕的设备,该PIN码由设备生产厂家预置;PIN码的展示形式,可以是一个用户可读的数字,也可以是一个二维码。随后,IoT主控设备和IoT设备间使用PAKE协议完成认证和会话密钥协商过程,并在此基础上,通过协商出的会话密钥加密传输通道用于交换双方设备的身份标识公钥。 + +**IoT主控设备与IoT设备间的通信安全** + +当建立过信任关系的IoT主控设备与IoT设备间进行通信时,双方在完成上述信任关系绑定后,基于本地存储的对端身份公钥相互进行认证;在每次通信时基于STS协议完成双向身份认证以及会话密钥协商,之后设备使用此会话密钥加密双方设备间的传输通道。 + diff --git a/hichainsdk/bundle.json b/hichainsdk/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..81b5a0326e03d60ad04419f732d500c5cc651253 --- /dev/null +++ b/hichainsdk/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/hichainsdk", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "为了实现用户数据在设备互联场景下在各个设备之间的安全流转,需要保证设备之间相互正确可信,即设备和设备之间建立信任关系,并能够在验证信任关系后,搭建安全的连接通道,实现用户数据的安全传输。设备之间的信任关系在本文档中涉及IoT主控设备和IoT设备之间建立的可信关系。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/security &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "hichainsdk" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a,liteos-m", + "board": "hi3516,hi3518,hi3861" + } +} \ No newline at end of file diff --git a/hievent/LICENSE b/hievent/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/hievent/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/hievent/README.md b/hievent/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c16295fa38d098634b554a1b94dd7606a866df22 --- /dev/null +++ b/hievent/README.md @@ -0,0 +1,19 @@ +# 项目介绍 + +## 简介 + +为系统内业务组件提供故障、用户行为、功耗统计三类事件打点接口,支持对事件进行序列化。 + +## 架构 + +1. 事件打点时通过CreateEvent接口先创建一个事件; +2. 通过AddData2Event接口向事件中添加数据; +3. 添加完成后通过ReportEvent接口上报事件; +4. Event组件检查参数有效性后,对事件进行二进制序列化处理(序列化方案需要与HOS的HiEvent序列化方案兼容,以支持事件在云端统一解析),将事件转换为结构化数据; +5. Event调用Output组件的OutputEvent接口将事件写入文件,每次新写文件时,先向事件文件中加入公共头信息; +6. 事件上报手机侧的处理由Upload组件被动或主动定时完成; + + **图 1** Hievent流程图 + ![](http://tools.harmonyos.com/mirrors/hpm-image/hievent_README/figures/Hievent流程图.png "Hievent流程图") + + diff --git a/hievent/bundle.json b/hievent/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..8455400dd3087177a9ec46b7664fc475129b19d5 --- /dev/null +++ b/hievent/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/hievent", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "为系统内业务组件提供故障、用户行为、功耗统计三类事件打点接口,支持对事件进行序列化。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/hiviewdfx/ &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "hievent" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-m", + "board": "hi3861" + } +} \ No newline at end of file diff --git a/hilog_a/LICENSE b/hilog_a/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/hilog_a/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/hilog_a/README.md b/hilog_a/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5005bd6269a98d52c62bc34c6c5ade70928972b5 --- /dev/null +++ b/hilog_a/README.md @@ -0,0 +1,365 @@ +# Hilog子系统介绍 + +## 简介 + +该仓库用于存放DFX框架的代码。主要包含DFR(可靠性)和DFT(可测试性)特性。 + +由于芯片平台资源有限,且硬件平台多样,因此需要针对不同硬件架构和资源提供组件化且可定制的DFX框架。根据RISC-V、Cortex-M、Cortex-A不同硬件平台,提供两种不同的轻量级DFX框架,以下简称mini、featured。 + +- mini框架:针对处理架构为Cortex-M或同等处理能力的硬件平台,系统内存一般低于512KB,无文件系统或者仅提供一个可有限使用的轻量级文件系统,遵循CMSIS接口规范。 + +- featured框架:处理架构为Cortex-A或同等处理能力的硬件平台,内存资源大于512KB,文件系统完善,可存储大量数据,遵循POSIX接口规范。 + + +## 目录 + +**表 1** 轻量级DFX子系统源代码目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

interface

+

存放所有对外接口定义头文件

+

interfaces/kits/hilog

+

featured框架流水日志对外接口定义

+

interfaces/kits/hilog_lite

+

mini框架流水日志对外接口定义

+

interfaces/innerkits/hievent_lite

+

mini框架事件打点对外接口定义

+

services/hilogcat_lite

+

流水日志相关服务和命令

+

services/hilogcat_lite/apphilogcat

+

featured框架流水日志落盘服务

+

services/hilogcat_lite/command

+

mini框架dfx命令

+

services/hilogcat_lite/hilogcat

+

featured框架流水日志输出命令

+

services/hiview_lite

+

DFX框架服务化注册

+

frameworks/ddrdump_lite

+

mini框架ddrdump信息转储

+

frameworks/hievent_lite

+

mini框架事件打点记录实现

+

frameworks/hilog_lite

+

流水日志接口实现

+

frameworks/hilog_lite/featured

+

featured框架流水日志接口实现

+

frameworks/hilog_lite/mini

+

mini框架流水日志接口实现

+

utils/lite

+

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

+
+ +## 约束 + +mini框架整体代码使用标准C开发,对外的接口依赖统一通过util封装,如软硬件平台不同需要适配,需要在vendor下实现适配处理。 + +## 使用-mini框架 + +DFX-mini是一套简单小巧的DFX设计,对外提供log功能: + +- **以下以A模块为例说明如何添加模块并进行日志打印。** + 1. **第一步添加模块ID** + + 在interfaces/kits/hilog\_lite/hiview\_log.h的HiLogModuleDef中添加HILOG\_MODULE\_A定义。 + + ``` + typedef enum { + /** DFX */ + HILOG_MODULE_HIVIEW = 0, + /** System Module A */ + HILOG_MODULE_A, + /** Maximum number of modules */ + HILOG_MODULE_MAX + } HiLogModuleType; + ``` + + + 1. **第二步模块注册** + + 在A模块的初始化流程中添加如下代码,注册模块到日志框架中: + + ``` + HiLogRegisterModule(HILOG_MODULE_SAMGR, "A"); + ``` + + + 1. **第三步调整DFX框架静态配置** + + 根据需要调整 + + ``` + utils/lite/hiview_config.c + ``` + + 的g\_hiviewConfig全局参数配置。默认情况下不用修改,日志默认输出到串口。 + + + + + + + + + + + + + + + + + + + + + + +

配置项

+

取值及含义

+

outputOption

+

日志的输出方式。取值如下:

+

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

+

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

+

OUTPUT_OPTION_TEXT_FILE 日志输出为文本文件

+

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

+

level

+

日志的输出级别,仅输出大于等于该级别的日志。取值如下:

+

HILOG_LV_DEBUG/ HILOG_LV_INFO/ HILOG_LV_WARN/ HILOG_LV_ERROR/ HILOG_LV_FATAL

+

logSwitch

+

流水日志功能开关。编译前关闭不影响log组件初始化。默认打开。取值如下:

+

HIVIEW_FEATURE_ON/ HIVIEW_FEATURE_OFF

+

dumpSwitch

+

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

+

HIVIEW_FEATURE_ON/ HIVIEW_FEATURE_OFF

+

eventSwitch

+

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

+

HIVIEW_FEATURE_ON/ HIVIEW_FEATURE_OFF

+
+ + 2. **第四步日志打印** + + 在需要打印日志的.c文件中 \#include "log.h",调用如下接口: + + HILOG\_INFO\(HILOG\_MODULE\_SAMGR, “log test: %d”, 88\); + + 接口参数说明: + + + + + + + + + + + + + + + + + + + + + + + + +

参数名

+

是否必填

+

参数类型

+

参数说明

+

mod

+

+

uint8

+

模块\服务的ID。

+

统一规划分配,最大支持64个,其中第三方APP统一使用HILOG_MODULE_APP作为模块ID。

+

fmt

+

+

char *

+

格式化输出字符串。

+

1、 最大支持6个可变参数,不支持%s。

+

2、 格式化后的单条日志最大长度128字节,超过将无法打印。

+

可变参

+

+

int32

+

仅支持数字类型,最大支持6个变参。

+
+ + + +## 使用-featured框架 + +DFX featured框架提供完整的DFX特性,对外提供log接口: + +**Native C/C++**接口 + +hilog 可用API + +``` +HILOGD(fmt,...) HILOGI(fmt,...) HILOGW(fmt,...) HILOGE(fmt,...) +``` + +使用介绍 + +首先需要定义TAG,DOMAIN需要找DFT申请,未经申请的DOMAIN,日志打印不出来。 + +本地调试,可以临时使用domain数值 0。 + +包含头文件:\#include + +在BUILD.gn中添加依赖库 libhilog。 + +接口规则介绍: + +1. 格式化字符串默认是非隐私 HILOGI\("Hello World\\n"\); \>\> Hello World + +2. 格式化参数默认是隐私 HILOGI\("Age is %d\\n", 10\); \>\> Age is + +3. %\{private\}标识的参数是隐私 HILOGI\("Age is %\{private\}d\\n", 10\); \>\> Age is + +4. %\{public\}标识的参数是非隐私 HILOGI\("Age is %\{public\}d\\n", 10\); \>\>Age is 10 + +接口参数介绍 + + + + + + + + + + + + + + + + + + + + + + +

参数名字

+

参数含义

+

domain

+

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

+

tag

+

日志tag

+

isFmtPrivate

+

标识格式化字符串fmt是否是隐私,是yes时fmt会被认为是隐私

+

fmt

+

格式化字符串

+

args

+

格式化字符串参数

+
+ +**日志查看** + +1. debug版本hilog日志会保存到/storage/data/log/hilogs 目录下面。 + +2. 可以执行hilogcat实时查看hilog日志。 + + +**日志系统架构** + +![](http://tools.harmonyos.com/mirrors/hpm-image/hilog_a_README/figures/zh-cn_image_0000001052080708.png) + +1. hilogtask流水日志的内核任务。 + - 此功能是一个linux内核的任务或者线程,在系统启动时初始化。 + - 当内核中一个模块调用它的日志接口,将格式化好的日志内容传输给改任务,并将其存储在一个环形缓冲区中 。 + - 当用户态调用日志接口,将格式化好的日志内容通过ioctl调用写入驱动节点,驱动节点再将日志内容发送到hilogtask,hilogtask将日志内容存储到环形缓冲区中。 + +2. hilogcatd用户态日志存储服务。 + - 这是一个用户态的进程,负责定时将内核的ringbuffer读取出来,存储到日志文件中。 + - 日志文件输出支持gzip压缩,使用zlib + - 每个类型的ringbuffer分开存储。 + - 存储文件的单个文件大小,文件个数可在编译时配置。 + +3. hilogcat日志查看命令行工具。 + + 从内核驱动接口读取ringbuffer内容,输出到标准输出。 + +4. 支持日志缓冲区可配置。 + - 编译时可以配置日志缓冲区的大小。 + - 编译时可以指定日志缓冲区的类型,类型个数就是ringbuffer的个数。 + + +## 涉及仓 + +hiviewdfx\_frameworks\_hievent\_lite + +hiviewdfx\_frameworks\_ddrdump\_lite + +hiviewdfx\_frameworks\_hilog\_lite + +hiviewdfx\_interfaces\_innerkits\_hilog + +hiviewdfx\_interfaces\_innerkits\_hievent\_lite + +hiviewdfx\_interfaces\_kits\_hilog + +hiviewdfx\_interfaces\_kits\_hilog\_lite + +hiviewdfx\_services\_hiview\_lite + +hiviewdfx\_services\_hilogcat\_lite + +hiviewdfx\_utils\_lite + diff --git a/hilog_a/bundle.json b/hilog_a/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..e9f8e826dbf089ef0af161497369a7e64928ebb2 --- /dev/null +++ b/hilog_a/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/hilog_a", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "该仓库用于存放DFX框架的代码。主要包含DFR(可靠性)和DFT(可测试性)特性。-由于芯片平台资源有限,且硬件平台多样,因此需要针对不同硬件架构和资源提供组件化且可定制的DFX框架。根据RISC-V、Cortex-M、Cortex-A不同硬件平台,提供两种不同的轻量级DFX框架,以下简称mini、featured。-mini框架:针对处理架构为Cortex-M或同等处理能力的硬件平台,系统内存一般低于512KB,无文件系统或者仅提供一个可有限使用的轻量级文件系统,遵循CMSIS接口规范。featured框架:处理架构为Cortex-A或同等处理能力的硬件平台,内存资源大于512KB,文件系统完善,可存储大量数据,遵循POSIX接口规范。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/hiviewdfx &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "hilog" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/hilog_m/LICENSE b/hilog_m/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/hilog_m/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/hilog_m/README.md b/hilog_m/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4178f06f782b7b51a2232cf7f9fe486cf6cad5c0 --- /dev/null +++ b/hilog_m/README.md @@ -0,0 +1,365 @@ +# Hilog子系统介绍 + +## 简介 + +该仓库用于存放DFX框架的代码。主要包含DFR(可靠性)和DFT(可测试性)特性。 + +由于芯片平台资源有限,且硬件平台多样,因此需要针对不同硬件架构和资源提供组件化且可定制的DFX框架。根据RISC-V、Cortex-M、Cortex-A不同硬件平台,提供两种不同的轻量级DFX框架,以下简称mini、featured。 + +- mini框架:针对处理架构为Cortex-M或同等处理能力的硬件平台,系统内存一般低于512KB,无文件系统或者仅提供一个可有限使用的轻量级文件系统,遵循CMSIS接口规范。 + +- featured框架:处理架构为Cortex-A或同等处理能力的硬件平台,内存资源大于512KB,文件系统完善,可存储大量数据,遵循POSIX接口规范。 + + +## 目录 + +**表 1** 轻量级DFX子系统源代码目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

interface

+

存放所有对外接口定义头文件

+

interfaces/kits/hilog

+

featured框架流水日志对外接口定义

+

interfaces/kits/hilog_lite

+

mini框架流水日志对外接口定义

+

interfaces/innerkits/hievent_lite

+

mini框架事件打点对外接口定义

+

services/hilogcat_lite

+

流水日志相关服务和命令

+

services/hilogcat_lite/apphilogcat

+

featured框架流水日志落盘服务

+

services/hilogcat_lite/command

+

mini框架dfx命令

+

services/hilogcat_lite/hilogcat

+

featured框架流水日志输出命令

+

services/hiview_lite

+

DFX框架服务化注册

+

frameworks/ddrdump_lite

+

mini框架ddrdump信息转储

+

frameworks/hievent_lite

+

mini框架事件打点记录实现

+

frameworks/hilog_lite

+

流水日志接口实现

+

frameworks/hilog_lite/featured

+

featured框架流水日志接口实现

+

frameworks/hilog_lite/mini

+

mini框架流水日志接口实现

+

utils/lite

+

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

+
+ +## 约束 + +mini框架整体代码使用标准C开发,对外的接口依赖统一通过util封装,如软硬件平台不同需要适配,需要在vendor下实现适配处理。 + +## 使用-mini框架 + +DFX-mini是一套简单小巧的DFX设计,对外提供log功能: + +- **以下以A模块为例说明如何添加模块并进行日志打印。** + 1. **第一步添加模块ID** + + 在interfaces/kits/hilog\_lite/hiview\_log.h的HiLogModuleDef中添加HILOG\_MODULE\_A定义。 + + ``` + typedef enum { + /** DFX */ + HILOG_MODULE_HIVIEW = 0, + /** System Module A */ + HILOG_MODULE_A, + /** Maximum number of modules */ + HILOG_MODULE_MAX + } HiLogModuleType; + ``` + + + 1. **第二步模块注册** + + 在A模块的初始化流程中添加如下代码,注册模块到日志框架中: + + ``` + HiLogRegisterModule(HILOG_MODULE_SAMGR, "A"); + ``` + + + 1. **第三步调整DFX框架静态配置** + + 根据需要调整 + + ``` + utils/lite/hiview_config.c + ``` + + 的g\_hiviewConfig全局参数配置。默认情况下不用修改,日志默认输出到串口。 + + + + + + + + + + + + + + + + + + + + + + +

配置项

+

取值及含义

+

outputOption

+

日志的输出方式。取值如下:

+

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

+

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

+

OUTPUT_OPTION_TEXT_FILE 日志输出为文本文件

+

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

+

level

+

日志的输出级别,仅输出大于等于该级别的日志。取值如下:

+

HILOG_LV_DEBUG/ HILOG_LV_INFO/ HILOG_LV_WARN/ HILOG_LV_ERROR/ HILOG_LV_FATAL

+

logSwitch

+

流水日志功能开关。编译前关闭不影响log组件初始化。默认打开。取值如下:

+

HIVIEW_FEATURE_ON/ HIVIEW_FEATURE_OFF

+

dumpSwitch

+

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

+

HIVIEW_FEATURE_ON/ HIVIEW_FEATURE_OFF

+

eventSwitch

+

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

+

HIVIEW_FEATURE_ON/ HIVIEW_FEATURE_OFF

+
+ + 2. **第四步日志打印** + + 在需要打印日志的.c文件中 \#include "log.h",调用如下接口: + + HILOG\_INFO\(HILOG\_MODULE\_SAMGR, “log test: %d”, 88\); + + 接口参数说明: + + + + + + + + + + + + + + + + + + + + + + + + +

参数名

+

是否必填

+

参数类型

+

参数说明

+

mod

+

+

uint8

+

模块\服务的ID。

+

统一规划分配,最大支持64个,其中第三方APP统一使用HILOG_MODULE_APP作为模块ID。

+

fmt

+

+

char *

+

格式化输出字符串。

+

1、 最大支持6个可变参数,不支持%s。

+

2、 格式化后的单条日志最大长度128字节,超过将无法打印。

+

可变参

+

+

int32

+

仅支持数字类型,最大支持6个变参。

+
+ + + +## 使用-featured框架 + +DFX featured框架提供完整的DFX特性,对外提供log接口: + +**Native C/C++**接口 + +hilog 可用API + +``` +HILOGD(fmt,...) HILOGI(fmt,...) HILOGW(fmt,...) HILOGE(fmt,...) +``` + +使用介绍 + +首先需要定义TAG,DOMAIN需要找DFT申请,未经申请的DOMAIN,日志打印不出来。 + +本地调试,可以临时使用domain数值 0。 + +包含头文件:\#include + +在BUILD.gn中添加依赖库 libhilog。 + +接口规则介绍: + +1. 格式化字符串默认是非隐私 HILOGI\("Hello World\\n"\); \>\> Hello World + +2. 格式化参数默认是隐私 HILOGI\("Age is %d\\n", 10\); \>\> Age is + +3. %\{private\}标识的参数是隐私 HILOGI\("Age is %\{private\}d\\n", 10\); \>\> Age is + +4. %\{public\}标识的参数是非隐私 HILOGI\("Age is %\{public\}d\\n", 10\); \>\>Age is 10 + +接口参数介绍 + + + + + + + + + + + + + + + + + + + + + + +

参数名字

+

参数含义

+

domain

+

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

+

tag

+

日志tag

+

isFmtPrivate

+

标识格式化字符串fmt是否是隐私,是yes时fmt会被认为是隐私

+

fmt

+

格式化字符串

+

args

+

格式化字符串参数

+
+ +**日志查看** + +1. debug版本hilog日志会保存到/storage/data/log/hilogs 目录下面。 + +2. 可以执行hilogcat实时查看hilog日志。 + + +**日志系统架构** + +![](http://tools.harmonyos.com/mirrors/hpm-image/hilog_m_README/figures/zh-cn_image_0000001052080708.png) + +1. hilogtask流水日志的内核任务。 + - 此功能是一个linux内核的任务或者线程,在系统启动时初始化。 + - 当内核中一个模块调用它的日志接口,将格式化好的日志内容传输给改任务,并将其存储在一个环形缓冲区中 。 + - 当用户态调用日志接口,将格式化好的日志内容通过ioctl调用写入驱动节点,驱动节点再将日志内容发送到hilogtask,hilogtask将日志内容存储到环形缓冲区中。 + +2. hilogcatd用户态日志存储服务。 + - 这是一个用户态的进程,负责定时将内核的ringbuffer读取出来,存储到日志文件中。 + - 日志文件输出支持gzip压缩,使用zlib + - 每个类型的ringbuffer分开存储。 + - 存储文件的单个文件大小,文件个数可在编译时配置。 + +3. hilogcat日志查看命令行工具。 + + 从内核驱动接口读取ringbuffer内容,输出到标准输出。 + +4. 支持日志缓冲区可配置。 + - 编译时可以配置日志缓冲区的大小。 + - 编译时可以指定日志缓冲区的类型,类型个数就是ringbuffer的个数。 + + +## 涉及仓 + +hiviewdfx\_frameworks\_hievent\_lite + +hiviewdfx\_frameworks\_ddrdump\_lite + +hiviewdfx\_frameworks\_hilog\_lite + +hiviewdfx\_interfaces\_innerkits\_hilog + +hiviewdfx\_interfaces\_innerkits\_hievent\_lite + +hiviewdfx\_interfaces\_kits\_hilog + +hiviewdfx\_interfaces\_kits\_hilog\_lite + +hiviewdfx\_services\_hiview\_lite + +hiviewdfx\_services\_hilogcat\_lite + +hiviewdfx\_utils\_lite + diff --git a/hilog_m/bundle.json b/hilog_m/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..dd04b4e8c667ad5fb143e8fc818897d6495f39a1 --- /dev/null +++ b/hilog_m/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/hilog_m", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "该仓库用于存放DFX框架的代码。主要包含DFR(可靠性)和DFT(可测试性)特性。-由于芯片平台资源有限,且硬件平台多样,因此需要针对不同硬件架构和资源提供组件化且可定制的DFX框架。根据RISC-V、Cortex-M、Cortex-A不同硬件平台,提供两种不同的轻量级DFX框架,以下简称mini、featured。-mini框架:针对处理架构为Cortex-M或同等处理能力的硬件平台,系统内存一般低于512KB,无文件系统或者仅提供一个可有限使用的轻量级文件系统,遵循CMSIS接口规范。featured框架:处理架构为Cortex-A或同等处理能力的硬件平台,内存资源大于512KB,文件系统完善,可存储大量数据,遵循POSIX接口规范。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/hiviewdfx &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "hilog" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-m", + "board": "hi3861" + } +} \ No newline at end of file diff --git a/hiview/LICENSE b/hiview/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/hiview/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/hiview/README.md b/hiview/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2064301d1f7f23143ed11d78a6da3efee5b5ff2e --- /dev/null +++ b/hiview/README.md @@ -0,0 +1,31 @@ +# Hiview介绍 + +## 简介 + +提供DFX子系统整体的初始化功能,控制各组件按需启动 + +## 架构 + +**图 1** Hivew架构流程图 +![](http://tools.harmonyos.com/mirrors/hpm-image/hiview_README/figures/Hivew架构流程图.png "Hivew架构流程图") + +DFX子系统初始化分为两个阶段:DEVICE\_INIT、CORE\_INIT。 + +DEVICE\_INIT阶段: + +1\) 初始化config模块,初始化DFX子系统核心配置参数(配置开启关闭dump\\event功能)。 + +2\) 初始化log组件,不能涉及内存动态分配、文件操作能力。 + +3\) 记录当前DFX子系统的状态信息到config中。 + +CORE\_INIT阶段: + +1\) 根据config的参数,按需初始化log、dump、event及对应的output组件。 + +2\) 该阶段内存管理、文件系统已经正常启动,可按需申请内存并创建文件。 + +静态预编译组件化: + +编译子系统提供统一的编译参数控制入口,DFX子系统根据配置后的预编译参数控制各组件是否参与编译,实现各组件预编译控制。 + diff --git a/hiview/bundle.json b/hiview/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..b2a027ddde63f63710354f9c6d57070a355bcd9e --- /dev/null +++ b/hiview/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/hiview", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "提供DFX子系统整体的初始化功能,控制各组件按需启动", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/hiviewdfx/services/hiview_lite&&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "hiview" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-m", + "board": "hi3861" + } +} \ No newline at end of file diff --git a/huks/LICENSE b/huks/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/huks/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/huks/README.md b/huks/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f0b9b793d8cc9b7da90cfdf561ba06f330f13e18 --- /dev/null +++ b/huks/README.md @@ -0,0 +1,12 @@ +# 项目介绍 + +## HUKS + +在分布式场景下,不同终端设备的硬件能力和运行系统环境都不尽相同,这些设备在分布式场景下,均需要建立信任关系,最典型的应用即是HiChain可信互联。那么就需要这样一个统一的密钥管理服务,来做到接口一致,密钥数据格式一致,同时提供业界标准的加解密算法实现。HUKS基于此来提供统一的密钥管理、加解密等能力。 + +HUKS模块整体分为北向接口,南向适配层,以及核心的功能模块: + +1. HUKS 北向接口:提供统一的对外API,用C语言实现,保持所有设备一致;主要包括密钥生成API、加解密API等; +2. HUKS Core Module:依赖HAL层,提供核心功能:加解密、签名验签、密钥存储等; +3. HUKS HAL层:屏蔽底层硬件和OS的差异,定义HUKS需要的统一底层API。主要包括平台算法库、IO和LOG等; + diff --git a/huks/bundle.json b/huks/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..2b98f665af223974fa02ad1bb102524dcddaf0d8 --- /dev/null +++ b/huks/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/huks", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "在分布式场景下,不同终端设备的硬件能力和运行系统环境都不尽相同,这些设备在分布式场景下,均需要建立信任关系,最典型的应用即是HiChain可信互联。那么就需要这样一个统一的密钥管理服务,来做到接口一致,密钥数据格式一致,同时提供业界标准的加解密算法实现。HUKS基于此来提供统一的密钥管理、加解密等能力。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/security &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "huks" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a,liteos-m", + "board": "hi3516,hi3518,hi3861" + } +} \ No newline at end of file diff --git a/iam/LICENSE b/iam/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/iam/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/iam/README.md b/iam/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7e6e92ec94defe395c2ff6cea3075c71779095da --- /dev/null +++ b/iam/README.md @@ -0,0 +1,98 @@ +# 项目介绍 + +## 应用权限管理 + +应用权限是软件用来访问系统资源和使用系统能力的一种通行方式,存在涉及个人隐私相关功能和数据的场景,例如:访问个人设备的硬件特性,如摄像头、麦克风,以及获取个人数据,如通讯录,日历等存储的信息等。鸿蒙OS通过应用权限管理来保护这些数据以及能力。 + +当三方开发者需要声明应用需要的权限时,需要在安装包内的HarmonyProfile.json的描述文件中编辑req-permissions,声明方式参考图1 + +**图 1** 权限声明 +![](http://tools.harmonyos.com/mirrors/hpm-image/iam_README/figures/权限声明.png "权限声明") + +字段说明: + + + + + + + + + + + + + + + + + + + + +

字段

+

取值

+

意义

+

name

+

字符串

+

权限名。

+

reason

+

多语言字符串id

+

应用申请此权限的目的。

+

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

+

used-scene{

+

ability,

+

when

+

}

+

ability:组件类名字符串

+

when:inuse, always

+

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

+

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

+
+ +## IPC通信鉴权 + +- 在Samgr中注册的系统服务如果通过进程间通信的方式暴露接口给其他进程访问,需要配置相应的访问控制策略。若不进行相关配置,访问会被拒绝。 +- 配置方式:在头文件base/security/services/iam\_lite/include/policy\_preset.h中配置访问策略。1. 定义各个Feature的策略 2. 将Feature的策略加到全局策略中 + +Eg. 比如当前需要为BMS服务配置访问策略,BMS在Samgr中注册的service为bundlems,注册的Feature为BmsFeature。 + +一、首先定义Feature的策略,可配置多个Feature,每个Feature可以配置多个访问策略,策略的声明方式参考图2 + +**图 2** Feature策略示例 +![](http://tools.harmonyos.com/mirrors/hpm-image/iam_README/figures/Feature策略示例.png "Feature策略示例") + +访问策略有三种类型: + +**图 3** 访问策略结构体 +![](http://tools.harmonyos.com/mirrors/hpm-image/iam_README/figures/访问策略结构体.png "访问策略结构体") + +1. type为RANGE类型:允许某个特定范围UID的进程访问,需要指定uidMin和uidMax + +2. type为FIXED类型:允许指定的几个UID的进程访问,需要指定fixedUid,最多配置8个 + +3. type为BUNDLENAME类型:只允许特定的应用访问,需要指定bundleName(包名) + +二、将定义的Feature的策略加配到全局策略中,需要配置feature数量,注册参考图4 + +**图 4** feature策略注册 +![](http://tools.harmonyos.com/mirrors/hpm-image/iam_README/figures/feature策略注册.png "feature策略注册") + +UID分配规则 + +1. Init/foundation进程:0 + +2. appspawn进程:1 + +3. Shell进程:2 + +4. kitfw进程:3 + +5. 其他内置服务向后递增…最多到99 + +6. 系统应用(如settings):100 \~ 999 + +7. 预置厂商应用(如钱包、淘宝):1000 \~ 9999 + +8. 普通三方应用:10000 \~ INT\_MAX + diff --git a/iam/bundle.json b/iam/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..5224229d113fcf490335f9ab1594eed0cb660705 --- /dev/null +++ b/iam/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/iam", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "应用权限是软件用来访问系统资源和使用系统能力的一种通行方式,存在涉及个人隐私相关功能和数据的场景,例如:访问个人设备的硬件特性,如摄像头、麦克风,以及获取个人数据,如通讯录,日历等存储的信息等。鸿蒙OS通过应用权限管理来保护这些数据以及能力。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/security &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "iam" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/iniparser/LICENSE b/iniparser/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/iniparser/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/iniparser/README.md b/iniparser/README.md new file mode 100644 index 0000000000000000000000000000000000000000..dbc30d0acbe62439b7ee51f9b9adf580c5f38dee --- /dev/null +++ b/iniparser/README.md @@ -0,0 +1,44 @@ +[![Build Status](https://travis-ci.org/ndevilla/iniparser.svg?branch=master)](https://travis-ci.org/ndevilla/iniparser) + +# Iniparser 4 # + + +## I - Overview + +This modules offers parsing of ini files from the C level. +See a complete documentation in HTML format, from this directory +open the file html/index.html with any HTML-capable browser. + +Key features : + + - Small : around 1500 sloc inside 4 files (2 .c and 2 .h) + - Portable : no dependancies, written in `-ansi -pedantic` C89 + - Fully reintrant : easy to make it thread-safe (just surround + library calls by mutex) + +## II - Building project + +A simple `make` at the root of the project should be enough to get the static +(i.e. `libiniparser.a`) and shared (i.e. `libiniparser.so.0`) libraries compiled. + +You should consider trying the following rules too : + + - `make check` : run the unitary tests + - `make example` : compile the example, run it with `./example/iniexample` + +## III - License + +This software is released under MIT License. +See LICENSE for full informations + +## IV - Versions + +Current version is 4.1. Version 4.0 introduces breaking changes in the api. +Older versions 3.1 and 3.2 with the legacy api are available as tags. + + +## V - FAQ + +See [FAQ-en.md](FAQ-en.md) in this directory for answers to Frequently Asked Questions. + +还有简化中国翻译在[FAQ-zhcn.md](FAQ-zhcn.md). diff --git a/iniparser/bundle.json b/iniparser/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..a54207256653f738827bef8e2146c7e1706b6b0a --- /dev/null +++ b/iniparser/bundle.json @@ -0,0 +1,25 @@ +{ + "name": "@ohos/iniparser", + "version": "1.8.0", + "description": "This modules offers parsing of ini files from the C level. See a complete documentation in HTML format, from this directory open the file html/index.html with any HTML-capable browser.", + "publishAs": "code-segment", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/iniparser && mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "iniparser" + ], + "envs": {}, + "author": {}, + "homepage": "", + "repository": "", + "license": "Apache V2", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/init/LICENSE b/init/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/init/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/init/README.md b/init/README.md new file mode 100644 index 0000000000000000000000000000000000000000..756145516b3094d8d88db26c67bcbb480e3ca458 --- /dev/null +++ b/init/README.md @@ -0,0 +1,86 @@ +# 启动引导模块 + +## 简介 + +启动引导模块,init进程,内核完成初始化后加载的第一个用户态进程,启动后解析/etc/init.cfg配置文件,并根据解析结果拉起其他系统关键进程,同时分别赋予其对应权限。 + +二进制文件部署在/bin/init。 + +## 目录 + +``` +base +├──startup 启动恢复子系统根目录 +└──── services + └── init_lite 启动引导模块 + ├── BUILD.gn 启动引导模块编译配置 + ├── include 启动引导模块头文件目录 + ├── LICENSE 开源LICENSE文件 + ├── moduletest 启动引导模块自测试代码目录 + └── src 启动引导模块源文件目录 +vendor +└──huawei + └──camera + └──init_configs 启动引导模块配置文件目录(json格式,部署于/etc/目录下) +``` + +## 约束 + +目前仅支持Hi3516DV300和Hi3518EV300版本。 + +## 启动引导模块配置文件 + +启动引导模块配置文件包含了所有需要由init进程启动的系统关键服务的服务名、可执行文件路径、权限和其他属性信息,该文件位于代码仓库/vendor/huawei/camera/init\_configs目录,部署在/etc/下,文件名称为init.cfg,采用json格式,文件大小目前限制在100KB以内。 + +init进程启动后首先读取/etc/init.cfg,然后解析其json内容,并根据解析结果依次加载系统服务。配置文件格式和内容说明如下所示: + +``` +{ + "jobs" : [{ + "name" : "pre-init", -------- 在init之前执行的job,可以放置一些启动进程之前的预操作(如新建文件夹等) + "cmds" : [ -------- 当前job支持的命令集合,命令名称(10字节以内)和后面参数(32字节以内)之间有且只能有一个空格 + "mkdir /testdir", -------- 创建文件夹命令,mkdir和目标文件夹之间有且只能有一个空格 + "chmod 0700 /testdir", -------- 修改权限命令,chmod 权限 目标 之间间隔有且仅有一个空格,权限必须为0xxx格式 + "chown 99 99 /testdir",-------- 修改属组命令,chown uid gid 目标 之间间隔有且仅有一个空格 + "mkdir /testdir2", + "mount vfat /dev/mmcblk0p0 /testdir2 noexec nosuid" -------- mount命令,格式为:mount 文件系统类型 source target flags data + -------- flags当前仅支持nodev、noexec、nosuid和rdonly,各项均以一个空格分开 + ] + }, { + "name" : "init", -------- job名称当前仅支持识别“pre-init”、“init”和“post-init” + "cmds" : [ -------- 单个job目前最多支持30条cmd + "start service1", -------- 启动服务命令1 + "start service2" -------- 启动服务命令2(可以根据需要调整命令在数组中的顺序,init进程将根据解析顺序依次执行) + ] + }, { + "name" : "post-init", -------- 在init之后执行的 job,可以放置一些启动进程之后的操作 + "cmds" : [] + } + ], + "services" : [{ -------- service集合(数组形式),包含了init进程需要启动的所有系统服务(当前最多支持100个服务) + "name" : "service1", -------- 当前服务的服务名,须确保非空且长度在32字节以内 + "path" : "/bin/process1" -------- 当前服务的可执行文件全路径,须确保非空且长度在64字节以内 + "uid" : 1, -------- 当前服务进程的uid值 + "gid" : 1, -------- 当前服务进程的gid值 + "once" : 0, -------- 当前服务进程是否为一次性进程 + 0 --- 当前服务非一次性进程,当进程因任何原因退出时,init收到SIGCHLD信号后将重新启动该服务进程 + 非0 --- 当前服务为一次性进程,当进程因任何原因退出时,init不会重新启动该服务进程 + "importance" : 1, -------- 当前服务是否为关键系统进程 + 0 --- 当前服务非关键系统进程,当进程因任何原因退出时,init不会做系统复位操作 + 非0 --- 当前服务为关键系统进程,当进程因任何原因退出时,init收到SIGCHLD信号后进行系统复位重启 + "caps" : [0, 1, 2, 5] -------- 当前服务所需的capability值,根据安全子系统已支持的capability,评估所需的capability,遵循最小权限原则配置(当前最多可配置100个值) + }, { + "name" : "service2", -------- 下一个需要init启动的服务。此处服务的顺序与启动顺序无关,启动顺序取决于上面job中的cmd顺序。 + "path" : "/bin/process2", + "uid" : 2, + "gid" : 2, + "once" : 1, + "importance" : 0, + "caps" : [ ] + } + ] +} +``` + +需要注意的是,init.cfg文件的修改需要保持json格式不被破坏,否则init进程解析失败后不会启动任何服务。对于配置的服务权限(uid/gid/capability)需要符合安全子系统要求且遵循权限最小原则。另外,对于once和importance项均为0的服务,若其在4分钟内连续退出次数超过4次,则init将终止重新启动该服务的操作。 + diff --git a/init/bundle.json b/init/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..d183ff8250159202192c15f0359b761b20e38913 --- /dev/null +++ b/init/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/init", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "启动引导模块,init进程,内核完成初始化后加载的第一个用户态进程,启动后解析/etc/init.cfg配置文件,并根据解析结果拉起其他系统关键进程,同时分别赋予其对应权限。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/startup/services/init_lite &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "init" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/iot_controller/LICENSE b/iot_controller/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/iot_controller/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/iot_controller/README.md b/iot_controller/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0d4405659b1398e828b4a57b81d6e64c274b9b53 --- /dev/null +++ b/iot_controller/README.md @@ -0,0 +1,46 @@ +# 项目介绍 + +## 简介 + +IoT外设控制模块提供对外围设备的操作能力。 + +本模块提供如下外围设备操作接口:ADC, AT, FLASH, GPIO, I2C, I2S, PARTITION, PWM, SDIO, UART, WATCHDOG等。 + +## 目录 + +**表 1** IoT外设控制模块源代码目录结构 + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

base/iot_hardware/interfaces/kits/wifiiot_lite

+

IoT外设控制模块接口

+

base/iot_hardware/frameworks/wifiiot_lite/src

+

IoT外设控制模块实现

+

base/iot_hardware/hals/wifiiot_lite

+

HAL适配层接口

+

vendor/hisi/hi3861/hi3861_adapter/hals/iot_hardware/wifiiot_lite

+

HAL适配层接口实现

+
+ +## 约束 + +IoT外设控制模块使用C语言编写,目前仅支持Hi3861开发板。 + diff --git a/iot_controller/bundle.json b/iot_controller/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..2c7c350aec5f4b5efeaa7b42af5676ec7c98bc84 --- /dev/null +++ b/iot_controller/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/iot_controller", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "IoT外设控制模块提供对外围设备的操作能力。本模块提供如下外围设备操作接口:ADC", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/iot_hardware &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "iot" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-m", + "board": "hi3861" + } +} \ No newline at end of file diff --git a/ipc/LICENSE b/ipc/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/ipc/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/ipc/README.md b/ipc/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b19c68985c8f093ce66b962bc6a2021aface8af1 --- /dev/null +++ b/ipc/README.md @@ -0,0 +1,4 @@ +# LiteIPC介绍 + +LiteIPC为轻量级进程间通信模块,为鸿蒙系统能力服务化提供基础的通信能力,分为内核实现和用户态framework实现两部分,其中内核实现完成进程间通信的主要工作,包括进程间消息收发、内存管理、权限检查、超时通知和死亡通知等功能;用户态则提供序列化和反序列化能力,并完成IPC回调消息和死亡消息的分发 + diff --git a/ipc/bundle.json b/ipc/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..e6bfbc18cb6101615016b49b8360fd32643ae09c --- /dev/null +++ b/ipc/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/ipc", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "LiteIPC为轻量级进程间通信模块,为鸿蒙系统能力服务化提供基础的通信能力,分为内核实现和用户态framework实现两部分,其中内核实现完成进程间通信的主要工作,包括进程间消息收发、内存管理、权限检查、超时通知和死亡通知等功能;用户态则提供序列化和反序列化能力,并完成IPC回调消息和死亡消息的分发", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/communication &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "ipc" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "foundation" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/jerryscript/LICENSE b/jerryscript/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/jerryscript/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/jerryscript/README.md b/jerryscript/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8211acdbfb06ea6ea4b4e69f6098934ca5008993 --- /dev/null +++ b/jerryscript/README.md @@ -0,0 +1,66 @@ +![](https://github.com/jerryscript-project/jerryscript/blob/master/LOGO.png) +# JerryScript: JavaScript engine for the Internet of Things +[![License](https://img.shields.io/badge/licence-Apache%202.0-brightgreen.svg?style=flat)](LICENSE) +[![Travis CI Build Status](https://travis-ci.org/jerryscript-project/jerryscript.svg?branch=master)](https://travis-ci.org/jerryscript-project/jerryscript) +[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/ct8reap35u2vooa5/branch/master?svg=true)](https://ci.appveyor.com/project/jerryscript-project/jerryscript/branch/master) +[![Coverity Scan Build Status](https://scan.coverity.com/projects/12127/badge.svg)](https://scan.coverity.com/projects/jerryscript-project) +[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fjerryscript-project%2Fjerryscript.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fjerryscript-project%2Fjerryscript?ref=badge_shield) +[![SonarQube](https://sonarcloud.io/api/project_badges/measure?project=jerryscript-project_jerryscript&metric=ncloc)](https://sonarcloud.io/dashboard?id=jerryscript-project_jerryscript) +[![IRC Channel](https://img.shields.io/badge/chat-on%20freenode-brightgreen.svg)](https://kiwiirc.com/client/irc.freenode.net/#jerryscript) + +JerryScript is a lightweight JavaScript engine for resource-constrained devices such as microcontrollers. It can run on devices with less than 64 KB of RAM and less than 200 KB of flash memory. + +Key characteristics of JerryScript: +* Full ECMAScript 5.1 standard compliance +* 160K binary size when compiled for ARM Thumb-2 +* Heavily optimized for low memory consumption +* Written in C99 for maximum portability +* Snapshot support for precompiling JavaScript source code to byte code +* Mature C API, easy to embed in applications + +Additional information can be found on our [project page](http://jerryscript.net) and [Wiki](https://github.com/jerryscript-project/jerryscript/wiki). + +Memory usage and Binary footprint are measured at [here](https://jerryscript-project.github.io/jerryscript-test-results) with real target daily. + +The following table shows the latest results on the devices: + +| STM32F4-Discovery | [![Remote Testrunner](https://firebasestorage.googleapis.com/v0/b/jsremote-testrunner.appspot.com/o/status%2Fjerryscript%2Fstm32f4dis.svg?alt=media&token=1)](https://jerryscript-project.github.io/jerryscript-test-results/?view=stm32f4dis) | +| :---: | :---: | +| **Raspberry Pi 2** | [![Remote Testrunner](https://firebasestorage.googleapis.com/v0/b/jsremote-testrunner.appspot.com/o/status%2Fjerryscript%2Frpi2.svg?alt=media&token=1)](https://jerryscript-project.github.io/jerryscript-test-results/?view=rpi2) | + +IRC channel: #jerryscript on [freenode](https://freenode.net) +Mailing list: jerryscript-dev@groups.io, you can subscribe [here](https://groups.io/g/jerryscript-dev) and access the mailing list archive [here](https://groups.io/g/jerryscript-dev/topics). + +## Quick Start +### Getting the sources +```bash +git clone https://github.com/jerryscript-project/jerryscript.git +cd jerryscript +``` + +### Building JerryScript +```bash +python tools/build.py +``` + +For additional information see [Getting Started](docs/00.GETTING-STARTED.md). + +## Documentation +- [Getting Started](docs/00.GETTING-STARTED.md) +- [Configuration](docs/01.CONFIGURATION.md) +- [API Reference](docs/02.API-REFERENCE.md) +- [API Example](docs/03.API-EXAMPLE.md) +- [Internals](docs/04.INTERNALS.md) +- [Migration Guide](docs/16.MIGRATION-GUIDE.md) + +## Contributing +The project can only accept contributions which are licensed under the [Apache License 2.0](LICENSE) and are signed according to the JerryScript [Developer's Certificate of Origin](DCO.md). For further information please see our [Contribution Guidelines](CONTRIBUTING.md). + +## License +JerryScript is open source software under the [Apache License 2.0](LICENSE). Complete license and copyright information can be found in the source code. + +[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fjerryscript-project%2Fjerryscript.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fjerryscript-project%2Fjerryscript?ref=badge_large) + +> Copyright JS Foundation and other contributors, http://js.foundation + +> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. diff --git a/jerryscript/bundle.json b/jerryscript/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..7a98ab859eb19ac4b481527bb99153bc215a2f7d --- /dev/null +++ b/jerryscript/bundle.json @@ -0,0 +1,24 @@ +{ + "name": "@ohos/jerryscript", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "JerryScript is the lightweight JavaScript engine intended to run on a very constrained devices such as microcontrollers.", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/jerryscript&&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "thirdparty", + "jerryscript" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/js_frameworks/LICENSE b/js_frameworks/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/js_frameworks/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/js_frameworks/README.md b/js_frameworks/README.md new file mode 100644 index 0000000000000000000000000000000000000000..08c8e68d20600c53bb73d483639c2baecce4199c --- /dev/null +++ b/js_frameworks/README.md @@ -0,0 +1,187 @@ +# JS应用开发框架 + +## 简介 + +JS应用开发框架,提供了一套跨平台的类web应用开发框架,通过Toolkit将开发者编写的HML、CSS和JS 文件编译打包成JS Bundle,然后再将JS Bundle解析运行成C++ UIKit的View 组件进行渲染。通过支持三方开发者使用声明式的API进行应用开发,以数据驱动视图变化,避免了大量的视图操作,大大降低了应用开发难度,提升开发者开发体验。 + +JS应用框架模块组成如下图所示: + +![](http://tools.harmonyos.com/mirrors/hpm-image/js_frameworks_README/figures/zh-cn_image_0000001052150927.png) + +## 目录 + +JS应用开发框架源代码在/foundation/ace下,目录结构如下图所示: + +``` +/foundation/ace +├── frameworks #框架代码 +│ └── lite +│ ├── examples #示例代码目录 +│ ├── include #部分跨子系统但仅部分平台暴露的头文件存放目录 +│ ├── packages #JS-Framework存放目录 +│ ├── src #源代码存放目录 +│ ├── targets #各目标设备配置文件存放目录 +│ └── tools #工具代码存放目录 +├── interfaces #头文件存放目录 +│ └── innerkits #对内部子系统暴露的头文件存放目录 +│ └── builtin # JS应用框架对外暴露JS三方module API接口存放目录 +``` + +## 约束 + +- 语言版本 + - C++11版本或以上 + - JavaScript ES5.1+ + + +- 框架运行内存通常分为如下组成部分: + - 1. 运行时引擎的预分配内存,该内存值可调,取决于具体设备应用复杂度,通常建议64K\~512K + - 2. 框架本身内存,在百K级的内存设备上,通常通过预分配一个内存池进行管理,可以和UIKit共用一个内存池,包含了对象和堆内存统一管理 + +- 框架针对不同的芯片平台和底层OS能力,规格有所区别 + - Cortex-M RAM/ROM: + - JS引擎内存池: 建议大于48K + - RAM:建议大于80K + - ROM: \> 300K (包含JS应用框架,UIKit及引擎等强相关子系统) + + - Cortex-A RAM/ROM: + - JS引擎内存池: 建议大于128K + - RAM:建议大于512K + - ROM:\> 2M (包含JS应用框架,UIKit及引擎等强相关子系统) + + + +## 使用**targets** + +JS应用框架实现主要包含两部分,native和JavaScript,native部分为C++,为框架的主体实现,JavaScript部分实现提供JS应用框架对用户JS文件的运行时支持,并通过向引擎暴露一些全局方法或对象,支撑JS运行时与native框架之间的交互。 + +JS应用框架通过一些特性宏来定制不同平台上参与编译的功能代码,该部分代码位于 foundation/ace/frameworks/lite/targets 目录下,目录结构如下: + +``` +/foundation/ace/frameworks/lite/targets +├── default/ +│ └── acelite_config.h +├── linux/ #linux环境配置文件目录 +│ └── acelite_config.h +├── liteos_a/ #LiteOS A核环境配置文件目录 +│ └── acelite_config.h +├── liteos_m/ #LiteOS M核环境配置文件目录 +│ └── acelite_config.h +├── platform_adapter.cpp +├── platform_adapter.h +└── simulator/ #模拟器环境配置文件目录 + └── win/ + └── acelite_config.h* +``` + +在编译不同的平台目标时,需要使用对应平台目录下的acelite\_config.h 头文件,这可以通过配置编译时的搜索路径来进行,以下以 ninja和cmake 构建工具为例进行示例: + +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" ] + } +``` + +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} + ...... +``` + +acelite\_config.h主要用于对应平台的特性宏开关,也可用来进行一些屏蔽平台差异的定义,如不同平台由于使用的文件系统不一致,可能存在一些固定目录路径名不一样的情况,这些有区别的常量可以放在这里进行定义,如下: + +liteos-a/acelite\_config.h + +``` +#define JS_FRAMEWORK_PATH "//system/ace/bin/" +``` + +simulator/win/acelite\_config.h + +``` +#define JS_FRAMEWORK_PATH "..\\..\\..\\jsfwk\\packages\\runtime-core\\build" +``` + +## 使用runtime-core + +为了实现单向数据绑定机制,JS应用框架使用JavaScript语言实现了一套简单的数据劫持框架,称之为runtime-core,目录结构如下所示: + +``` +/foundation/ace/frameworks/lite/packages +└── runtime-core + ├── .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配置文件 + ├── .size-snapshot.json + └── src #源代码 + ├── core #ViewModel核心实现目录 + │ └── index.js + ├── index.js + ├── observer #数据劫持部分代码实现目录 + │ ├── index.js + │ ├── observer.js + │ ├── subject.js + │ └── utils.js + ├── profiler #profiler目录 + │ └── index.js + └── __test__ #测试用例目录 + └── index.test.js +``` + +支持的NPM 命令有: + +- npm run build + + JS应用框架所集成的JS 引擎仅支持ES5.1语法,runtime-core源代码是使用ES6源码书写的。因此选择使用rollup做为打包工具,配合babel实现对JavaScript语法进行降级处理。只要命令行中执行命令npm run build,会在build目录下输出打包结果,输出结果如下所示: + + ``` + build/ + ├── framework-dev.js // 开发环境使用的框架代码(未压缩混淆) + ├── framework-dev.min.js // 开发环境使用的框架代码(已压缩混淆) + ├── framework.js // 生产环境使用的框架代码(未压缩混淆) + └── framework.min.js // 生产环境使用的框架代码(已压缩混淆) + ``` + +- npm run test + + runtime-core使用jest进行单元测试,在命令行中执行npm run test即可触发。 + + +## 涉及仓 + +ace\_lite\_jsfwk + +ace\_interfaces\_innerkits\_builtin + diff --git a/js_frameworks/bundle.json b/js_frameworks/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..1c6e811cbb413b4247c3734ead67366421625ec0 --- /dev/null +++ b/js_frameworks/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/js_frameworks", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "JS应用开发框架,提供了一套跨平台的类web应用开发框架,通过Toolkit将开发者编写的HML、CSS和JS 文件编译打包成JS Bundle,然后再将JS Bundle解析运行成C++ UIKit的View 组件进行渲染。通过支持三方开发者使用声明式的API进行应用开发,以数据驱动视图变化,避免了大量的视图操作,大大降低了应用开发难度,提升开发者开发体验。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/ace &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "jsframeworks" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "foundation" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516" + } +} \ No newline at end of file diff --git a/libjpeg/LICENSE b/libjpeg/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/libjpeg/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/libjpeg/README.md b/libjpeg/README.md new file mode 100644 index 0000000000000000000000000000000000000000..13b245c5ca867c4f9732ff1144c2369cb60e79a5 --- /dev/null +++ b/libjpeg/README.md @@ -0,0 +1,371 @@ +The Independent JPEG Group's JPEG software +========================================== + +README for release 9d of 12-Jan-2020 +==================================== + +This distribution contains the ninth public release of the Independent JPEG +Group's free JPEG software. You are welcome to redistribute this software and +to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. + +This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone, +Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson, +John Korejwa, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, +Ge' Weijers, and other members of the Independent JPEG Group. + +IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee +(previously known as JPEG, together with ITU-T SG16). + + +DOCUMENTATION ROADMAP +===================== + +This file contains the following sections: + +OVERVIEW General description of JPEG and the IJG software. +LEGAL ISSUES Copyright, lack of warranty, terms of distribution. +REFERENCES Where to learn more about JPEG. +ARCHIVE LOCATIONS Where to find newer versions of this software. +ACKNOWLEDGMENTS Special thanks. +FILE FORMAT WARS Software *not* to get. +TO DO Plans for future IJG releases. + +Other documentation files in the distribution are: + +User documentation: + install.txt How to configure and install the IJG software. + usage.txt Usage instructions for cjpeg, djpeg, jpegtran, + rdjpgcom, and wrjpgcom. + *.1 Unix-style man pages for programs (same info as usage.txt). + wizard.txt Advanced usage instructions for JPEG wizards only. + change.log Version-to-version change highlights. +Programmer and internal documentation: + libjpeg.txt How to use the JPEG library in your own programs. + example.c Sample code for calling the JPEG library. + structure.txt Overview of the JPEG library's internal structure. + filelist.txt Road map of IJG files. + coderules.txt Coding style rules --- please read if you contribute code. + +Please read at least the files install.txt and usage.txt. Some information +can also be found in the JPEG FAQ (Frequently Asked Questions) article. See +ARCHIVE LOCATIONS below to find out where to obtain the FAQ article. + +If you want to understand how the JPEG code works, we suggest reading one or +more of the REFERENCES, then looking at the documentation files (in roughly +the order listed) before diving into the code. + + +OVERVIEW +======== + +This package contains C software to implement JPEG image encoding, decoding, +and transcoding. JPEG (pronounced "jay-peg") is a standardized compression +method for full-color and grayscale images. + +This software implements JPEG baseline, extended-sequential, and progressive +compression processes. Provision is made for supporting all variants of these +processes, although some uncommon parameter settings aren't implemented yet. +We have made no provision for supporting the hierarchical or lossless +processes defined in the standard. + +We provide a set of library routines for reading and writing JPEG image files, +plus two sample applications "cjpeg" and "djpeg", which use the library to +perform conversion between JPEG and some other popular image file formats. +The library is intended to be reused in other applications. + +In order to support file conversion and viewing software, we have included +considerable functionality beyond the bare JPEG coding/decoding capability; +for example, the color quantization modules are not strictly part of JPEG +decoding, but they are essential for output to colormapped file formats or +colormapped displays. These extra functions can be compiled out of the +library if not required for a particular application. + +We have also included "jpegtran", a utility for lossless transcoding between +different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple +applications for inserting and extracting textual comments in JFIF files. + +The emphasis in designing this software has been on achieving portability and +flexibility, while also making it fast enough to be useful. In particular, +the software is not intended to be read as a tutorial on JPEG. (See the +REFERENCES section for introductory material.) Rather, it is intended to +be reliable, portable, industrial-strength code. We do not claim to have +achieved that goal in every aspect of the software, but we strive for it. + +We welcome the use of this software as a component of commercial products. +No royalty is required, but we do ask for an acknowledgement in product +documentation, as described under LEGAL ISSUES. + + +LEGAL ISSUES +============ + +In plain English: + +1. We don't promise that this software works. (But if you find any bugs, + please let us know!) +2. You can use this software for whatever you want. You don't have to pay us. +3. You may not pretend that you wrote this software. If you use it in a + program, you must acknowledge somewhere in your documentation that + you've used the IJG code. + +In legalese: + +The authors make NO WARRANTY or representation, either express or implied, +with respect to this software, its quality, accuracy, merchantability, or +fitness for a particular purpose. This software is provided "AS IS", and you, +its user, assume the entire risk as to its quality and accuracy. + +This software is copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding. +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this +software (or portions thereof) for any purpose, without fee, subject to these +conditions: +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice +unaltered; and any additions, deletions, or changes to the original files +must be clearly indicated in accompanying documentation. +(2) If only executable code is distributed, then the accompanying +documentation must state that "this software is based in part on the work of +the Independent JPEG Group". +(3) Permission for use of this software is granted only if the user accepts +full responsibility for any undesirable consequences; the authors accept +NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, +not just to the unmodified library. If you use our work, you ought to +acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name +in advertising or publicity relating to this software or products derived from +it. This software may be referred to only as "the Independent JPEG Group's +software". + +We specifically permit and encourage the use of this software as the basis of +commercial products, provided that all warranty or liability claims are +assumed by the product vendor. + + +The Unix configuration script "configure" was produced with GNU Autoconf. +It is copyright by the Free Software Foundation but is freely distributable. +The same holds for its supporting scripts (config.guess, config.sub, +ltmain.sh). Another support script, install-sh, is copyright by X Consortium +but is also freely distributable. + + +REFERENCES +========== + +We recommend reading one or more of these references before trying to +understand the innards of the JPEG software. + +The best short technical introduction to the JPEG compression algorithm is + Wallace, Gregory K. "The JPEG Still Picture Compression Standard", + Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44. +(Adjacent articles in that issue discuss MPEG motion picture compression, +applications of JPEG, and related topics.) If you don't have the CACM issue +handy, a PDF file containing a revised version of Wallace's article is +available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually +a preprint for an article that appeared in IEEE Trans. Consumer Electronics) +omits the sample images that appeared in CACM, but it includes corrections +and some added material. Note: the Wallace article is copyright ACM and IEEE, +and it may not be used for commercial purposes. + +A somewhat less technical, more leisurely introduction to JPEG can be found in +"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by +M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides +good explanations and example C code for a multitude of compression methods +including JPEG. It is an excellent source if you are comfortable reading C +code but don't know much about data compression in general. The book's JPEG +sample code is far from industrial-strength, but when you are ready to look +at a full implementation, you've got one here... + +The best currently available description of JPEG is the textbook "JPEG Still +Image Data Compression Standard" by William B. Pennebaker and Joan L. +Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. +Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG +standards (DIS 10918-1 and draft DIS 10918-2). +Although this is by far the most detailed and comprehensive exposition of +JPEG publicly available, we point out that it is still missing an explanation +of the most essential properties and algorithms of the underlying DCT +technology. +If you think that you know about DCT-based JPEG after reading this book, +then you are in delusion. The real fundamentals and corresponding potential +of DCT-based JPEG are not publicly known so far, and that is the reason for +all the mistaken developments taking place in the image coding domain. + +The original JPEG standard is divided into two parts, Part 1 being the actual +specification, while Part 2 covers compliance testing methods. Part 1 is +titled "Digital Compression and Coding of Continuous-tone Still Images, +Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS +10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of +Continuous-tone Still Images, Part 2: Compliance testing" and has document +numbers ISO/IEC IS 10918-2, ITU-T T.83. +IJG JPEG 8 introduced an implementation of the JPEG SmartScale extension +which is specified in two documents: A contributed document at ITU and ISO +with title "ITU-T JPEG-Plus Proposal for Extending ITU-T T.81 for Advanced +Image Coding", April 2006, Geneva, Switzerland. The latest version of this +document is Revision 3. And a contributed document ISO/IEC JTC1/SC29/WG1 N +5799 with title "Evolution of JPEG", June/July 2011, Berlin, Germany. +IJG JPEG 9 introduces a reversible color transform for improved lossless +compression which is described in a contributed document ISO/IEC JTC1/SC29/ +WG1 N 6080 with title "JPEG 9 Lossless Coding", June/July 2012, Paris, +France. + +The JPEG standard does not specify all details of an interchangeable file +format. For the omitted details we follow the "JFIF" conventions, version 2. +JFIF version 1 has been adopted as Recommendation ITU-T T.871 (05/2011) : +Information technology - Digital compression and coding of continuous-tone +still images: JPEG File Interchange Format (JFIF). It is available as a +free download in PDF file format from http://www.itu.int/rec/T-REC-T.871. +A PDF file of the older JFIF document is available at +http://www.w3.org/Graphics/JPEG/jfif3.pdf. + +The TIFF 6.0 file format specification can be obtained by FTP from +ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme +found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems. +IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6). +Instead, we recommend the JPEG design proposed by TIFF Technical Note #2 +(Compression tag 7). Copies of this Note can be obtained from +http://www.ijg.org/files/. It is expected that the next revision +of the TIFF spec will replace the 6.0 JPEG design with the Note's design. +Although IJG's own code does not support TIFF/JPEG, the free libtiff library +uses our library to implement TIFF/JPEG per the Note. + + +ARCHIVE LOCATIONS +================= + +The "official" archive site for this software is www.ijg.org. +The most recent released version can always be found there in +directory "files". This particular version will be archived as +http://www.ijg.org/files/jpegsrc.v9d.tar.gz, and in Windows-compatible +"zip" archive format as http://www.ijg.org/files/jpegsr9d.zip. + +The JPEG FAQ (Frequently Asked Questions) article is a source of some +general information about JPEG. +It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/ +and other news.answers archive sites, including the official news.answers +archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/. +If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu +with body + send usenet/news.answers/jpeg-faq/part1 + send usenet/news.answers/jpeg-faq/part2 + + +ACKNOWLEDGMENTS +=============== + +Thank to Juergen Bruder for providing me with a copy of the common DCT +algorithm article, only to find out that I had come to the same result +in a more direct and comprehensible way with a more generative approach. + +Thank to Istvan Sebestyen and Joan L. Mitchell for inviting me to the +ITU JPEG (Study Group 16) meeting in Geneva, Switzerland. + +Thank to Thomas Wiegand and Gary Sullivan for inviting me to the +Joint Video Team (MPEG & ITU) meeting in Geneva, Switzerland. + +Thank to Thomas Richter and Daniel Lee for inviting me to the +ISO/IEC JTC1/SC29/WG1 (previously known as JPEG, together with ITU-T SG16) +meeting in Berlin, Germany. + +Thank to John Korejwa and Massimo Ballerini for inviting me to +fruitful consultations in Boston, MA and Milan, Italy. + +Thank to Hendrik Elstner, Roland Fassauer, Simone Zuck, Guenther +Maier-Gerber, Walter Stoeber, Fred Schmitz, and Norbert Braunagel +for corresponding business development. + +Thank to Nico Zschach and Dirk Stelling of the technical support team +at the Digital Images company in Halle for providing me with extra +equipment for configuration tests. + +Thank to Richard F. Lyon (then of Foveon Inc.) for fruitful +communication about JPEG configuration in Sigma Photo Pro software. + +Thank to Andrew Finkenstadt for hosting the ijg.org site. + +Thank to Thomas G. Lane for the original design and development of +this singular software package. + +Thank to Lars Goehler, Andreas Heinecke, Sebastian Fuss, Yvonne Roebert, +Andrej Werner, and Ulf-Dietrich Braumann for support and public relations. + + +FILE FORMAT WARS +================ + +The ISO/IEC JTC1/SC29/WG1 standards committee (previously known as JPEG, +together with ITU-T SG16) currently promotes different formats containing +the name "JPEG" which is misleading because these formats are incompatible +with original DCT-based JPEG and are based on faulty technologies. +IJG therefore does not and will not support such momentary mistakes +(see REFERENCES). +There exist also distributions under the name "OpenJPEG" promoting such +kind of formats which is misleading because they don't support original +JPEG images. +We have no sympathy for the promotion of inferior formats. Indeed, one of +the original reasons for developing this free software was to help force +convergence on common, interoperable format standards for JPEG files. +Don't use an incompatible file format! +(In any case, our decoder will remain capable of reading existing JPEG +image files indefinitely.) + +The ISO committee pretends to be "responsible for the popular JPEG" in their +public reports which is not true because they don't respond to actual +requirements for the maintenance of the original JPEG specification. +Furthermore, the ISO committee pretends to "ensure interoperability" with +their standards which is not true because their "standards" support only +application-specific and proprietary use cases and contain mathematically +incorrect code. + +There are currently different distributions in circulation containing the +name "libjpeg" which is misleading because they don't have the features and +are incompatible with formats supported by actual IJG libjpeg distributions. +One of those fakes is released by members of the ISO committee and just uses +the name of libjpeg for misdirection of people, similar to the abuse of the +name JPEG as described above, while having nothing in common with actual IJG +libjpeg distributions and containing mathematically incorrect code. +The other one claims to be a "derivative" or "fork" of the original libjpeg, +but violates the license conditions as described under LEGAL ISSUES above +and violates basic C programming properties. +We have no sympathy for the release of misleading, incorrect and illegal +distributions derived from obsolete code bases. +Don't use an obsolete code base! + +According to the UCC (Uniform Commercial Code) law, IJG has the lawful and +legal right to foreclose on certain standardization bodies and other +institutions or corporations that knowingly perform substantial and +systematic deceptive acts and practices, fraud, theft, and damaging of the +value of the people of this planet without their knowing, willing and +intentional consent. +The titles, ownership, and rights of these institutions and all their assets +are now duly secured and held in trust for the free people of this planet. +People of the planet, on every country, may have a financial interest in +the assets of these former principals, agents, and beneficiaries of the +foreclosed institutions and corporations. +IJG asserts what is: that each man, woman, and child has unalienable value +and rights granted and deposited in them by the Creator and not any one of +the people is subordinate to any artificial principality, corporate fiction +or the special interest of another without their appropriate knowing, +willing and intentional consent made by contract or accommodation agreement. +IJG expresses that which already was. +The people have already determined and demanded that public administration +entities, national governments, and their supporting judicial systems must +be fully transparent, accountable, and liable. +IJG has secured the value for all concerned free people of the planet. + +A partial list of foreclosed institutions and corporations ("Hall of Shame") +is currently prepared and will be published later. + + +TO DO +===== + +Version 9 is the second release of a new generation JPEG standard +to overcome the limitations of the original JPEG specification, +and is the first true source reference JPEG codec. +More features are being prepared for coming releases... + +Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org. diff --git a/libjpeg/bundle.json b/libjpeg/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..78328c8b14337ed0a167be87850331dee37ec00c --- /dev/null +++ b/libjpeg/bundle.json @@ -0,0 +1,24 @@ +{ + "name": "@ohos/libjpeg", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "IJG is an informal group that writes and distributes a widely used free library for JPEG image compression", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/libjpeg&&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "thirdparty", + "libjpeg" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/libpng/LICENSE b/libpng/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/libpng/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/libpng/README.md b/libpng/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cfc1f0e3dc97d09389157b282a4a77ca0aabc5c3 --- /dev/null +++ b/libpng/README.md @@ -0,0 +1,183 @@ +README for libpng version 1.6.37 - April 14, 2019 +================================================= + +See the note about version numbers near the top of png.h. +See INSTALL for instructions on how to install libpng. + +Libpng comes in several distribution formats. Get libpng-*.tar.gz or +libpng-*.tar.xz or if you want UNIX-style line endings in the text +files, or lpng*.7z or lpng*.zip if you want DOS-style line endings. + +Version 0.89 was the first official release of libpng. Don't let the +fact that it's the first release fool you. The libpng library has been +in extensive use and testing since mid-1995. By late 1997 it had +finally gotten to the stage where there hadn't been significant +changes to the API in some time, and people have a bad feeling about +libraries with versions < 1.0. Version 1.0.0 was released in +March 1998. + +**** +Note that some of the changes to the png_info structure render this +version of the library binary incompatible with libpng-0.89 or +earlier versions if you are using a shared library. The type of the +"filler" parameter for png_set_filler() has changed from png_byte to +png_uint_32, which will affect shared-library applications that use +this function. + +To avoid problems with changes to the internals of the png info_struct, +new APIs have been made available in 0.95 to avoid direct application +access to info_ptr. These functions are the png_set_ and +png_get_ functions. These functions should be used when +accessing/storing the info_struct data, rather than manipulating it +directly, to avoid such problems in the future. + +It is important to note that the APIs did not make current programs +that access the info struct directly incompatible with the new +library, through libpng-1.2.x. In libpng-1.4.x, which was meant to +be a transitional release, members of the png_struct and the +info_struct can still be accessed, but the compiler will issue a +warning about deprecated usage. Since libpng-1.5.0, direct access +to these structs is not allowed, and the definitions of the structs +reside in private pngstruct.h and pnginfo.h header files that are not +accessible to applications. It is strongly suggested that new +programs use the new APIs (as shown in example.c and pngtest.c), and +older programs be converted to the new format, to facilitate upgrades +in the future. +**** + +Additions since 0.90 include the ability to compile libpng as a +Windows DLL, and new APIs for accessing data in the info struct. +Experimental functions include the ability to set weighting and cost +factors for row filter selection, direct reads of integers from buffers +on big-endian processors that support misaligned data access, faster +methods of doing alpha composition, and more accurate 16->8 bit color +conversion. + +The additions since 0.89 include the ability to read from a PNG stream +which has had some (or all) of the signature bytes read by the calling +application. This also allows the reading of embedded PNG streams that +do not have the PNG file signature. As well, it is now possible to set +the library action on the detection of chunk CRC errors. It is possible +to set different actions based on whether the CRC error occurred in a +critical or an ancillary chunk. + +For a detailed description on using libpng, read libpng-manual.txt. +For examples of libpng in a program, see example.c and pngtest.c. For +usage information and restrictions (what little they are) on libpng, +see png.h. For a description on using zlib (the compression library +used by libpng) and zlib's restrictions, see zlib.h + +I have included a general makefile, as well as several machine and +compiler specific ones, but you may have to modify one for your own +needs. + +You should use zlib 1.0.4 or later to run this, but it MAY work with +versions as old as zlib 0.95. Even so, there are bugs in older zlib +versions which can cause the output of invalid compression streams for +some images. + +You should also note that zlib is a compression library that is useful +for more things than just PNG files. You can use zlib as a drop-in +replacement for fread() and fwrite(), if you are so inclined. + +zlib should be available at the same place that libpng is, or at +https://zlib.net. + +You may also want a copy of the PNG specification. It is available +as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find +these at http://www.libpng.org/pub/png/pngdocs.html . + +This code is currently being archived at libpng.sourceforge.io in the +[DOWNLOAD] area, and at http://libpng.download/src . + +This release, based in a large way on Glenn's, Guy's and Andreas' +earlier work, was created and will be supported by myself and the PNG +development group. + +Send comments/corrections/commendations to png-mng-implement at +lists.sourceforge.net (subscription required; visit +https://lists.sourceforge.net/lists/listinfo/png-mng-implement +to subscribe). + +Send general questions about the PNG specification to png-mng-misc +at lists.sourceforge.net (subscription required; visit +https://lists.sourceforge.net/lists/listinfo/png-mng-misc to +subscribe). + +Files in this distribution: + + ANNOUNCE => Announcement of this version, with recent changes + AUTHORS => List of contributing authors + CHANGES => Description of changes between libpng versions + KNOWNBUG => List of known bugs and deficiencies + LICENSE => License to use and redistribute libpng + README => This file + TODO => Things not implemented in the current library + TRADEMARK => Trademark information + example.c => Example code for using libpng functions + libpng.3 => manual page for libpng (includes libpng-manual.txt) + libpng-manual.txt => Description of libpng and its functions + libpngpf.3 => manual page for libpng's private functions + png.5 => manual page for the PNG format + png.c => Basic interface functions common to library + png.h => Library function and interface declarations (public) + pngpriv.h => Library function and interface declarations (private) + pngconf.h => System specific library configuration (public) + pngstruct.h => png_struct declaration (private) + pnginfo.h => png_info struct declaration (private) + pngdebug.h => debugging macros (private) + pngerror.c => Error/warning message I/O functions + pngget.c => Functions for retrieving info from struct + pngmem.c => Memory handling functions + pngbar.png => PNG logo, 88x31 + pngnow.png => PNG logo, 98x31 + pngpread.c => Progressive reading functions + pngread.c => Read data/helper high-level functions + pngrio.c => Lowest-level data read I/O functions + pngrtran.c => Read data transformation functions + pngrutil.c => Read data utility functions + pngset.c => Functions for storing data into the info_struct + pngtest.c => Library test program + pngtest.png => Library test sample image + pngtrans.c => Common data transformation functions + pngwio.c => Lowest-level write I/O functions + pngwrite.c => High-level write functions + pngwtran.c => Write data transformations + pngwutil.c => Write utility functions + arm => Contains optimized code for the ARM platform + powerpc => Contains optimized code for the PowerPC platform + contrib => Contributions + arm-neon => Optimized code for ARM-NEON platform + powerpc-vsx => Optimized code for POWERPC-VSX platform + examples => Example programs + gregbook => source code for PNG reading and writing, from + Greg Roelofs' "PNG: The Definitive Guide", + O'Reilly, 1999 + libtests => Test programs + mips-msa => Optimized code for MIPS-MSA platform + pngminim => Minimal decoder, encoder, and progressive decoder + programs demonstrating use of pngusr.dfa + pngminus => Simple pnm2png and png2pnm programs + pngsuite => Test images + testpngs + tools => Various tools + visupng => Contains a MSVC workspace for VisualPng + intel => Optimized code for INTEL-SSE2 platform + mips => Optimized code for MIPS platform + projects => Contains project files and workspaces for + building a DLL + owatcom => Contains a WATCOM project for building libpng + visualc71 => Contains a Microsoft Visual C++ (MSVC) + workspace for building libpng and zlib + vstudio => Contains a Microsoft Visual C++ (MSVC) + workspace for building libpng and zlib + scripts => Directory containing scripts for building libpng: + (see scripts/README.txt for the list of scripts) + +Good luck, and happy coding! + + * Cosmin Truta (current maintainer, since 2018) + * Glenn Randers-Pehrson (former maintainer, 1998-2018) + * Andreas Eric Dilger (former maintainer, 1996-1997) + * Guy Eric Schalnat (original author and former maintainer, 1995-1996) + (formerly of Group 42, Inc.) diff --git a/libpng/bundle.json b/libpng/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..4461d39890001b292dd8e9bacfa418b481d3d481 --- /dev/null +++ b/libpng/bundle.json @@ -0,0 +1,24 @@ +{ + "name": "@ohos/libpng", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "Reference library for supporting the Portable Network Graphics (PNG) format.", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/libpng&&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "thirdparty", + "libpng" + ], + "license": "Apache V2", + "repository": "", + "homepage": "http://www.libpng.org/pub/png/libpng.html", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/linux_kernel/LICENSE b/linux_kernel/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/linux_kernel/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/linux_kernel/README.md b/linux_kernel/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f4756ee1c918eada0f011f198c10cd8b9942e184 --- /dev/null +++ b/linux_kernel/README.md @@ -0,0 +1,404 @@ + Linux kernel release 4.x + +These are the release notes for Linux version 4. Read them carefully, +as they tell you what this is all about, explain how to install the +kernel, and what to do if something goes wrong. + +WHAT IS LINUX? + + Linux is a clone of the operating system Unix, written from scratch by + Linus Torvalds with assistance from a loosely-knit team of hackers across + the Net. It aims towards POSIX and Single UNIX Specification compliance. + + It has all the features you would expect in a modern fully-fledged Unix, + including true multitasking, virtual memory, shared libraries, demand + loading, shared copy-on-write executables, proper memory management, + and multistack networking including IPv4 and IPv6. + + It is distributed under the GNU General Public License - see the + accompanying COPYING file for more details. + +ON WHAT HARDWARE DOES IT RUN? + + Although originally developed first for 32-bit x86-based PCs (386 or higher), + today Linux also runs on (at least) the Compaq Alpha AXP, Sun SPARC and + UltraSPARC, Motorola 68000, PowerPC, PowerPC64, ARM, Hitachi SuperH, Cell, + IBM S/390, MIPS, HP PA-RISC, Intel IA-64, DEC VAX, AMD x86-64, AXIS CRIS, + Xtensa, Tilera TILE, AVR32, ARC and Renesas M32R architectures. + + Linux is easily portable to most general-purpose 32- or 64-bit architectures + as long as they have a paged memory management unit (PMMU) and a port of the + GNU C compiler (gcc) (part of The GNU Compiler Collection, GCC). Linux has + also been ported to a number of architectures without a PMMU, although + functionality is then obviously somewhat limited. + Linux has also been ported to itself. You can now run the kernel as a + userspace application - this is called UserMode Linux (UML). + +DOCUMENTATION: + + - There is a lot of documentation available both in electronic form on + the Internet and in books, both Linux-specific and pertaining to + general UNIX questions. I'd recommend looking into the documentation + subdirectories on any Linux FTP site for the LDP (Linux Documentation + Project) books. This README is not meant to be documentation on the + system: there are much better sources available. + + - There are various README files in the Documentation/ subdirectory: + these typically contain kernel-specific installation notes for some + drivers for example. See Documentation/00-INDEX for a list of what + is contained in each file. Please read the Changes file, as it + contains information about the problems, which may result by upgrading + your kernel. + + - The Documentation/DocBook/ subdirectory contains several guides for + kernel developers and users. These guides can be rendered in a + number of formats: PostScript (.ps), PDF, HTML, & man-pages, among others. + After installation, "make psdocs", "make pdfdocs", "make htmldocs", + or "make mandocs" will render the documentation in the requested format. + +INSTALLING the kernel source: + + - If you install the full sources, put the kernel tarball in a + directory where you have permissions (eg. your home directory) and + unpack it: + + xz -cd linux-4.X.tar.xz | tar xvf - + + Replace "X" with the version number of the latest kernel. + + Do NOT use the /usr/src/linux area! This area has a (usually + incomplete) set of kernel headers that are used by the library header + files. They should match the library, and not get messed up by + whatever the kernel-du-jour happens to be. + + - You can also upgrade between 4.x releases by patching. Patches are + distributed in the xz format. To install by patching, get all the + newer patch files, enter the top level directory of the kernel source + (linux-4.X) and execute: + + xz -cd ../patch-4.x.xz | patch -p1 + + Replace "x" for all versions bigger than the version "X" of your current + source tree, _in_order_, and you should be ok. You may want to remove + the backup files (some-file-name~ or some-file-name.orig), and make sure + that there are no failed patches (some-file-name# or some-file-name.rej). + If there are, either you or I have made a mistake. + + Unlike patches for the 4.x kernels, patches for the 4.x.y kernels + (also known as the -stable kernels) are not incremental but instead apply + directly to the base 4.x kernel. For example, if your base kernel is 4.0 + and you want to apply the 4.0.3 patch, you must not first apply the 4.0.1 + and 4.0.2 patches. Similarly, if you are running kernel version 4.0.2 and + want to jump to 4.0.3, you must first reverse the 4.0.2 patch (that is, + patch -R) _before_ applying the 4.0.3 patch. You can read more on this in + Documentation/applying-patches.txt + + Alternatively, the script patch-kernel can be used to automate this + process. It determines the current kernel version and applies any + patches found. + + linux/scripts/patch-kernel linux + + The first argument in the command above is the location of the + kernel source. Patches are applied from the current directory, but + an alternative directory can be specified as the second argument. + + - Make sure you have no stale .o files and dependencies lying around: + + cd linux + make mrproper + + You should now have the sources correctly installed. + +SOFTWARE REQUIREMENTS + + Compiling and running the 4.x kernels requires up-to-date + versions of various software packages. Consult + Documentation/Changes for the minimum version numbers required + and how to get updates for these packages. Beware that using + excessively old versions of these packages can cause indirect + errors that are very difficult to track down, so don't assume that + you can just update packages when obvious problems arise during + build or operation. + +BUILD directory for the kernel: + + When compiling the kernel, all output files will per default be + stored together with the kernel source code. + Using the option "make O=output/dir" allow you to specify an alternate + place for the output files (including .config). + Example: + + kernel source code: /usr/src/linux-4.X + build directory: /home/name/build/kernel + + To configure and build the kernel, use: + + cd /usr/src/linux-4.X + make O=/home/name/build/kernel menuconfig + make O=/home/name/build/kernel + sudo make O=/home/name/build/kernel modules_install install + + Please note: If the 'O=output/dir' option is used, then it must be + used for all invocations of make. + +CONFIGURING the kernel: + + Do not skip this step even if you are only upgrading one minor + version. New configuration options are added in each release, and + odd problems will turn up if the configuration files are not set up + as expected. If you want to carry your existing configuration to a + new version with minimal work, use "make oldconfig", which will + only ask you for the answers to new questions. + + - Alternative configuration commands are: + + "make config" Plain text interface. + + "make menuconfig" Text based color menus, radiolists & dialogs. + + "make nconfig" Enhanced text based color menus. + + "make xconfig" X windows (Qt) based configuration tool. + + "make gconfig" X windows (GTK+) based configuration tool. + + "make oldconfig" Default all questions based on the contents of + your existing ./.config file and asking about + new config symbols. + + "make silentoldconfig" + Like above, but avoids cluttering the screen + with questions already answered. + Additionally updates the dependencies. + + "make olddefconfig" + Like above, but sets new symbols to their default + values without prompting. + + "make defconfig" Create a ./.config file by using the default + symbol values from either arch/$ARCH/defconfig + or arch/$ARCH/configs/${PLATFORM}_defconfig, + depending on the architecture. + + "make ${PLATFORM}_defconfig" + Create a ./.config file by using the default + symbol values from + arch/$ARCH/configs/${PLATFORM}_defconfig. + Use "make help" to get a list of all available + platforms of your architecture. + + "make allyesconfig" + Create a ./.config file by setting symbol + values to 'y' as much as possible. + + "make allmodconfig" + Create a ./.config file by setting symbol + values to 'm' as much as possible. + + "make allnoconfig" Create a ./.config file by setting symbol + values to 'n' as much as possible. + + "make randconfig" Create a ./.config file by setting symbol + values to random values. + + "make localmodconfig" Create a config based on current config and + loaded modules (lsmod). Disables any module + option that is not needed for the loaded modules. + + To create a localmodconfig for another machine, + store the lsmod of that machine into a file + and pass it in as a LSMOD parameter. + + target$ lsmod > /tmp/mylsmod + target$ scp /tmp/mylsmod host:/tmp + + host$ make LSMOD=/tmp/mylsmod localmodconfig + + The above also works when cross compiling. + + "make localyesconfig" Similar to localmodconfig, except it will convert + all module options to built in (=y) options. + + You can find more information on using the Linux kernel config tools + in Documentation/kbuild/kconfig.txt. + + - NOTES on "make config": + + - Having unnecessary drivers will make the kernel bigger, and can + under some circumstances lead to problems: probing for a + nonexistent controller card may confuse your other controllers + + - Compiling the kernel with "Processor type" set higher than 386 + will result in a kernel that does NOT work on a 386. The + kernel will detect this on bootup, and give up. + + - A kernel with math-emulation compiled in will still use the + coprocessor if one is present: the math emulation will just + never get used in that case. The kernel will be slightly larger, + but will work on different machines regardless of whether they + have a math coprocessor or not. + + - The "kernel hacking" configuration details usually result in a + bigger or slower kernel (or both), and can even make the kernel + less stable by configuring some routines to actively try to + break bad code to find kernel problems (kmalloc()). Thus you + should probably answer 'n' to the questions for "development", + "experimental", or "debugging" features. + +COMPILING the kernel: + + - Make sure you have at least gcc 3.2 available. + For more information, refer to Documentation/Changes. + + Please note that you can still run a.out user programs with this kernel. + + - Do a "make" to create a compressed kernel image. It is also + possible to do "make install" if you have lilo installed to suit the + kernel makefiles, but you may want to check your particular lilo setup first. + + To do the actual install, you have to be root, but none of the normal + build should require that. Don't take the name of root in vain. + + - If you configured any of the parts of the kernel as `modules', you + will also have to do "make modules_install". + + - Verbose kernel compile/build output: + + Normally, the kernel build system runs in a fairly quiet mode (but not + totally silent). However, sometimes you or other kernel developers need + to see compile, link, or other commands exactly as they are executed. + For this, use "verbose" build mode. This is done by inserting + "V=1" in the "make" command. E.g.: + + make V=1 all + + To have the build system also tell the reason for the rebuild of each + target, use "V=2". The default is "V=0". + + - Keep a backup kernel handy in case something goes wrong. This is + especially true for the development releases, since each new release + contains new code which has not been debugged. Make sure you keep a + backup of the modules corresponding to that kernel, as well. If you + are installing a new kernel with the same version number as your + working kernel, make a backup of your modules directory before you + do a "make modules_install". + + Alternatively, before compiling, use the kernel config option + "LOCALVERSION" to append a unique suffix to the regular kernel version. + LOCALVERSION can be set in the "General Setup" menu. + + - In order to boot your new kernel, you'll need to copy the kernel + image (e.g. .../linux/arch/i386/boot/bzImage after compilation) + to the place where your regular bootable kernel is found. + + - Booting a kernel directly from a floppy without the assistance of a + bootloader such as LILO, is no longer supported. + + If you boot Linux from the hard drive, chances are you use LILO, which + uses the kernel image as specified in the file /etc/lilo.conf. The + kernel image file is usually /vmlinuz, /boot/vmlinuz, /bzImage or + /boot/bzImage. To use the new kernel, save a copy of the old image + and copy the new image over the old one. Then, you MUST RERUN LILO + to update the loading map!! If you don't, you won't be able to boot + the new kernel image. + + Reinstalling LILO is usually a matter of running /sbin/lilo. + You may wish to edit /etc/lilo.conf to specify an entry for your + old kernel image (say, /vmlinux.old) in case the new one does not + work. See the LILO docs for more information. + + After reinstalling LILO, you should be all set. Shutdown the system, + reboot, and enjoy! + + If you ever need to change the default root device, video mode, + ramdisk size, etc. in the kernel image, use the 'rdev' program (or + alternatively the LILO boot options when appropriate). No need to + recompile the kernel to change these parameters. + + - Reboot with the new kernel and enjoy. + +IF SOMETHING GOES WRONG: + + - If you have problems that seem to be due to kernel bugs, please check + the file MAINTAINERS to see if there is a particular person associated + with the part of the kernel that you are having trouble with. If there + isn't anyone listed there, then the second best thing is to mail + them to me (torvalds@linux-foundation.org), and possibly to any other + relevant mailing-list or to the newsgroup. + + - In all bug-reports, *please* tell what kernel you are talking about, + how to duplicate the problem, and what your setup is (use your common + sense). If the problem is new, tell me so, and if the problem is + old, please try to tell me when you first noticed it. + + - If the bug results in a message like + + unable to handle kernel paging request at address C0000010 + Oops: 0002 + EIP: 0010:XXXXXXXX + eax: xxxxxxxx ebx: xxxxxxxx ecx: xxxxxxxx edx: xxxxxxxx + esi: xxxxxxxx edi: xxxxxxxx ebp: xxxxxxxx + ds: xxxx es: xxxx fs: xxxx gs: xxxx + Pid: xx, process nr: xx + xx xx xx xx xx xx xx xx xx xx + + or similar kernel debugging information on your screen or in your + system log, please duplicate it *exactly*. The dump may look + incomprehensible to you, but it does contain information that may + help debugging the problem. The text above the dump is also + important: it tells something about why the kernel dumped code (in + the above example, it's due to a bad kernel pointer). More information + on making sense of the dump is in Documentation/oops-tracing.txt + + - If you compiled the kernel with CONFIG_KALLSYMS you can send the dump + as is, otherwise you will have to use the "ksymoops" program to make + sense of the dump (but compiling with CONFIG_KALLSYMS is usually preferred). + This utility can be downloaded from + ftp://ftp..kernel.org/pub/linux/utils/kernel/ksymoops/ . + Alternatively, you can do the dump lookup by hand: + + - In debugging dumps like the above, it helps enormously if you can + look up what the EIP value means. The hex value as such doesn't help + me or anybody else very much: it will depend on your particular + kernel setup. What you should do is take the hex value from the EIP + line (ignore the "0010:"), and look it up in the kernel namelist to + see which kernel function contains the offending address. + + To find out the kernel function name, you'll need to find the system + binary associated with the kernel that exhibited the symptom. This is + the file 'linux/vmlinux'. To extract the namelist and match it against + the EIP from the kernel crash, do: + + nm vmlinux | sort | less + + This will give you a list of kernel addresses sorted in ascending + order, from which it is simple to find the function that contains the + offending address. Note that the address given by the kernel + debugging messages will not necessarily match exactly with the + function addresses (in fact, that is very unlikely), so you can't + just 'grep' the list: the list will, however, give you the starting + point of each kernel function, so by looking for the function that + has a starting address lower than the one you are searching for but + is followed by a function with a higher address you will find the one + you want. In fact, it may be a good idea to include a bit of + "context" in your problem report, giving a few lines around the + interesting one. + + If you for some reason cannot do the above (you have a pre-compiled + kernel image or similar), telling me as much about your setup as + possible will help. Please read the REPORTING-BUGS document for details. + + - Alternatively, you can use gdb on a running kernel. (read-only; i.e. you + cannot change values or set break points.) To do this, first compile the + kernel with -g; edit arch/i386/Makefile appropriately, then do a "make + clean". You'll also need to enable CONFIG_PROC_FS (via "make config"). + + After you've rebooted with the new kernel, do "gdb vmlinux /proc/kcore". + You can now use all the usual gdb commands. The command to look up the + point where your system crashed is "l *0xXXXXXXXX". (Replace the XXXes + with the EIP value.) + + gdb'ing a non-running kernel currently fails because gdb (wrongly) + disregards the starting offset for which the kernel is compiled. + diff --git a/linux_kernel/bundle.json b/linux_kernel/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..84e037d5b494410ca8721a3304313f46c218e3fc --- /dev/null +++ b/linux_kernel/bundle.json @@ -0,0 +1,24 @@ +{ + "name": "@ohos/linux_kernel", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "linux_kernel", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/Linux_Kernel &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "thirdparty", + "linuxkernel" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/liteos_a/LICENSE b/liteos_a/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/liteos_a/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/liteos_a/README.md b/liteos_a/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ac9db5e58fb19fec2b4d3648b1e5c4a16ffe2e3d --- /dev/null +++ b/liteos_a/README.md @@ -0,0 +1,105 @@ +# 内核子系统 + +## 简介 + +OpenHarmony内核是华为推出的面向IoT领域的实时操作系统内核,它具备类似RTOS般轻快和Linux般易用的特点。 + +这个仓库用于存放OpenHarmony内核的源代码。包括功能组件部分:进程和线程调度、内存管理、IPC机制、timer管理等操作系统基础组件,版本包编译信息。 + +## 目录 + +**表 1** OpenHarmony轻内核源代码目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

apps

+

用户态的init和shell应用程序。

+

arch

+

体系架构的目录,如arm等。

+

bsd

+

freebsd相关的驱动和适配层模块代码引入,例如USB等。

+

compat

+

内核posix接口的兼容。

+

fs

+

文件系统模块,主要来源于NuttX开源项目。

+

kernel

+

进程、内存、IPC等模块。

+

lib

+

内核的lib库。

+

net

+

网络模块,主要来源于lwip开源项目。

+

platform

+

支持不同的芯片平台代码,如Hi3516DV300等。

+

security

+

安全特性相关的代码,包括进程权限管理和虚拟id映射管理。

+

syscall

+

系统调用。

+

test

+

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

+

tools

+

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

+
+ +## 约束 + +系统启动默认使用jffs2的文件系统,该文件系统支持可读可写,若要使用其他文件系统,需要适配新增。 + +## 使用 + +请参考[《内核使用指南》](zh-cn_bookmap_0000001050030794.md#zh-cn_topic_0000001050032743)。 + +## 涉及仓 + +drivers\_liteos + +kernel\_liteos\_a + +kernel\_liteos\_a\_huawei\_proprietary\_fs\_proc + +kernel\_liteos\_m + diff --git a/liteos_a/bundle.json b/liteos_a/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..a95875753717e69a1c066f409f91f81b01e7246a --- /dev/null +++ b/liteos_a/bundle.json @@ -0,0 +1,24 @@ +{ + "name": "@ohos/liteos_a", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "OpenHarmony内核是华为推出的面向IoT领域的实时操作系统内核,它具备类似RTOS般轻快和Linux般易用的特点。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/ &&mkdir -p $DEST_PATH && cp -r drivers kernel $DEST_PATH" + }, + "keywords": [ + "liteos" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "kernel", + "drivers" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/ltp/LICENSE b/ltp/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/ltp/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/ltp/README.md b/ltp/README.md new file mode 100644 index 0000000000000000000000000000000000000000..56d10d450f1b8ce822ca3f85b4c2a0e6f81ed478 --- /dev/null +++ b/ltp/README.md @@ -0,0 +1,211 @@ +Linux Test Project +================== + +Linux Test Project is a joint project started by SGI, OSDL and Bull developed +and maintained by IBM, Cisco, Fujitsu, SUSE, Red Hat, Oracle and others. The +project goal is to deliver tests to the open source community that validate the +reliability, robustness, and stability of Linux. + +The LTP testsuite contains a collection of tools for testing the Linux kernel +and related features. Our goal is to improve the Linux kernel and system +libraries by bringing test automation to the testing effort. Interested open +source contributors are encouraged to join. + +Project pages are located at: http://linux-test-project.github.io/ + +The latest image is always available at: +https://github.com/linux-test-project/ltp/releases + +The discussion about the project happens at ltp mailing list: +http://lists.linux.it/listinfo/ltp + +The git repository is located at GitHub at: +https://github.com/linux-test-project/ltp + +The patchwork instance is at: +https://patchwork.ozlabs.org/project/ltp/list/ + +Warning! +======== + +**Be careful with these tests!** + +Don't run them on production systems. Growfiles, doio, and iogen in particular +stress the I/O capabilities of systems and while they should not cause problems +on properly functioning systems, they are intended to find (or cause) problems. + +Quick guide to running the tests +================================ + +If you have git, autoconf, automake, m4, pkgconf / pkg-config, libc headers, +linux kernel headers and other common development packages installed (see +INSTALL and travis/*.sh), the chances are the following will work: + +``` +$ git clone https://github.com/linux-test-project/ltp.git +$ cd ltp +$ make autotools +$ ./configure +``` + +Now you can continue either with compiling and running a single test or with +compiling and installing the whole testsuite. + +For optional library dependencies look into scripts for major distros in +`travis/` directory. You can also build whole LTP with `./build.sh` script. + +Shortcut to running a single test +--------------------------------- +If you need to execute a single test you actually do not need to compile +the whole LTP, if you want to run a syscall testcase following should work. + +``` +$ cd testcases/kernel/syscalls/foo +$ make +$ PATH=$PATH:$PWD ./foo01 +``` + +Shell testcases are a bit more complicated since these need a path to a shell +library as well as to compiled binary helpers, but generally following should +work. + +``` +$ cd testcases/lib +$ make +$ cd ../commands/foo +$ PATH=$PATH:$PWD:$PWD/../../lib/ ./foo01.sh +``` + +Open Posix Testsuite has it's own build system which needs Makefiles to be +generated first, then compilation should work in subdirectories as well. + +``` +$ cd testcases/open_posix_testsuite/ +$ make generate-makefiles +$ cd conformance/interfaces/foo +$ make +$ ./foo_1-1.run-test +``` + +Compiling and installing all testcases +-------------------------------------- + +``` +$ make +$ make install +``` + +This will install LTP to `/opt/ltp`. +* If you have a problem see `doc/mini-howto-building-ltp-from-git.txt`. +* If you still have a problem see `INSTALL` and `./configure --help`. +* Failing that, ask for help on the mailing list or Github. + +Some tests will be disabled if the configure script can not find their build +dependencies. + +* If a test returns `TCONF` due to a missing component, check the `./configure` + output. +* If a tests fails due to a missing user or group, see the Quick Start section + of `INSTALL`. + +Running tests +------------- + +To run all the test suites + +``` +$ cd /opt/ltp +$ ./runltp +``` + +Note that many test cases have to be executed as root. + +To run a particular test suite + +``` +$ ./runltp -f syscalls +``` + +To run all tests with `madvise` in the name + +``` +$ ./runltp -f syscalls -s madvise +``` +Also see + +``` +$ ./runltp --help +``` + +Test suites (e.g. syscalls) are defined in the runtest directory. Each file +contains a list of test cases in a simple format, see doc/ltp-run-files.txt. + +Each test case has its own executable or script, these can be executed +directly + +``` +$ testcases/bin/abort01 +``` + +Some have arguments + +``` +$ testcases/bin/fork13 -i 37 +``` + +The vast majority of test cases accept the -h (help) switch + +``` +$ testcases/bin/ioctl01 -h +``` + +Many require certain environment variables to be set + +``` +$ LTPROOT=/opt/ltp PATH="$PATH:$LTPROOT/testcases/bin" testcases/bin/wc01.sh +``` + +Most commonly, the path variable needs to be set and also `LTPROOT`, but there +are a number of other variables, `runltp` usually sets these for you. + +Note that all shell scripts need the `PATH` to be set. However this is not +limited to shell scripts, many C based tests need environment variables as +well. + +For more info see `doc/user-guide.txt` or online at +https://github.com/linux-test-project/ltp/wiki/User-Guidelines. + +Network tests +------------- +Network tests require certain setup, described in `testcases/network/README.md` +(online at https://github.com/linux-test-project/ltp/tree/master/testcases/network) +and `INSTALL`. + +Developers corner +================= + +Before you start you should read following documents: + +* `doc/test-writing-guidelines.txt` +* `doc/build-system-guide.txt` +* `doc/library-api-writing-guidelines.txt` + +There is also a step-by-step tutorial: + +* `doc/c-test-tutorial-simple.txt` + +If something is not covered there don't hesitate to ask on the LTP mailing +list. Also note that these documents are available online at: + +* https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines +* https://github.com/linux-test-project/ltp/wiki/LTP-Library-API-Writing-Guidelines +* https://github.com/linux-test-project/ltp/wiki/Build-System +* https://github.com/linux-test-project/ltp/wiki/C-Test-Case-Tutorial + +Although we accept GitHub pull requests, the preferred way is sending patches to our mailing list. + +It's a good idea to test patches on Travis CI before posting to mailing +list. Our travis setup covers various architectures and distributions in +order to make sure LTP compiles cleanly on most common configurations. +For testing you need to sign up to Travis CI, enable running builds on your LTP fork on +https://travis-ci.org/account/repositories and push your branch. diff --git a/ltp/bundle.json b/ltp/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..3ea1ef332b8f40043737d15ac4ec3ee6b4fc4d2b --- /dev/null +++ b/ltp/bundle.json @@ -0,0 +1,22 @@ +{ + "name": "@ohos/ltp", + "version": "1.8.0", + "license": "Apache V2", + "description": "", + "publishAs": "code-segment", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/ltp &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "ltp" + ], + "author": {}, + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/lwip/LICENSE b/lwip/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/lwip/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lwip/README.md b/lwip/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b95f1552e6d148672227b3084f58f4af21f36f32 --- /dev/null +++ b/lwip/README.md @@ -0,0 +1,106 @@ +INTRODUCTION + +lwIP is a small independent implementation of the TCP/IP protocol suite. + +The focus of the lwIP TCP/IP implementation is to reduce the RAM usage +while still having a full scale TCP. This making lwIP suitable for use +in embedded systems with tens of kilobytes of free RAM and room for +around 40 kilobytes of code ROM. + +lwIP was originally developed by Adam Dunkels at the Computer and Networks +Architectures (CNA) lab at the Swedish Institute of Computer Science (SICS) +and is now developed and maintained by a worldwide network of developers. + +FEATURES + + * IP (Internet Protocol, IPv4 and IPv6) including packet forwarding over + multiple network interfaces + * ICMP (Internet Control Message Protocol) for network maintenance and debugging + * IGMP (Internet Group Management Protocol) for multicast traffic management + * MLD (Multicast listener discovery for IPv6). Aims to be compliant with + RFC 2710. No support for MLDv2 + * ND (Neighbor discovery and stateless address autoconfiguration for IPv6). + Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862 + (Address autoconfiguration) + * DHCP, AutoIP/APIPA (Zeroconf) and (stateless) DHCPv6 + * UDP (User Datagram Protocol) including experimental UDP-lite extensions + * TCP (Transmission Control Protocol) with congestion control, RTT estimation + fast recovery/fast retransmit and sending SACKs + * raw/native API for enhanced performance + * Optional Berkeley-like socket API + * TLS: optional layered TCP ("altcp") for nearly transparent TLS for any + TCP-based protocol (ported to mbedTLS) (see changelog for more info) + * PPPoS and PPPoE (Point-to-point protocol over Serial/Ethernet) + * DNS (Domain name resolver incl. mDNS) + * 6LoWPAN (via IEEE 802.15.4, BLE or ZEP) + + +APPLICATIONS + + * HTTP server with SSI and CGI (HTTPS via altcp) + * SNMPv2c agent with MIB compiler (Simple Network Management Protocol), v3 via altcp + * SNTP (Simple network time protocol) + * NetBIOS name service responder + * MDNS (Multicast DNS) responder + * iPerf server implementation + * MQTT client (TLS support via altcp) + + +LICENSE + +lwIP is freely available under a BSD license. + + +DEVELOPMENT + +lwIP has grown into an excellent TCP/IP stack for embedded devices, +and developers using the stack often submit bug fixes, improvements, +and additions to the stack to further increase its usefulness. + +Development of lwIP is hosted on Savannah, a central point for +software development, maintenance and distribution. Everyone can +help improve lwIP by use of Savannah's interface, Git and the +mailing list. A core team of developers will commit changes to the +Git source tree. + +The lwIP TCP/IP stack is maintained in the 'lwip' Git module and +contributions (such as platform ports) are in the 'contrib' Git module. + +See doc/savannah.txt for details on Git server access for users and +developers. + +The current Git trees are web-browsable: + http://git.savannah.gnu.org/cgit/lwip.git + http://git.savannah.gnu.org/cgit/lwip/lwip-contrib.git + +Submit patches and bugs via the lwIP project page: + http://savannah.nongnu.org/projects/lwip/ + +Continuous integration builds (GCC, clang): + https://travis-ci.org/yarrick/lwip-merged + + +DOCUMENTATION + +Self documentation of the source code is regularly extracted from the current +Git sources and is available from this web page: + http://www.nongnu.org/lwip/ + +There is now a constantly growing wiki about lwIP at + http://lwip.wikia.com/wiki/LwIP_Wiki + +Also, there are mailing lists you can subscribe at + http://savannah.nongnu.org/mail/?group=lwip +plus searchable archives: + http://lists.nongnu.org/archive/html/lwip-users/ + http://lists.nongnu.org/archive/html/lwip-devel/ + +lwIP was originally written by Adam Dunkels: + http://dunkels.com/adam/ + +Reading Adam's papers, the files in docs/, browsing the source code +documentation and browsing the mailing list archives is a good way to +become familiar with the design of lwIP. + +Adam Dunkels +Leon Woestenberg diff --git a/lwip/bundle.json b/lwip/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..41cb675a6b46bf56d47dc281aa17f3b39ef0fe47 --- /dev/null +++ b/lwip/bundle.json @@ -0,0 +1,24 @@ +{ + "name": "@ohos/lwip", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "lwIP is a small independent implementation of the TCP/IP protocol suite that has been initially developed by Adam Dunkels. The focus of the lwIP TCP/IP implementation is to reduce resource usage while still having a full scale TCP. This makes lwIP suitable for use in embedded systems with tens of kilobytes of free RAM and room for around 40 kilobytes of code ROM.", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/lwip &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "thirdparty", + "lwip" + ], + "license": "Apache V2", + "repository": "", + "homepage": "http://elm-chan.org/fsw/ff/00index_e.html", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/mbedtls/LICENSE b/mbedtls/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/mbedtls/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/mbedtls/README.md b/mbedtls/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a44b6354dcb2572b1f6921467c5546f8fbb1fc05 --- /dev/null +++ b/mbedtls/README.md @@ -0,0 +1,180 @@ +README for Mbed TLS +=================== + +Mbed TLS is a C library that implements cryptographic primitives, X.509 certificate manipulation and the SSL/TLS and DTLS protocols. Its small code footprint makes it suitable for embedded systems. + +Configuration +------------- + +Mbed TLS should build out of the box on most systems. Some platform specific options are available in the fully documented configuration file `include/mbedtls/config.h`, which is also the place where features can be selected. This file can be edited manually, or in a more programmatic way using the Perl script `scripts/config.pl` (use `--help` for usage instructions). + +Compiler options can be set using conventional environment variables such as `CC` and `CFLAGS` when using the Make and CMake build system (see below). + +Compiling +--------- + +There are currently three active build systems used within Mbed TLS releases: + +- GNU Make +- CMake +- Microsoft Visual Studio (Microsoft Visual Studio 2010 or later) + +The main systems used for development are CMake and GNU Make. Those systems are always complete and up-to-date. The others should reflect all changes present in the CMake and Make build system, although features may not be ported there automatically. + +The Make and CMake build systems create three libraries: libmbedcrypto, libmbedx509, and libmbedtls. Note that libmbedtls depends on libmbedx509 and libmbedcrypto, and libmbedx509 depends on libmbedcrypto. As a result, some linkers will expect flags to be in a specific order, for example the GNU linker wants `-lmbedtls -lmbedx509 -lmbedcrypto`. Also, when loading shared libraries using dlopen(), you'll need to load libmbedcrypto first, then libmbedx509, before you can load libmbedtls. + +### Make + +We require GNU Make. To build the library and the sample programs, GNU Make and a C compiler are sufficient. Some of the more advanced build targets require some Unix/Linux tools. + +We intentionally only use a minimum of functionality in the makefiles in order to keep them as simple and independent of different toolchains as possible, to allow users to more easily move between different platforms. Users who need more features are recommended to use CMake. + +In order to build from the source code using GNU Make, just enter at the command line: + + make + +In order to run the tests, enter: + + make check + +The tests need Python to be built and Perl to be run. If you don't have one of them installed, you can skip building the tests with: + + make no_test + +You'll still be able to run a much smaller set of tests with: + + programs/test/selftest + +In order to build for a Windows platform, you should use `WINDOWS_BUILD=1` if the target is Windows but the build environment is Unix-like (for instance when cross-compiling, or compiling from an MSYS shell), and `WINDOWS=1` if the build environment is a Windows shell (for instance using mingw32-make) (in that case some targets will not be available). + +Setting the variable `SHARED` in your environment will build shared libraries in addition to the static libraries. Setting `DEBUG` gives you a debug build. You can override `CFLAGS` and `LDFLAGS` by setting them in your environment or on the make command line; compiler warning options may be overridden separately using `WARNING_CFLAGS`. Some directory-specific options (for example, `-I` directives) are still preserved. + +Please note that setting `CFLAGS` overrides its default value of `-O2` and setting `WARNING_CFLAGS` overrides its default value (starting with `-Wall -W`), so if you just want to add some warning options to the default ones, you can do so by setting `CFLAGS=-O2 -Werror` for example. Setting `WARNING_CFLAGS` is useful when you want to get rid of its default content (for example because your compiler doesn't accept `-Wall` as an option). Directory-specific options cannot be overridden from the command line. + +Depending on your platform, you might run into some issues. Please check the Makefiles in `library/`, `programs/` and `tests/` for options to manually add or remove for specific platforms. You can also check [the Mbed TLS Knowledge Base](https://tls.mbed.org/kb) for articles on your platform or issue. + +In case you find that you need to do something else as well, please let us know what, so we can add it to the [Mbed TLS Knowledge Base](https://tls.mbed.org/kb). + +### CMake + +In order to build the source using CMake in a separate directory (recommended), just enter at the command line: + + mkdir /path/to/build_dir && cd /path/to/build_dir + cmake /path/to/mbedtls_source + make + +In order to run the tests, enter: + + make test + +The test suites need Python to be built and Perl to be executed. If you don't have one of these installed, you'll want to disable the test suites with: + + cmake -DENABLE_TESTING=Off /path/to/mbedtls_source + +If you disabled the test suites, but kept the programs enabled, you can still run a much smaller set of tests with: + + programs/test/selftest + +To configure CMake for building shared libraries, use: + + cmake -DUSE_SHARED_MBEDTLS_LIBRARY=On /path/to/mbedtls_source + +There are many different build modes available within the CMake buildsystem. Most of them are available for gcc and clang, though some are compiler-specific: + +- `Release`. This generates the default code without any unnecessary information in the binary files. +- `Debug`. This generates debug information and disables optimization of the code. +- `Coverage`. This generates code coverage information in addition to debug information. +- `ASan`. This instruments the code with AddressSanitizer to check for memory errors. (This includes LeakSanitizer, with recent version of gcc and clang.) (With recent version of clang, this mode also instruments the code with UndefinedSanitizer to check for undefined behaviour.) +- `ASanDbg`. Same as ASan but slower, with debug information and better stack traces. +- `MemSan`. This instruments the code with MemorySanitizer to check for uninitialised memory reads. Experimental, needs recent clang on Linux/x86\_64. +- `MemSanDbg`. Same as MemSan but slower, with debug information, better stack traces and origin tracking. +- `Check`. This activates the compiler warnings that depend on optimization and treats all warnings as errors. + +Switching build modes in CMake is simple. For debug mode, enter at the command line: + + cmake -D CMAKE_BUILD_TYPE=Debug /path/to/mbedtls_source + +To list other available CMake options, use: + + cmake -LH + +Note that, with CMake, you can't adjust the compiler or its flags after the +initial invocation of cmake. This means that `CC=your_cc make` and `make +CC=your_cc` will *not* work (similarly with `CFLAGS` and other variables). +These variables need to be adjusted when invoking cmake for the first time, +for example: + + CC=your_cc cmake /path/to/mbedtls_source + +If you already invoked cmake and want to change those settings, you need to +remove the build directory and create it again. + +Note that it is possible to build in-place; this will however overwrite the +provided Makefiles (see `scripts/tmp_ignore_makefiles.sh` if you want to +prevent `git status` from showing them as modified). In order to do so, from +the Mbed TLS source directory, use: + + cmake . + make + +If you want to change `CC` or `CFLAGS` afterwards, you will need to remove the +CMake cache. This can be done with the following command using GNU find: + + find . -iname '*cmake*' -not -name CMakeLists.txt -exec rm -rf {} + + +You can now make the desired change: + + CC=your_cc cmake . + make + +Regarding variables, also note that if you set CFLAGS when invoking cmake, +your value of CFLAGS doesn't override the content provided by cmake (depending +on the build mode as seen above), it's merely prepended to it. + +### Microsoft Visual Studio + +The build files for Microsoft Visual Studio are generated for Visual Studio 2010. + +The solution file `mbedTLS.sln` contains all the basic projects needed to build the library and all the programs. The files in tests are not generated and compiled, as these need Python and perl environments as well. However, the selftest program in `programs/test/` is still available. + +Example programs +---------------- + +We've included example programs for a lot of different features and uses in [`programs/`](programs/README.md). Most programs only focus on a single feature or usage scenario, so keep that in mind when copying parts of the code. + +Tests +----- + +Mbed TLS includes an elaborate test suite in `tests/` that initially requires Python to generate the tests files (e.g. `test\_suite\_mpi.c`). These files are generated from a `function file` (e.g. `suites/test\_suite\_mpi.function`) and a `data file` (e.g. `suites/test\_suite\_mpi.data`). The `function file` contains the test functions. The `data file` contains the test cases, specified as parameters that will be passed to the test function. + +For machines with a Unix shell and OpenSSL (and optionally GnuTLS) installed, additional test scripts are available: + +- `tests/ssl-opt.sh` runs integration tests for various TLS options (renegotiation, resumption, etc.) and tests interoperability of these options with other implementations. +- `tests/compat.sh` tests interoperability of every ciphersuite with other implementations. +- `tests/scripts/test-ref-configs.pl` test builds in various reduced configurations. +- `tests/scripts/key-exchanges.pl` test builds in configurations with a single key exchange enabled +- `tests/scripts/all.sh` runs a combination of the above tests, plus some more, with various build options (such as ASan, full `config.h`, etc). + +Configurations +-------------- + +We provide some non-standard configurations focused on specific use cases in the `configs/` directory. You can read more about those in `configs/README.txt` + +Porting Mbed TLS +---------------- + +Mbed TLS can be ported to many different architectures, OS's and platforms. Before starting a port, you may find the following Knowledge Base articles useful: + +- [Porting Mbed TLS to a new environment or OS](https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS) +- [What external dependencies does Mbed TLS rely on?](https://tls.mbed.org/kb/development/what-external-dependencies-does-mbedtls-rely-on) +- [How do I configure Mbed TLS](https://tls.mbed.org/kb/compiling-and-building/how-do-i-configure-mbedtls) + +License +------- + +Unless specifically indicated otherwise in a file, Mbed TLS files are provided under the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license. See [here](./apache-2.0.txt) for the full text of this license. Contributors must accept that their contributions are made under both the Apache-2.0 AND [GPL-2.0-or-later](https://spdx.org/licenses/GPL-2.0-or-later.html) licenses. This enables LTS (Long Term Support) branches of the software to be provided under either the Apache-2.0 OR GPL-2.0-or-later licenses. + +Contributing +------------ + +We gratefully accept bug reports and contributions from the community. Please see the [contributing guidelines](CONTRIBUTING.md) for details on how to do this. diff --git a/mbedtls/bundle.json b/mbedtls/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..b1bdf585bd110ae679ecc8e0d495933378826630 --- /dev/null +++ b/mbedtls/bundle.json @@ -0,0 +1,20 @@ +{ + "name": "@ohos/mbedtls", + "version": "1.8.0", + "license": "Apache V2", + "description": "An open source, portable, easy to use, readable and flexible SSL library.", + "publishAs": "code-segment", + "kerywords": "mbedtls", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/mbedtls && mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "author": {}, + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/media_service/LICENSE b/media_service/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/media_service/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/media_service/README.md b/media_service/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fe73a50005b5bcdbddac996a30fc5edec46c528a --- /dev/null +++ b/media_service/README.md @@ -0,0 +1,12 @@ +# MediaService\_README + +# 模块介绍 + +该模块用于启动多媒体服务,该服务会初始化多媒体资源及公共变量状态。 + +# 安装说明 + +设备启动后,运行media\_server启动该服务。 + + + diff --git a/media_service/bundle.json b/media_service/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..c17c020410db64f6a287f49d7e6038b121bf22be --- /dev/null +++ b/media_service/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/media_service", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "该模块用于启动多媒体服务,该服务会初始化多媒体资源及公共变量状态。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/multimedia &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "mediaservice" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "foundation" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/mtd_utils/LICENSE b/mtd_utils/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/mtd_utils/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/mtd_utils/README.md b/mtd_utils/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8178c76d627cade75005b40711b92f4177bc6cfc --- /dev/null +++ b/mtd_utils/README.md @@ -0,0 +1 @@ +readme diff --git a/mtd_utils/bundle.json b/mtd_utils/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..595060ebfa916e5133129a91d8b2d7603b8d4bf8 --- /dev/null +++ b/mtd_utils/bundle.json @@ -0,0 +1,24 @@ +{ + "name": "@ohos/mtd_utils", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "MTD subsystem (stands for Memory Technology Devices) provides an abstraction layer for raw flash devices. It makes it possible to use the same API when working with different flash types and technologies, e.g. NAND, OneNAND, NOR, AG-AND, ECC'd NOR, etc.", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/mtd_utils&&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "thirdparty", + "mtdutils" + ], + "license": "Apache V2", + "repository": "http://git.infradead.org/mtd-utils.git", + "homepage": "http://git.infradead.org/mtd-utils.git", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/musl/LICENSE b/musl/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/musl/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/musl/README.md b/musl/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a30eb112750c1592081bd8a4e8d9409befbe7419 --- /dev/null +++ b/musl/README.md @@ -0,0 +1,23 @@ + + musl libc + +musl, pronounced like the word "mussel", is an MIT-licensed +implementation of the standard C library targetting the Linux syscall +API, suitable for use in a wide range of deployment environments. musl +offers efficient static and dynamic linking support, lightweight code +and low runtime overhead, strong fail-safe guarantees under correct +usage, and correctness in the sense of standards conformance and +safety. musl is built on the principle that these goals are best +achieved through simple code that is easy to understand and maintain. + +The 1.1 release series for musl features coverage for all interfaces +defined in ISO C99 and POSIX 2008 base, along with a number of +non-standardized interfaces for compatibility with Linux, BSD, and +glibc functionality. + +For basic installation instructions, see the included INSTALL file. +Information on full musl-targeted compiler toolchains, system +bootstrapping, and Linux distributions built on musl can be found on +the project website: + + http://www.musl-libc.org/ diff --git a/musl/bundle.json b/musl/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..0a2b4df708f42ebaf4c18e1626d1bee977ec0fdb --- /dev/null +++ b/musl/bundle.json @@ -0,0 +1,24 @@ +{ + "name": "@ohos/musl", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "musl is an MIT-licensed implementation of the standard C library", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/musl&&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "thirdparty", + "musl" + ], + "license": "Apache V2", + "repository": "", + "homepage": "http://www.musl-libc.org", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/nuttx/LICENSE b/nuttx/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/nuttx/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/nuttx/README.md b/nuttx/README.md new file mode 100644 index 0000000000000000000000000000000000000000..20f9c3fe1bb6d7da904483dc8d1eef4693347e98 --- /dev/null +++ b/nuttx/README.md @@ -0,0 +1,2 @@ +#NuttX + diff --git a/nuttx/bundle.json b/nuttx/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..0ac87fc55f4e0106b7c7c5b5eeacb03ef4515968 --- /dev/null +++ b/nuttx/bundle.json @@ -0,0 +1,24 @@ +{ + "name": "@ohos/nuttx", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "NuttX", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/NuttX&&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "thirdparty", + "nuttx" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/oem_iotlink/LICENSE b/oem_iotlink/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/oem_iotlink/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/oem_iotlink/README.md b/oem_iotlink/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8178c76d627cade75005b40711b92f4177bc6cfc --- /dev/null +++ b/oem_iotlink/README.md @@ -0,0 +1 @@ +readme diff --git a/oem_iotlink/bundle.json b/oem_iotlink/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..6ae893389d446fceae2aae5b94d0de917af9ef2a --- /dev/null +++ b/oem_iotlink/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/oem_iotlink", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "oem_iotlink", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/vendor/huawei/wifi-iot &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "vender" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "vendor" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-m", + "board": "hi3861" + } +} \ No newline at end of file diff --git a/oem_smartvision/LICENSE b/oem_smartvision/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/oem_smartvision/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/oem_smartvision/README.md b/oem_smartvision/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8178c76d627cade75005b40711b92f4177bc6cfc --- /dev/null +++ b/oem_smartvision/README.md @@ -0,0 +1 @@ +readme diff --git a/oem_smartvision/bundle.json b/oem_smartvision/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..283976e1afd1c4c985374a70c5f303d730472f99 --- /dev/null +++ b/oem_smartvision/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/oem_smartvision", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "oem_smartvision", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/vendor/huawei/camera &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "vendor" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "vendor" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/openssl/LICENSE b/openssl/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/openssl/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/openssl/README.md b/openssl/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d7d44aa3a01b13c302a942004b16822f97363164 --- /dev/null +++ b/openssl/README.md @@ -0,0 +1,93 @@ + + OpenSSL 1.1.1f 31 Mar 2020 + + Copyright (c) 1998-2020 The OpenSSL Project + Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson + All rights reserved. + + DESCRIPTION + ----------- + + The OpenSSL Project is a collaborative effort to develop a robust, + commercial-grade, fully featured, and Open Source toolkit implementing the + Transport Layer Security (TLS) protocols (including SSLv3) as well as a + full-strength general purpose cryptographic library. + + OpenSSL is descended from the SSLeay library developed by Eric A. Young + and Tim J. Hudson. The OpenSSL toolkit is licensed under a dual-license (the + OpenSSL license plus the SSLeay license), which means that you are free to + get and use it for commercial and non-commercial purposes as long as you + fulfill the conditions of both licenses. + + OVERVIEW + -------- + + The OpenSSL toolkit includes: + + libssl (with platform specific naming): + Provides the client and server-side implementations for SSLv3 and TLS. + + libcrypto (with platform specific naming): + Provides general cryptographic and X.509 support needed by SSL/TLS but + not logically part of it. + + openssl: + A command line tool that can be used for: + Creation of key parameters + Creation of X.509 certificates, CSRs and CRLs + Calculation of message digests + Encryption and decryption + SSL/TLS client and server tests + Handling of S/MIME signed or encrypted mail + And more... + + INSTALLATION + ------------ + + See the appropriate file: + INSTALL Linux, Unix, Windows, OpenVMS, ... + NOTES.* INSTALL addendums for different platforms + + SUPPORT + ------- + + See the OpenSSL website www.openssl.org for details on how to obtain + commercial technical support. Free community support is available through the + openssl-users email list (see + https://www.openssl.org/community/mailinglists.html for further details). + + If you have any problems with OpenSSL then please take the following steps + first: + + - Download the latest version from the repository + to see if the problem has already been addressed + - Configure with no-asm + - Remove compiler optimization flags + + If you wish to report a bug then please include the following information + and create an issue on GitHub: + + - OpenSSL version: output of 'openssl version -a' + - Configuration data: output of 'perl configdata.pm --dump' + - OS Name, Version, Hardware platform + - Compiler Details (name, version) + - Application Details (name, version) + - Problem Description (steps that will reproduce the problem, if known) + - Stack Traceback (if the application dumps core) + + Just because something doesn't work the way you expect does not mean it + is necessarily a bug in OpenSSL. Use the openssl-users email list for this type + of query. + + HOW TO CONTRIBUTE TO OpenSSL + ---------------------------- + + See CONTRIBUTING + + LEGALITIES + ---------- + + A number of nations restrict the use or export of cryptography. If you + are potentially subject to such restrictions you should seek competent + professional legal advice before attempting to develop or distribute + cryptographic code. diff --git a/openssl/bundle.json b/openssl/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..097865b96369ddc68255c2a434c53e2910acf0cf --- /dev/null +++ b/openssl/bundle.json @@ -0,0 +1,20 @@ +{ + "name": "@ohos/openssl", + "version": "1.8.0", + "license": "Apache V2", + "description": "implementing the Transport Layer Security (TLS) protocols (including SSLv3) as well as a full-strength general purpose cryptographic library", + "publishAs": "code-segment", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/openssl && mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "kerwords": "openssl", + "author": {}, + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/player/LICENSE b/player/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/player/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/player/README.md b/player/README.md new file mode 100644 index 0000000000000000000000000000000000000000..680d446a4caf4a062073c14453c64709d2ea6bfb --- /dev/null +++ b/player/README.md @@ -0,0 +1,89 @@ +# Player\_README + +# 模块介绍 + +音视频播放模块支持音视频播放业务的开发,主要包括音视频文件和音视频流播放、音量和播放进度控制等。 + +在进行应用的开发前,开发者应了解以下基本概念: + +- 流媒体技术 + + 流媒体技术是把连续的影像和声音信息进行编码处理后放在网络服务器上,让浏览者一边下载、一边观看与收听,而不需要等整个多媒体文件下载完成就可以即时观看、收听的技术。 + + +- 视频帧率 + + 帧率是用于测量显示帧数的度量,帧数就是在每秒钟时间里传输的图片数量。每秒钟帧数 \(FPS\) 越多,所显示的画面就会越流畅。 + +- 码率 + + 码率就是数据传输时单位时间传送的数据位数,常用单位是kbps即千位每秒。 + +- 采样率 + + 采样率为每秒从连续信号中提取并组成离散信号的采样个数,单位用赫兹(Hz)来表示。 + + +# 安装指导 + +播放相关动态库安装到设备/usr/lib中 + +# 使用说明 + +1. 实现PlayerCallback回调,通过SetPlayerCallback函数进行绑定,用于事件处理。 + + ``` + class TestPlayerCallback : public PlayerCallback{ + void OnPlaybackComplete() override + { + //此处实现代码用于处理文件播放完成的事件 + } + void OnError(int32_t errorType, int32_t errorCode) override + { + //此处实现代码处理错误事件 + } + void OnInfo(int type, int extra) override + { + //此处实现代码处理普通事件 + } + void OnRewindToComplete() override + { + //此处实现代码处理进度控制完成的事件 + } + }; + + ``` + +2. 创建Player实例,设置播放源并开始播放。 + + ``` + Player *player = new Player(); + std::shared_ptr callback = std::make_shared(); + player->SetPlayerCallback(callback);//设置player回调 + std::string uri(filePath);//此处filePath为本地文件路径 + Source source(uri);//保存uri到source实例 + player->SetSource(source);//将source设置到player + player->SetVideoSurface(surface);//设置播放窗口 + player->Prepare();//准备播放 + player->Play();//开始播放 + ``` + +3. 根据场景需要进行播放控制。 + + ``` + player->SetVolume(lvolume, rvolume);//设置左右声道声音 + player->EnableSingleLooping(true);//设置循环播放 + player->Pause();//暂停 + player->Play();//继续播放 + ``` + +4. 播放任务结束后,进行资源释放。 + + ``` + player->Stop(); //停止播放 + player->Release();//释放资源 + ``` + + + + diff --git a/player/bundle.json b/player/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..820cac05fd7757de8d4ff97e51b00564ba893e27 --- /dev/null +++ b/player/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/player", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "音视频播放模块支持音视频播放业务的开发,主要包括音视频文件和音视频流播放、音量和播放进度控制等。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/multimedia &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "player" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "foundation" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/recorder/LICENSE b/recorder/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/recorder/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/recorder/README.md b/recorder/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d37e7a66be8b200535611633bf9262573c4035c6 --- /dev/null +++ b/recorder/README.md @@ -0,0 +1,315 @@ +# Recorder\_README + +# 介绍 + +## 简介 + +录制模块支持音视频录制业务的开发,提供音视频录制相关的功能,包括设置录制视频画面尺寸、音视频编码码率、编码器类型、视频帧率、音频采样率、录制文件输出格式等。 + +在进行应用的开发前,开发者应了解以下基本概念: + +- 流媒体技术 + + 流媒体技术是把连续的影像和声音信息进行编码处理后放在网络服务器上,让浏览者一边下载、一边观看与收听,而不需要等整个多媒体文件下载完成就可以即时观看、收听的技术。 + + +- 视频帧率 + + 帧率是用于测量显示帧数的度量,帧数就是在每秒钟时间里传输的图片数量。每秒钟帧数 \(FPS\) 越多,所显示的画面就会越流畅。 + +- 码率 + + 码率就是数据传输时单位时间传送的数据位数,常用单位是kbps即千位每秒。 + +- 采样率 + + 采样率为每秒从连续信号中提取并组成离散信号的采样个数,单位用赫兹(Hz)来表示。 + + +# 安装指导 + +录像相关动态库安装到设备/usr/lib中 + +# 使用说明 + +## 使用场景 + +音视频录制的主要功能是录制音视频,并根据设置的编码格式、采样率、码率等参数封装输出文件。 + +## 接口说明 + +音视频录制API接口如下,具体的API详见接口文档。 + +**表 1** 音视频录制API接口 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

类名

+

接口名

+

功能

+

Recorder

+

int32_t SetVideoSource(VideoSourceType source, int32_t &sourceId)

+

设置录制视频源

+

Recorder

+

int32_t SetVideoEncoder(int32_t sourceId, VideoCodecFormat encoder)

+

设置录制的视频编码器类型

+

Recorder

+

int32_t SetVideoSize(int32_t sourceId, int32_t width, int32_t height)

+

设置录制的视频宽和高

+

Recorder

+

int32_t SetVideoFrameRate(int32_t sourceId, int32_t frameRate)

+

设置要录制的视频帧率

+

Recorder

+

int32_t SetVideoEncodingBitRate(int32_t sourceId, int32_t rate)

+

设置录制视频编码的码率

+

Recorder

+

int32_t SetCaptureRate(int32_t sourceId, double fps)

+

设置视频帧的捕获帧率

+

Recorder

+

std::shared_ptr<OHOS::Surface> GetSurface(int32_t sourceId);

+

获取对应输入源的surface

+

Recorder

+

int32_t SetAudioSource(AudioSourceType source, int32_t &sourceId)

+

设置录制音频源

+

Recorder

+

int32_t SetAudioEncoder(int32_t sourceId, AudioCodecFormat encoder)

+

设置录制的音频编码器类型

+

Recorder

+

int32_t SetAudioSampleRate(int32_t sourceId, int32_t rate)

+

设置录制的音频采样率

+

Recorder

+

int32_t SetAudioChannels(int32_t sourceId, int32_t num)

+

设置要录制的音频通道数

+

Recorder

+

int32_t SetAudioEncodingBitRate(int32_t sourceId, int32_t bitRate)

+

设置录制音频编码的码率

+

Recorder

+

int32_t SetMaxDuration(int32_t duration)

+

设置录制文件的最大时长

+

Recorder

+

int32_t SetOutputFormat(OutputFormatType format)

+

设置输出文件格式

+

Recorder

+

int32_t SetOutputPath(const string &path);

+

设置输出文件保存路径

+

Recorder

+

int32_t SetOutputFile(int32_t fd)

+

设置输出文件的fd

+

Recorder

+

int32_t SetNextOutputFile(int32_t fd);

+

设置下一个输出文件的fd

+

Recorder

+

int32_t SetMaxFileSize(int64_t size)

+

设置录制会话的最大文件大小

+

Recorder

+

int32_t SetRecorderCallback(const std::shared_ptr<RecorderCallback> &callback)

+

注册录制侦听器回调

+

Recorder

+

int32_t Prepare()

+

准备录制

+

Recorder

+

int32_t Start()

+

开始录制

+

Recorder

+

int32_t Pause()

+

暂停录制

+

Recorder

+

int32_t Resume()

+

恢复录制

+

Recorder

+

int32_t Stop(bool block)

+

停止录制

+

Recorder

+

int32_t Reset();

+

重置录制

+

Recorder

+

int32_t Release()

+

释放录制资源

+

Recorder

+

int32_t SetFileSplitDuration(FileSplitType type, int64_t timestamp, uint32_t duration)

+

设置切分录像

+

Recorder

+

int32_t SetParameter(int32_t sourceId, const Format &format)

+

设置录制的扩展参数

+
+ +## 约束与限制 + +无。 + +## 开发步骤 + +1. 创建Recorder实例。 + + ``` + Recorder *recorder = new Recorder(); + ``` + +2. 设置Recorder参数,包括设置音视频源信息,音视频编码格式,采样率,码率,视频宽高等信息。 + + ``` + int32_t sampleRate = 48000; + int32_t channelCount = 1; + AudioCodecFormat audioFormat = AAC_LC; + AudioSourceType inputSource = AUDIO_MIC; + int32_t audioEncodingBitRate = sampleRate; + VideoSourceType source = VIDEO_SOURCE_SURFACE_ES; + int32_t frameRate = 30; + double fps = 30; + int32_t rate = 4096; + int32_t sourceId = 0; + int32_t audioSourceId = 0; + int32_t width = 1920; + int32_t height = 1080; + VideoCodecFormat encoder = H264; + recorder->SetVideoSource(source, sourceId ); // 设置视频源,获得sourceId + recorder->SetVideoEncoder(sourceId, encoder); // 设置视频编码格式 + recorder->SetVideoSize(sourceId, width, height); // 设置视频宽高 + recorder->SetVideoFrameRate(sourceId, frameRate); // 设置视频帧率 + recorder->SetVideoEncodingBitRate(sourceId, rate); // 设置视频编码码率 + recorder->SetCaptureRate(sourceId, fps); // 设置视频帧的捕获帧率 + recorder->SetAudioSource(inputSource, audioSourceId); // 设置音频源,获得audioSourceId + recorder->SetAudioEncoder(audioSourceId, audioFormat); // 设置音频编码格式 + recorder->SetAudioSampleRate(audioSourceId, sampleRate); // 设置音频采样率 + recorder->SetAudioChannels(audioSourceId, channelCount); // 设置音频通道数 + recorder->SetAudioEncodingBitRate(audioSourceId, audioEncodingBitRate); // 设置音频编码码率 + ``` + +3. 准备录制,Recorder进行录制前的准备工作。 + + ``` + recorder->Prepare(); // 准备录制 + ``` + +4. 开始录制,Recorder会根据设置的音频源和视频源进行录制。 + + ``` + recorder->Start(); // 开始录制 + ``` + +5. 结束录制,释放资源。 + + ``` + recorder->Stop(); // 停止录制 + recorder->Release(); // 释放录制资源 + ``` + + + diff --git a/recorder/bundle.json b/recorder/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..a0fc135b3ac130b890847a88853328e0d8c6beb7 --- /dev/null +++ b/recorder/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/recorder", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "录制模块支持音视频录制业务的开发,提供音视频录制相关的功能,包括设置录制视频画面尺寸、音视频编码码率、编码器类型、视频帧率、音频采样率、录制文件输出格式等。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/multimedia &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "recorder" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "foundation" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516,hi3518" + } +} \ No newline at end of file diff --git a/rt_thread/LICENSE b/rt_thread/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/rt_thread/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/rt_thread/README.md b/rt_thread/README.md new file mode 100644 index 0000000000000000000000000000000000000000..41824d6ca64db043b8cb361dae826b5fff3c47e7 --- /dev/null +++ b/rt_thread/README.md @@ -0,0 +1,84 @@ +# RT-Thread # + +[中文页](README_zh.md) | + +[![GitHub](https://img.shields.io/github/license/RT-Thread/rt-thread.svg)](https://github.com/RT-Thread/rt-thread/blob/master/LICENSE) +[![GitHub release](https://img.shields.io/github/release/RT-Thread/rt-thread.svg)](https://github.com/RT-Thread/rt-thread/releases) +[![Build Status](https://travis-ci.org/RT-Thread/rt-thread.svg)](https://travis-ci.org/RT-Thread/rt-thread) +[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/RT-Thread/rt-thread?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![GitHub pull-requests](https://img.shields.io/github/issues-pr/RT-Thread/rt-thread.svg)](https://github.com/RT-Thread/rt-thread/pulls) +[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](https://github.com/RT-Thread/rt-thread/pulls) + +RT-Thread is an open source IoT operating system from China, which has strong scalability: from a tiny kernel running on a tiny core, for example ARM Cortex-M0, or Cortex-M3/4/7, to a rich feature system running on MIPS32, ARM Cortex-A8, ARM Cortex-A9 DualCore etc. + +## Overview ## + +RT-Thread RTOS like a traditional real-time operating system. The kernel has real-time multi-task scheduling, semaphore, mutex, mail box, message queue, signal etc. However, it has three different things: + +* Device Driver; +* Component; +* Dynamic Module + +The device driver is more like a driver framework, UART, IIC, SPI, SDIO, USB device/host, EMAC, MTD NAND etc. The developer can easily add low level driver and board configuration, then combined with the upper framework, he/she can use lots of features. + +The Component is a software concept upon RT-Thread kernel, for example a shell (finsh/msh shell), virtual file system (FAT, YAFFS, UFFS, ROM/RAM file system etc), TCP/IP protocol stack (lwIP), POSIX (thread) interface etc. One component must be a directory under RT-Thread/Components and one component can be descripted by a SConscript file (then be compiled and linked into the system). + +The Dynamic Module, formerly named as User Applicaion (UA) is a dynamic loaded module or library, it can be compiled standalone without Kernel. Each Dynamic Module has its own object list to manage thread/semaphore/kernel object which was created or initialized inside this UA. More information about UA, please visit another [git repo](https://github.com/RT-Thread/rtthread-apps). + +## Board Support Package ## + +RT-Thread RTOS can support many architectures: + +* ARM Cortex-M0 +* ARM Cortex-M3/M4/7 +* ARM Cortex-R4 +* ARM Cortex-A8/A9 +* ARM920T/ARM926 etc +* MIPS32 +* x86 +* Andes +* C-Sky +* RISC-V +* PowerPC + +## License ## + +RT-Thread is Open Source software under the Apache License 2.0 since RT-Thread v3.1.1. License and copyright information can be found within the code. + + /* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + */ + +Since 9th of September 2018, PRs submitted by the community may be merged into the main line only after signing the Contributor License Agreement(CLA). + +## Usage ## + +RT-Thread RTOS uses [scons](http://www.scons.org) as building system. Therefore, please install scons and Python 2.7 firstly. +So far, the RT-Thread scons building system support the command line compile or generate some IDE's project. There are some option varaibles in the scons building script (rtconfig.py): + +* ```CROSS_TOOL``` the compiler which you want to use, gcc/keil/iar. +* ```EXEC_PATH``` the path of compiler. + +In SConstruct file: + +```RTT_ROOT``` This variable is the root directory of RT-Thread RTOS. If you build the porting in the bsp directory, you can use the default setting. Also, you can set the root directory in ```RTT_ROOT``` environment variable and not modify SConstruct files. + +When you set these variables correctly, you can use command: + + scons + +under BSP directory to simplely compile RT-Thread RTOS. + +If you want to generate the IDE's project file, you can use command: + + scons --target=mdk/mdk4/mdk5/iar/cb -s + +to generate the project file. + +NOTE: RT-Thread scons building system will tailor the system according to your rtconfig.h configuration header file. For example, if you disable the lwIP in the rtconfig.h by commenting the ```#define RT_USING_LWIP```, the generated project file should have no lwIP related files. + +## Contribution ## + +Please refer the contributors in the github. Thank all of RT-Thread Developers. diff --git a/rt_thread/bundle.json b/rt_thread/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..41b1fcec52e0f80776a05205ed661a04c374049a --- /dev/null +++ b/rt_thread/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/rt_thread", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "rt_thread", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/rt_thread &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "thirdparty" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/secure_os/LICENSE b/secure_os/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/secure_os/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/secure_os/README.md b/secure_os/README.md new file mode 100644 index 0000000000000000000000000000000000000000..29ae687e6508377112cd2ce5d62120b9b247ff7f --- /dev/null +++ b/secure_os/README.md @@ -0,0 +1,52 @@ +# 项目介绍 + +## 简介 + +secure\_os组件提供了一套用于和华为自研TEEOS交互的富运行环境(REE)接口组件,包括驱动(tzdriver)、libteec(应用接口库)、teecd(agent服务),其中libteec满足Globalplatform 标准,可提供CA(ClientApp)标准的访问接口。 + +## 架构 + +secure\_os组件结构: + +![](http://tools.harmonyos.com/mirrors/hpm-image/secure_os_README/figures/zh-cn_image_0000001054341136.png) + +- tzdriver:驱动用于ree/tee切换、通讯,提供应用层访问的设备节点。 + +- libteec: 提供CA标准GP接口,用于访问设备节点、建立与TEE的通讯会话。 + +- teecd:提供agent(代理服务),帮助TEEOS实现文件操作等代理服务。 + +## 目录 + +**表 1** Secure\_os源代码目录结构 + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

base/security/frameworks/secure_os/libteec

+

libteec组件的实现代码

+

base/security/interfaces/innerkits/secure_os/libteec

+

libteec组件的接口定义

+

base/security/services/secure_os/libteec

+

teecd组件的实现代码

+

drivers/liteos/tzdriver/

+

tzdriver驱动的实现代码

+
+ diff --git a/secure_os/bundle.json b/secure_os/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..2f3cb9636aa89e4c211e1c92773ef7df3e2ef0c8 --- /dev/null +++ b/secure_os/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/secure_os", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "secure_os组件提供了一套用于和华为自研TEEOS交互的富运行环境(REE)接口组件,包括驱动(tzdriver)、libteec(应用接口库)、teecd(agent服务),其中libteec满足Globalplatform 标准,可提供CA(ClientApp)标准的访问接口。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/security &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "secure" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a", + "board": "hi3516" + } +} \ No newline at end of file diff --git a/soft_bus/LICENSE b/soft_bus/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/soft_bus/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/soft_bus/README.md b/soft_bus/README.md new file mode 100644 index 0000000000000000000000000000000000000000..23aed333937c5bc054d27350f0e9af5532e6e033 --- /dev/null +++ b/soft_bus/README.md @@ -0,0 +1,173 @@ +# 项目介绍 + +## 简介 + +设备通信方式多种多样\(USB/WIFI/BT等\),不同通信方式使用差异很大且繁琐,同时通信链路的融合共享和冲突无法处理,通信安全问题也不好保证。本项目致力于实现近场设备间统一的分布式通信能力管理,提供不区分链路的设备发现和传输接口。目前实现能力包含: + +- 服务发布:服务发布后周边的设备可以发现并使用服务。 +- 数据传输:根据服务的名称和设备ID建立一个会话,就可以实现服务间的传输功能。 +- 安全:提供通信数据的加密能力。 + +开发者通过使用项目的API实现设备间高速安全的通信,不用关心通信细节管理,进而实现业务开发的跨平台能力。 + +## 约束 + +1. 软总线支持设备认证,提供安全数据传输通道,在设备认证之前需要由三方应用完成设备绑定。 + +- 轻鸿蒙侧软总线封装HiChain1.0 SDK提供统一的设备绑定接口; +- EMUI侧进行注册和绑定后,分别调用HiChain1.0扩展接口注册群组和添加可信设备,使得软总线能够发现和组网轻鸿蒙设备。 + +实现约束:轻鸿蒙侧软总线设备绑定和设备认证使用相同的SeviceType和业务标识,且支持一个应用进行设备可信关系的建立。 + +2. 当前仅支持进程内调用软总线的功能。 + +## 使用 + +1. 设备发现 + +用户使用发现功能时,需要保证发现端设备与被发现端设备在同一个局域网内,并且互相能收到对方以下流程的报文。 + +(1) 发现端设备,发起discover请求后,使用coap协议在局域网内发送广播。报文如下: + +![](http://tools.harmonyos.com/mirrors/hpm-image/softBus_README/figures/1.png) + +(2)被发现端设备使用PublishService接口发布服务,接收端收到广播后,发送coap协议单播给发现端。报文格式如下: + +![](http://tools.harmonyos.com/mirrors/hpm-image/softBus_README/figures/2.png) + +(3)发现端设备收到报文会更新设备信息。 + +被发现端接口使用示例如下: + +``` +// 回调函数声明: +void onSuccess(int publishId) +{ + printf("public success,publishId = %d\r\n", publishId); +} +void onFail(int publishId, PublishFailReason reason) +{ + printf("publish failed, publishId = %d, reason = %d\r\n", publishId, reason); +} +// 服务发布接口使用 +PublishInfo info = {0}; +IPublishCallback cb = {0}; +cb.onPublishSuccess = onSuccess; +cb.onPublishFail = onFail; +char a[] = "456"; +info.capabilityData = a; +info.capability = "ddmpCapability"; +info.dataLen = strlen("456"); +info.medium = 2; +info.publishId = 1; +PublishService("cxx", &info, &cb); +``` + +2. 传输 + +软总线提供统一的基于Session的传输功能,业务可以通过sessionId收发数据或获取其相关基本属性。当前本项目只实现被动接收Session连接的功能,业务可根据自身需要及Session自身属性判断是否接受此Session,如不接受,可以主动拒绝此连接。本项目暂未提供打开Session的相关能力。 + +传输主要代码示例如下: + +``` +// 定义业务自身的业务名称,会话名称及相关回调 +const char *g_pkgName = "BUSINESS_NAME"; +const char *g_sessionName = "SESSION_NAME"; +struct ISessionListener * g_sessionCallback= NULL; + +// 回调实现:接收对方通过SendBytes发送的数据,此示例实现是接收到对端发送的数据后回复固定消息 +void OnBytesReceivedTest(int sessionId, const void* data, unsigned int dataLen) +{ + printf("OnBytesReceivedTest\n"); + printf("Recv Data: %s\n", (char *)data); + printf("Recv Data dataLen: %d\n", dataLen); + char *testSendData = "Hello World, Hello!"; + SendBytes(sessionId, testSendData, strlen(testSendData)); + return; +} + +// 回调实现:用于处理会话关闭后的相关业务操作,如释放当前会话相关的业务资源,会话无需业务主动释放 +void OnSessionClosedEventTest(int sessionId) +{ + printf("Close session successfully, sessionId=%d\n", sessionId); +} + +// 回调实现:用于处理会话打开后的相关业务操作。返回值为0,表示接收;反之,非0表示拒绝。此示例表示只接受其他设备的同名会话连接 +int OnSessionOpenedEventTest(int sessionId) +{ + if (strcmp(GetPeerSessionName(sessionId), SESSION_NAME) != 0) { + printf("Reject the session which name is different from mine, sessionId=%d\n", sessionId); + return -1; + } + printf("Open session successfully, sessionId=%d\n", sessionId); + return 0; +} + +// 向SoftBus注册业务会话服务及其回调 +int StartSessionServer() +{ + if (g_sessionCallback != NULL) { + g_sessionCallback = (struct ISessionListener*)malloc(sizeof(struct ISessionListener)); + } + if (g_sessionCallback == NULL) { + printf("Failed to malloc g_sessionCallback!\n"); + return -1; + } + g_sessionCallback->onBytesReceived = OnBytesReceivedTest; + g_sessionCallback->onSessionOpened = OnSessionOpenedEventTest; + g_sessionCallback->onSessionClosed = OnSessionClosedEventTest; + int ret = CreateSessionServer(g_pkgName, g_sessionName, g_sessionCallback); + if (ret < 0) { + printf("Failed to create session server!\n"); + free(g_sessionCallback); + g_sessionCallback = NULL; + } + return ret; +} + +// 从SoftBus中删除业务会话服务及其回调 +void StopSessionServer() +{ + int ret = RemoveSessionServer(g_pkgName, g_sessionName); + if (ret < 0) { + printf("Failed to remove session server!\n"); + return; + } + if (g_sessionCallback != NULL) { + free(g_sessionCallback); + g_sessionCallback = NULL; + } +} +``` + +## 目录 + +softbus\_lite源代码目录结构如下图所示: + +**表1 **softbus\_lite源代码目录结构 + + + + + + + + + + + + + + + + +

名称

+

描述

+

authmanager

+

提供设备认证机制和设备知识库管理。

+

discovery

+

提供基于coap协议的设备发现机制。

+

trans_service

+

提供认证和传输通道。

+
+ diff --git a/soft_bus/bundle.json b/soft_bus/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..babe4272f3dd4dc0cf6a989460b6550749585a89 --- /dev/null +++ b/soft_bus/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/soft_bus", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "设备通信方式多种多样(USB/WIFI/BT等),不同通信方式使用差异很大且繁琐,同时通信链路的融合共享和冲突无法处理,通信安全问题也不好保证。本项目致力于实现近场设备间统一的分布式通信能力管理,提供不区分链路的设备发现和传输接口。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/communication &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "softbus" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "foundation" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a,liteos-m", + "board": "hi3516,hi3518,hi3861" + } +} \ No newline at end of file diff --git a/syspara/LICENSE b/syspara/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/syspara/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/syspara/README.md b/syspara/README.md new file mode 100644 index 0000000000000000000000000000000000000000..27b70eb408246a5139b758369fb90ab46dfb874e --- /dev/null +++ b/syspara/README.md @@ -0,0 +1,61 @@ +# 项目介绍 + +## 简介 + +系统属性模块,根据鸿蒙CDD文档提供获取设备信息的接口,如:产品名、品牌名、厂家名等,同时提供设置/读取系统属性的接口。 + +## 目录 + +**表 1** 系统属性模块源代码目录结构 + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

base/startup/interfaces/kits/syspara_lite

+

系统属性模块对外接口

+

base/startup/hals/syspara_lite

+

系统属性模块硬件抽象层头文件

+

base/startup/interfaces

+

服务启动模块对外接口,由main函数来调用,启动服务框架。

+

base/startup/frameworks/syspara_lite

+

系统属性模块源码文件

+
+ +使用C语言开发。 + +同时支持LiteOS-M、LiteOS-A平台。系统属性各字段由OEM厂商负责定义,当前方案仅提供框架及默认值。具体值需产品方按需进行调整。 + +## 使用 + +- 获取系统属性 + + ``` + char* value1 = GetProductType(); + printf("Product type =%s\n", value1); + free(value1); + char* value2 = GetManufacture(); + printf("Manufacture =%s\n", value2); + free(value2); + char* value3 = GetBrand(); + printf("GetBrand =%s\n", value3); + free(value3); + ``` + + diff --git a/syspara/bundle.json b/syspara/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..26d6c5618eed8d4596eb73c2f0194044131e464e --- /dev/null +++ b/syspara/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/syspara", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "系统属性模块,根据鸿蒙CDD文档提供获取设备信息的接口,如:产品名、品牌名、厂家名等,同时提供设置/读取系统属性的接口。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/startup/ &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "syspara" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a,liteos-m", + "board": "hi3516,hi3518,hi3861" + } +} \ No newline at end of file diff --git a/system_ability_manager/LICENSE b/system_ability_manager/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/system_ability_manager/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/system_ability_manager/README.md b/system_ability_manager/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0fdf8e6ad210c73ceeb009c7b71819f3d885e4e2 --- /dev/null +++ b/system_ability_manager/README.md @@ -0,0 +1,628 @@ +# 系统服务框架子系统 + +## 简介 + +由于平台资源有限,且硬件平台多样,因此需要屏蔽不同硬件架构和资源的不同、以及运行形态的不同,提供统一化的系统服务开发框架。根据RISC-V、Cortex-M、Cortex-A不同硬件平台,分为两种硬件平台,以下简称M核、A核。 + +M核:处理架构为Cortex-M或同等处理能力的硬件平台,系统内存一般低于512KB,无文件系统或者仅提供一个可有限使用的轻量级文件系统,遵循CMSIS接口规范。 + +A核:处理架构为Cortex-A或同等处理能力的硬件平台,内存资源大于512KB,文件系统完善,可存储大量数据,遵循POSIX接口规范。 + +系统服务框架基于面向服务的架构,提供了服务开发、服务的子功能开发、对外接口的开发、以及多服务共进程、进程间服务调用等开发能力。其中: + +- M核:包含服务开发、服务的子功能开发、对外接口的开发以及多服务共进程的开发框架。 +- A核:在M核能力基础之上,包含了进程间服务调用、进程间服务调用权限控制、进程间服务接口的开发等能力。 + +面向服务的架构: + +![](http://tools.harmonyos.com/mirrors/hpm-image/system_ability_manager_README/figures/zh-cn_image_0000001051351505.png) + +Provider:服务的提供者,为系统提供能力(对外接口)。 + +Consumer:服务的消费者,调用服务提供的功能(对外接口)。 + +Samgr:做为中介者,管理Provider提供的能力,同时帮助Consumer发现Provider的能力。 + +系统服务开发框架主体对象: + +![](http://tools.harmonyos.com/mirrors/hpm-image/system_ability_manager_README/figures/zh-cn_image_0000001051990283.png) + +- SamgrLite:主要提供服务的注册与发现能力。 +- Service:开发服务时,需要实现的服务的生命周期接口。 +- Feature:开发功能时,需要实现的功能的生命周期接口。 +- IUnknown:基于IUnknown开发服务或功能的对外接口。 +- IClientProxy:IPC调用时,消费者的消息发送代理。 +- IServerProxy:IPC调用时,开发者需要实现提供者的消息处理接口。 + +## 目录 + +**表 1** 系统服务框架源代码目录结构 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

名称

+

描述

+

interfaces/kits/samgr_lite/samgr

+

M核和A核系统服务框架对外接口定义。

+

interfaces/kits/samgr_lite/registry

+

A核进程间服务调用的对外接口定义。

+

interfaces/kits/samgr_lite/communication/broadcast

+

M核和A核进程内事件广播服务的对外接口定义。

+

services/samgr_lite/samgr/adapter

+

POSIX和CMSIS接口适配层来屏蔽A核M核接口差异。

+

services/samgr_lite/samgr/registry

+

M核服务注册发现的桩函数。

+

services/samgr_lite/samgr/source

+

M核和A核系统服务开发框架基础代码。

+

services/samgr_lite/samgr_client

+

A核进程间服务调用的注册与发现。

+

services/samgr_lite/samgr_server

+

A核进程间服务调用的IPC地址管理和访问控制。

+

services/samgr_lite/samgr_endpoint

+

A核IPC通信消息收发包管理。

+

services/samgr_lite/communication/broadcast

+

M核和A核进程内事件广播服务。

+
+ +## 约束 + +系统服务开发框架统一使用C开发。 + +同进程内服务间调用统一使用IUnknown接口对外象,消息接口统一由IUnknown接口传递给本服务。 + +服务名和功能名必需使用常量字符串且长度小于16个字节。 + +M核:系统依赖上bootstrap服务,在系统启动函数中调用OHOS\_SystemInit\(\)函数。 + +A核:系统依赖samgr库,在main函数中调用SAMGR\_Bootstrap\(\)函数。 + +## 开发服务 + +- 继承并重新定义服务: + + ``` + typedef struct ExampleService { + INHERIT_SERVICE; + INHERIT_IUNKNOWNENTRY(DefaultFeatureApi); + Identity identity; + } ExampleService; + ``` + +- 实现服务的生命周期函数: + + ``` + static const char *GetName(Service *service) + { + return EXAMPLE_SERVICE; + } + + static BOOL Initialize(Service *service, Identity identity) + { + ExampleService *example = (ExampleService *)service; + // 保存服务的唯一身份标识,用来自己的IUnknown接口对服务发消息时使用。 + example->identity = identity; + return TRUE; + } + static BOOL MessageHandle(Service *service, Request *msg) + { + ExampleService *example = (ExampleService *)service; + switch (msg->msgId) { + case MSG_SYNC: + // 业务处理 + break; + default:break; + } + return FALSE; + } + static TaskConfig GetTaskConfig(Service *service) + { + TaskConfig config = {LEVEL_HIGH, PRI_BELOW_NORMAL, + 0x800, 20, SHARED_TASK}; + return config; + } + ``` + +- 创建服务对象: + + ``` + static ExampleService g_example = { + .GetName = GetName, + .Initialize = Initialize, + .MessageHandle = MessageHandle, + .GetTaskConfig = GetTaskConfig, + SERVER_IPROXY_IMPL_BEGIN, + .Invoke = NULL, + .SyncCall = SyncCall, + IPROXY_END, + }; + ``` + +- 向SAMGR注册服务及接口: + + ``` + static void Init(void) + { + SAMGR_GetInstance()->RegisterService((Service *)&g_example); + SAMGR_GetInstance()->RegisterDefaultFeatureApi(EXAMPLE_SERVICE, GET_IUNKNOWN(g_example)); + } + ``` + +- 定义服务的初始化入口: + + ``` + SYSEX_SERVICE_INIT(Init); + + ``` + + +## 开发服务的子功能 + +- 继承并重新定义功能: + + ``` + typedef struct DemoFeature { + INHERIT_FEATURE; + INHERIT_IUNKNOWNENTRY(DemoApi); + Identity identity; + Service *parent; + } DemoFeature; + ``` + +- 实现功能的生命周期函数: + + ``` + static const char *FEATURE_GetName(Feature *feature) + { + return EXAMPLE_FEATURE; + } + + static void FEATURE_OnInitialize(Feature *feature, Service *parent, Identity identity) + { + DemoFeature *demoFeature = (DemoFeature *)feature; + demoFeature->identity = identity; + demoFeature->parent = parent; + } + + static void FEATURE_OnStop(Feature *feature, Identity identity) + { + g_example.identity.queueId = NULL; + g_example.identity.featureId = -1; + g_example.identity.serviceId = -1; + } + + static BOOL FEATURE_OnMessage(Feature *feature, Request *request) + { + if (request->msgId == MSG_PROC) { + Response response = {.data = "Yes, you did!", .len = 0}; + SAMGR_SendResponse(request, &response); + return TRUE; + } else { + if (request->msgId == MSG_TIME_PROC) { + LOS_Msleep(WAIT_FEATURE_PROC * 10); + if (request->msgValue) { + SAMGR_PrintServices(); + } else { + SAMGR_PrintOperations(); + } + AsyncTimeCall(GET_IUNKNOWN(g_example)); + return FALSE; + } + } + return FALSE; + } + ``` + +- 创建功能对象: + + ``` + static DemoFeature g_example = { + .GetName = FEATURE_GetName, + .OnInitialize = FEATURE_OnInitialize, + .OnStop = FEATURE_OnStop, + .OnMessage = FEATURE_OnMessage, + DEFAULT_IUNKNOWN_ENTRY_BEGIN, + .AsyncCall = AsyncCall, + .AsyncTimeCall = AsyncTimeCall, + .SyncCall = SyncCall, + .AsyncCallBack = AsyncCallBack, + DEFAULT_IUNKNOWN_ENTRY_END, + .identity = {-1, -1, NULL}, + }; + ``` + +- 向SAMGR注册功能及接口: + + ``` + static void Init(void){ + SAMGR_GetInstance()->RegisterFeature(EXAMPLE_SERVICE, (Feature *)&g_example); + SAMGR_GetInstance()->RegisterFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE, GET_IUNKNOWN(g_example)); + } + ``` + +- 定义功能的初始化入口: + + ``` + SYSEX_FEATURE_INIT(Init); + + ``` + + +## 开发进程内对外接口 + +- 定义IUnknown接口: + + ``` + typedef struct DemoApi { + INHERIT_IUNKNOWN; + BOOL (*AsyncCall)(IUnknown *iUnknown, const char *buff); + BOOL (*AsyncTimeCall)(IUnknown *iUnknown); + BOOL (*SyncCall)(IUnknown *iUnknown, struct Payload *payload); + BOOL (*AsyncCallBack)(IUnknown *iUnknown, const char *buff, Handler handler); + } DemoApi; + ``` + +- 定义IUnknown的引用对象: + + ``` + typedef struct DemoRefApi { + INHERIT_IUNKNOWNENTRY(DemoApi); + } DemoRefApi; + ``` + +- 初始化接口对象: + + ``` + static DemoRefApi api = { + DEFAULT_IUNKNOWN_ENTRY_BEGIN, + .AsyncCall = AsyncCall, + .AsyncTimeCall = AsyncTimeCall, + .SyncCall = SyncCall, + .AsyncCallBack = AsyncCallBack, + DEFAULT_IUNKNOWN_ENTRY_END, + }; + ``` + +- 注册服务接口: + + ``` + SAMGR_GetInstance()->RegisterFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE, GET_IUNKNOWN(api)); + + ``` + + +## 调用进程内服务 + +- 获取服务的对外接口: + + ``` + DemoApi *demoApi = NULL; + IUnknown *iUnknown = SAMGR_GetInstance()->GetFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE); + if (iUnknown == NULL) { + return NULL; + } + int result = iUnknown->QueryInterface(iUnknown, DEFAULT_VERSION, (void **)&demoApi); + if (result != 0 || demoApi == NULL) { + return NULL; + } + ``` + +- 接口调用: + + ``` + if (demoApi->AsyncCallBack == NULL) { + return NULL; + } + demoApi->AsyncCallBack((IUnknown *)demoApi, "I wanna async call callback good result!", AsyncHandler); + ``` + +- 释放接口: + + ``` + int32 ref = demoApi->Release((IUnknown *)demoApi); + + ``` + + +## 开发跨进程间对外接口 + +- 继承IServerProxy替代继承IUnknown:INHERIT\_SERVER\_IPROXY + + ``` + typedef struct DemoFeatureApi { + INHERIT_SERVER_IPROXY; + BOOL (*AsyncCall)(IUnknown *iUnknown, const char *buff); + BOOL (*AsyncTimeCall)(IUnknown *iUnknown); + BOOL (*SyncCall)(IUnknown *iUnknown, struct Payload *payload); + BOOL (*AsyncCallBack)(IUnknown *iUnknown, const char *buff, IOwner notify, INotifyFunc handler); + } DemoFeatureApi; + ``` + +- 初始化IServerProxy对象: + + ``` + static DemoFeature g_example = { + SERVER_IPROXY_IMPL_BEGIN, + .Invoke = Invoke, + .AsyncCall = AsyncCall, + .AsyncTimeCall = AsyncTimeCall, + .SyncCall = SyncCall, + .AsyncCallBack = AsyncCallBack, + IPROXY_END, + }; + ``` + +- 实现Invoke函数来处理Ipc消息: + + ``` + static int32 Invoke(IServerProxy *iProxy, int funcId, void *origin, IpcIo *req, IpcIo *reply) + { + DemoFeatureApi *api = (DemoFeatureApi *)iProxy; + BOOL ret; + size_t len = 0; + switch (funcId) { + case ID_ASYNCALL: + ret = api->AsyncCall((IUnknown *)iProxy, (char *)IpcIoPopString(req, &len)); + IpcIoPushBool(reply, ret); + break; + case ID_ASYNTIMECALL: + ret = api->AsyncTimeCall((IUnknown *)iProxy); + IpcIoPushBool(reply, ret); + break; + case ID_SYNCCALL: { + struct Payload payload; + payload.id = IpcIoPopInt32(req); + payload.value = IpcIoPopInt32(req); + payload.name = (char *)IpcIoPopString(req, &len); + ret = api->SyncCall((IUnknown *)iProxy, &payload); + IpcIoPushString(reply, ret ? "TRUE" : "FALSE"); + } + break; + case ID_ASYNCCALLBACK: { // convert to sync proxy + IpcIoPushString(reply, "Yes, you did!"); + IpcIoPushBool(reply, TRUE); + } + break; + default: + IpcIoPushBool(reply, FALSE); + break; + } + return EC_SUCCESS; + } + ``` + +- 注册接口:与进程内接口注册一致 + + ``` + SAMGR_GetInstance()->RegisterFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE, GET_IUNKNOWN(g_example)); + + ``` + + +## 调用跨进程间服务 + +- 获取跨进程服务的对外接口: + + ``` + IClientProxy *demoApi = NULL; + IUnknown *iUnknown = SAMGR_GetInstance()->GetFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE); + if (iUnknown == NULL) { + return NULL; + } + int result = iUnknown->QueryInterface(iUnknown, CLIENT_PROXY_VER, (void **)&demoApi); + if (result != 0 || demoApi == NULL) { + return NULL; + } + ``` + +- 调用Ipc消息接口: + + ``` + IpcIo request;char data[250]; + IpcIoInit(&request, data, sizeof(data), 0); + demoApi->Invoke(demoApi, 0, &request, NULL, NULL); + ``` + +- 释放接口: + + ``` + int32 ref = demoApi->Release((IUnknown *)demoApi); + + ``` + + +## 开发跨进程间服务调用客户端代理 + +- 定义IPC接口客户端代理: + + ``` + typedef struct DemoClientProxy { + INHERIT_CLIENT_IPROXY; + BOOL (*AsyncCall)(IUnknown *iUnknown, const char *buff); + BOOL (*AsyncTimeCall)(IUnknown *iUnknown); + BOOL (*SyncCall)(IUnknown *iUnknown, struct Payload *payload); + BOOL (*AsyncCallBack)(IUnknown *iUnknown, const char *buff, IOwner notify, INotifyFunc handler); + } DemoClientProxy; + typedef struct DemoClientEntry { + INHERIT_IUNKNOWNENTRY(DemoClientProxy); + } DemoClientEntry; + ``` + +- 实现客户端代理封装Ipc消息接口: + + ``` + static BOOL AsyncCall(IUnknown *iUnknown, const char *buff) + { + DemoClientProxy *proxy = (DemoClientProxy *)iUnknown; + IpcIo request; + char data[MAX_DATA_LEN]; + IpcIoInit(&request, data, MAX_DATA_LEN, 0); + IpcIoPushString(&request, buff); + int ret = proxy->Invoke((IClientProxy *)proxy, ID_ASYNCALL, &request, NULL, NULL); + return ret == EC_SUCCESS; + } + + static BOOL AsyncTimeCall(IUnknown *iUnknown) + { + DemoClientProxy *proxy = (DemoClientProxy *)iUnknown; + IpcIo request; + char data[MAX_DATA_LEN]; + IpcIoInit(&request, data, MAX_DATA_LEN, 0); + int ret = proxy->Invoke((IClientProxy *)proxy, ID_ASYNTIMECALL, &request, NULL, NULL); + return ret == EC_SUCCESS; + } + + static int Callback(IOwner owner, int code, IpcIo *reply) + { + size_t len = 0; + return strcpy_s(owner, MAX_DATA_LEN, (char *)IpcIoPopString(reply, &len)); + } + + static BOOL SyncCall(IUnknown *iUnknown, struct Payload *payload) + { + DemoClientProxy *proxy = (DemoClientProxy *)iUnknown; + IpcIo request; + char data[MAX_DATA_LEN]; + IpcIoInit(&request, data, MAX_DATA_LEN, 0); + IpcIoPushInt32(&request, payload->id); + IpcIoPushInt32(&request, payload->value); + IpcIoPushString(&request, payload->name); + int ret = proxy->Invoke((IClientProxy *)proxy, ID_SYNCCALL, &request, data, Callback); + data[MAX_DATA_LEN - 1] = 0; + HILOG_INFO(HILOG_MODULE_APP, "[TID:0x%lx]Remote response is %s!", pthread_self(), data); + return ret == EC_SUCCESS; + } + + struct CurrentNotify { + IOwner notify; + INotifyFunc handler; + }; + + static int CurrentCallback(IOwner owner, int code, IpcIo *reply) + { + struct CurrentNotify *notify = (struct CurrentNotify *)owner; + size_t len = 0; + char *response = (char *)IpcIoPopString(reply, &len); + HILOG_INFO(HILOG_MODULE_APP, "[TID:0x%lx]Notify Remote response is %s!", pthread_self(), response); + notify->handler(notify->notify, response); + return EC_SUCCESS; + } + + static BOOL AsyncCallBack(IUnknown *iUnknown, const char *buff, IOwner notify, INotifyFunc handler) + { + struct CurrentNotify owner = {notify, handler}; + DemoClientProxy *proxy = (DemoClientProxy *)iUnknown; + IpcIo request; + char data[MAX_DATA_LEN]; + IpcIoInit(&request, data, MAX_DATA_LEN, 0); + IpcIoPushString(&request, buff); + int ret = proxy->Invoke((IClientProxy *)proxy, ID_ASYNCCALLBACK, &request, &owner, CurrentCallback); + return ret == EC_SUCCESS; + } + ``` + +- 实现客户端代理的工厂方法: + + ``` + void *DEMO_CreatClient(const char *service, const char *feature, uint32 size) + { + (void)service; + (void)feature; + uint32 len = size + sizeof(DemoClientEntry); + uint8 *client = malloc(len); + (void)memset_s(client, len, 0, len); + DemoClientEntry *entry = (DemoClientEntry *)&client[size]; + entry->ver = ((uint16)CLIENT_PROXY_VER | (uint16)DEFAULT_VERSION); + entry->ref = 1; + entry->iUnknown.QueryInterface = IUNKNOWN_QueryInterface; + entry->iUnknown.AddRef = IUNKNOWN_AddRef; + entry->iUnknown.Release = IUNKNOWN_Release; + entry->iUnknown.Invoke = NULL; + entry->iUnknown.AsyncCall = AsyncCall; + entry->iUnknown.AsyncTimeCall = AsyncTimeCall; + entry->iUnknown.SyncCall = SyncCall; + entry->iUnknown.AsyncCallBack = AsyncCallBack; + return client; + } + void DEMO_DestroyClient(const char *service, const char *feature, void *iproxy) + { + free(iproxy); + } + ``` + +- 将客户端代理的工厂方法注册到SAMGR: + + ``` + SAMGR_RegisterFactory(EXAMPLE_SERVICE, EXAMPLE_FEATURE, DEMO_CreatClient, DEMO_DestroyClient); + ``` + +- 获取跨进程服务的对外接口: + + ``` + DemoClientProxy *demoApi = NULL; + IUnknown *iUnknown = SAMGR_GetInstance()->GetFeatureApi(EXAMPLE_SERVICE, EXAMPLE_FEATURE); + if (iUnknown == NULL) { + return NULL; + } + int result = iUnknown->QueryInterface(iUnknown, DEFAULT_VERSION, (void **)&demoApi); + if (result != 0 || demoApi == NULL) { + return NULL; + } + ``` + +- 调用跨进程服务的客户端代理接口: + + ``` + if (demoApi->AsyncCallBack == NULL) { + return NULL; + } + demoApi->AsyncCallBack((IUnknown *)demoApi, + "I wanna async call callback good result!", NULL, AsyncHandler); + ``` + +- 释放接口: + + ``` + int32 ref = demoApi->Release((IUnknown *)demoApi); + ``` + + +## 涉及仓 + +distributedschedule\_interfaces\_kits\_samgr\_lite + +distributedschedule\_services\_samgr\_lite + diff --git a/system_ability_manager/bundle.json b/system_ability_manager/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..fa8654d158a2620730daf6bc5381241c380e413e --- /dev/null +++ b/system_ability_manager/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/system_ability_manager", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "由于平台资源有限,且硬件平台多样,因此需要屏蔽不同硬件架构和资源的不同、以及运行形态的不同,提供统一化的系统服务开发框架。根据RISC-V、Cortex-M、Cortex-A不同硬件平台,分为两种硬件平台,以下简称M核、A核。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/distributedschedule &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "systemabilitymanager" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "foundation" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a,liteos-m", + "board": "hi3516,hi3518,hi3861" + } +} \ No newline at end of file diff --git a/token/LICENSE b/token/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/token/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/token/README.md b/token/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a5c6f7e108c020cf8354bd5f6390f318388990ca --- /dev/null +++ b/token/README.md @@ -0,0 +1,8 @@ +# token模块 + +## 简介 + +token模块,提供token读写、AcKey、产品型号、产品密钥等信息。 + +如果OEM厂商选择使用token进行设备的身份认证,厂商需要适配token相关接口。 + diff --git a/token/bundle.json b/token/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..8ca71a13fac911b1375b4a1de2472edd68981c65 --- /dev/null +++ b/token/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/token", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "token", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/ && mkdir -p $DEST_PATH && cp -r vendor base $DEST_PATH" + }, + "keywords": [ + "token" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "base" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a,liteos-m", + "board": "hi3516,hi3518,hi3861" + } +} \ No newline at end of file diff --git a/unity/LICENSE b/unity/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/unity/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/unity/README.md b/unity/README.md new file mode 100644 index 0000000000000000000000000000000000000000..983f33de897b1a14f5d72574f049b97cfe4b04b1 --- /dev/null +++ b/unity/README.md @@ -0,0 +1,191 @@ +Unity Test API +============== + +[![Unity Build Status](https://api.travis-ci.org/ThrowTheSwitch/Unity.png?branch=master)](https://travis-ci.org/ThrowTheSwitch/Unity) +__Copyright (c) 2007 - 2019 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams__ + +Getting Started +=============== +The [docs](docs/) folder contains a [getting started guide](docs/UnityGettingStartedGuide.md) +and much more tips about using Unity. + +Unity Assertion Summary +======================= +For the full list, see [UnityAssertionsReference.md](docs/UnityAssertionsReference.md). + +Basic Validity Tests +-------------------- + + TEST_ASSERT_TRUE(condition) + +Evaluates whatever code is in condition and fails if it evaluates to false + + TEST_ASSERT_FALSE(condition) + +Evaluates whatever code is in condition and fails if it evaluates to true + + TEST_ASSERT(condition) + +Another way of calling `TEST_ASSERT_TRUE` + + TEST_ASSERT_UNLESS(condition) + +Another way of calling `TEST_ASSERT_FALSE` + + TEST_FAIL() + TEST_FAIL_MESSAGE(message) + +This test is automatically marked as a failure. The message is output stating why. + +Numerical Assertions: Integers +------------------------------ + + TEST_ASSERT_EQUAL_INT(expected, actual) + TEST_ASSERT_EQUAL_INT8(expected, actual) + TEST_ASSERT_EQUAL_INT16(expected, actual) + TEST_ASSERT_EQUAL_INT32(expected, actual) + TEST_ASSERT_EQUAL_INT64(expected, actual) + +Compare two integers for equality and display errors as signed integers. A cast will be performed +to your natural integer size so often this can just be used. When you need to specify the exact size, +like when comparing arrays, you can use a specific version: + + TEST_ASSERT_EQUAL_UINT(expected, actual) + TEST_ASSERT_EQUAL_UINT8(expected, actual) + TEST_ASSERT_EQUAL_UINT16(expected, actual) + TEST_ASSERT_EQUAL_UINT32(expected, actual) + TEST_ASSERT_EQUAL_UINT64(expected, actual) + +Compare two integers for equality and display errors as unsigned integers. Like INT, there are +variants for different sizes also. + + TEST_ASSERT_EQUAL_HEX(expected, actual) + TEST_ASSERT_EQUAL_HEX8(expected, actual) + TEST_ASSERT_EQUAL_HEX16(expected, actual) + TEST_ASSERT_EQUAL_HEX32(expected, actual) + TEST_ASSERT_EQUAL_HEX64(expected, actual) + +Compares two integers for equality and display errors as hexadecimal. Like the other integer comparisons, +you can specify the size... here the size will also effect how many nibbles are shown (for example, `HEX16` +will show 4 nibbles). + + TEST_ASSERT_EQUAL(expected, actual) + +Another way of calling TEST_ASSERT_EQUAL_INT + + TEST_ASSERT_INT_WITHIN(delta, expected, actual) + +Asserts that the actual value is within plus or minus delta of the expected value. This also comes in +size specific variants. + + + TEST_ASSERT_GREATER_THAN(threshold, actual) + +Asserts that the actual value is greater than the threshold. This also comes in size specific variants. + + + TEST_ASSERT_LESS_THAN(threshold, actual) + +Asserts that the actual value is less than the threshold. This also comes in size specific variants. + + +Arrays +------ + + _ARRAY + +You can append `_ARRAY` to any of these macros to make an array comparison of that type. Here you will +need to care a bit more about the actual size of the value being checked. You will also specify an +additional argument which is the number of elements to compare. For example: + + TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, elements) + + _EACH_EQUAL + +Another array comparison option is to check that EVERY element of an array is equal to a single expected +value. You do this by specifying the EACH_EQUAL macro. For example: + + TEST_ASSERT_EACH_EQUAL_INT32(expected, actual, elements) + +Numerical Assertions: Bitwise +----------------------------- + + TEST_ASSERT_BITS(mask, expected, actual) + +Use an integer mask to specify which bits should be compared between two other integers. High bits in the mask are compared, low bits ignored. + + TEST_ASSERT_BITS_HIGH(mask, actual) + +Use an integer mask to specify which bits should be inspected to determine if they are all set high. High bits in the mask are compared, low bits ignored. + + TEST_ASSERT_BITS_LOW(mask, actual) + +Use an integer mask to specify which bits should be inspected to determine if they are all set low. High bits in the mask are compared, low bits ignored. + + TEST_ASSERT_BIT_HIGH(bit, actual) + +Test a single bit and verify that it is high. The bit is specified 0-31 for a 32-bit integer. + + TEST_ASSERT_BIT_LOW(bit, actual) + +Test a single bit and verify that it is low. The bit is specified 0-31 for a 32-bit integer. + +Numerical Assertions: Floats +---------------------------- + + TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual) + +Asserts that the actual value is within plus or minus delta of the expected value. + + TEST_ASSERT_EQUAL_FLOAT(expected, actual) + TEST_ASSERT_EQUAL_DOUBLE(expected, actual) + +Asserts that two floating point values are "equal" within a small % delta of the expected value. + +String Assertions +----------------- + + TEST_ASSERT_EQUAL_STRING(expected, actual) + +Compare two null-terminate strings. Fail if any character is different or if the lengths are different. + + TEST_ASSERT_EQUAL_STRING_LEN(expected, actual, len) + +Compare two strings. Fail if any character is different, stop comparing after len characters. + + TEST_ASSERT_EQUAL_STRING_MESSAGE(expected, actual, message) + +Compare two null-terminate strings. Fail if any character is different or if the lengths are different. Output a custom message on failure. + + TEST_ASSERT_EQUAL_STRING_LEN_MESSAGE(expected, actual, len, message) + +Compare two strings. Fail if any character is different, stop comparing after len characters. Output a custom message on failure. + +Pointer Assertions +------------------ + +Most pointer operations can be performed by simply using the integer comparisons above. However, a couple of special cases are added for clarity. + + TEST_ASSERT_NULL(pointer) + +Fails if the pointer is not equal to NULL + + TEST_ASSERT_NOT_NULL(pointer) + +Fails if the pointer is equal to NULL + +Memory Assertions +----------------- + + TEST_ASSERT_EQUAL_MEMORY(expected, actual, len) + +Compare two blocks of memory. This is a good generic assertion for types that can't be coerced into acting like +standard types... but since it's a memory compare, you have to be careful that your data types are packed. + +_MESSAGE +-------- + +you can append _MESSAGE to any of the macros to make them take an additional argument. This argument +is a string that will be printed at the end of the failure strings. This is useful for specifying more +information about the problem. + diff --git a/unity/bundle.json b/unity/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..71b53981ab48c39e59ec5dba2234512346bc32f5 --- /dev/null +++ b/unity/bundle.json @@ -0,0 +1,21 @@ +{ + "name": "@ohos/unity", + "version": "1.8.0", + "license": "Apache V2", + "description": "Simple Unit Testing for C", + "publishAs": "code-segment", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/unity && mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "unity" + ], + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/utils/LICENSE b/utils/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/utils/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/utils/README.md b/utils/README.md new file mode 100644 index 0000000000000000000000000000000000000000..06be9eadf9d9fff87666da85f05a3b32b24dbfa8 --- /dev/null +++ b/utils/README.md @@ -0,0 +1,125 @@ +# 项目介绍 + +## 简介 + +公共基础库存放鸿蒙通用的基础组件。这些基础组件可被鸿蒙各业务子系统及上层应用所使用。 + +公共基础库在不同平台上提供的能力: + +- LiteOS-M平台:KV存储、文件操作、定时器 +- LiteOS-A平台:KV存储、定时器、ACE JS API + +## 目录 + +``` +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实现 +``` + +## 约束 + +公共基础库使用C语言开发。 + +JS API使用C++11或以上版本。 + +**表 1** 公共基础库功能及约束 + + + + + + + + + + + + + + + + + + + + + + + + +

组件

+

平台支持

+

说明

+

约束

+

KV存储

+

LiteOS-M平台、LiteOS-A平台

+

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

+

依赖于BMS提供应用上下文。如在无应用上下文环境使用,读取和设置将返回错误码。

+

文件操作

+

LiteOS-M平台

+

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

+

-

+

定时器

+

LiteOS-M平台、LiteOS-A平台

+

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

+

-

+
+ +## 使用 + +- **KV存储** + + 获取接口 + + ``` + char key1[] = "rw.sys.version"; + char value1[32] = {0}; + int ret = UtilsGetValue(key1, value1, 32); + 设置接口 + char key14[] = "key_14"; + ret = UtilsSetValue(key14, defValue); + ``` + + +- **文件操作** + + ``` + // open && write + char fileName[] = "testfile"; + int fd = UtilsFileOpen(fileName, O_RDWR_FS | O_CREAT_FS | O_TRUNC_FS, 0); + 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); + printf("lseek ret = %d\n", ret); + char buf[32] = {0}; + 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/utils/bundle.json b/utils/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..c00355b2ff681b17206dbb41ef0614010bd8cce4 --- /dev/null +++ b/utils/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/utils", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "公共基础库存放鸿蒙通用的基础组件。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/utils &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "utils" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "utils" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-a,liteos-m", + "board": "hi3516,hi3518,hi3861" + } +} \ No newline at end of file diff --git a/wifi_iot_sample_app/LICENSE b/wifi_iot_sample_app/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/wifi_iot_sample_app/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/wifi_iot_sample_app/README.md b/wifi_iot_sample_app/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8178c76d627cade75005b40711b92f4177bc6cfc --- /dev/null +++ b/wifi_iot_sample_app/README.md @@ -0,0 +1 @@ +readme diff --git a/wifi_iot_sample_app/bundle.json b/wifi_iot_sample_app/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..6eea9e726181cb33e9258a656a40d88270c22e5c --- /dev/null +++ b/wifi_iot_sample_app/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/wifi_io_sample_app", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "wifi_io_sample_app", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/applications/sample/wifi-iot &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "sample" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "application" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-m", + "board": "hi3861" + } +} \ No newline at end of file diff --git a/wlan/LICENSE b/wlan/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/wlan/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/wlan/README.md b/wlan/README.md new file mode 100644 index 0000000000000000000000000000000000000000..04c37b4599d07be42691d9293732ec8b7cf25b02 --- /dev/null +++ b/wlan/README.md @@ -0,0 +1,241 @@ +# WLAN 驱动开发 + +## 简介 + +WLAN 是目前比较主流的接入方式,WLAN本身业务较为复杂,驱动代码量大,技术门槛相对较高,同时对芯片厂家高度依赖。HDF基于WLAN的业务特点,设计组件化的驱动开发框架,建立不同框架体系下一致的WIFI抽象,并以相同的规则来约束和规范鸿蒙生态中不同设备形态下WLAN驱动的开发。 + +## 架构 + +一个驱动分配两个大部分,一部分为基于HCS的驱动配置\(图中 **C**\),一部分是WLAN驱动实体(图中A+B)。其中WLAN驱动实体包含2个逻辑模块 + +**A:公共核心驱动部分; B: 模组私有驱动部分**; + +![](http://tools.harmonyos.com/mirrors/hpm-image/wlan_README/figures/zh-cn_image_0000001054807526.png) + +组件A&组件A与周边的关系 + +![](http://tools.harmonyos.com/mirrors/hpm-image/wlan_README/figures/zh-cn_image_0000001054647537.png) + +## 目录 + +表1:源码路径 + + + + + + + + + + + + + + + + + + +

路径

+

描述

+

drivers\hdf\frameworks\model\network\wifi

+

wlan 模型,包含模型入口以及简单组件,netDevice

+

vendor\huawei\hdf\huawei_proprietary\wifi

+

wlan 驱动实体,CoreDriver部分,包含wlan 模型实例

+

vendor\huawei\hdf\libs\hi35xxxx

+

wlan 驱动实体,ChipDriver部分

+

vendor\hisi\hi35xx\hi35xxxx\config\wifi

+

HCS配置部分

+
+ +## 使用 + +1. WLAN 模型可以根据源码进行开发,CoreDriver 可以根据HCS配置组装。 + +**表 1** WLAN 组件管理接口 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

头文件

+

接口名称

+

功能描述

+

wifi_module.h

+

+

struct WifiModule *WifiModuleCreate(const struct HdfConfigWifiModuleConfig *config);

+

基于HDF开发WIFI驱动时,创建一个WIFI Module。

+

void WifiModuleDelete(struct WifiModule *module);

+

基于HDF开发WIFI驱动时,删除并释放WIFI Module所有数据。

+

int32_t DelFeature(struct WifiModule *module, uint16_t featureType);

+

基于HDF开发WIFI驱动时,从 WIFI Module 删除一个功能组件。

+

int32_t AddFeature(struct WifiModule *module, uint16_t featureType, struct WifiFeature *featureData);

+

基于HDF开发WIFI驱动时,注册一个功能组件到 WIFI Module。

+

wifi_mac80211_ops.h

+

int32_t (*startVap)(NetDevice *netDev);

+

启动AP。

+

int32_t (*stopVap)(NetDevice *netDev);

+

停止AP。

+

int32_t (*connect)(NetDevice *netDev, WifiConnectParams *param);

+

开始连接。

+

int32_t (*disconnect)(NetDevice *netDev, uint16_t reasonCode);

+

断开连接。

+

hdf_netbuf.h

+

void NetBufQueueInit(struct NetBufQueue *q);

+

初始化net buffer队列。

+

struct NetBuf *NetBufDevAlloc(uint32_t size);

+

申请net buffer。

+

void NetBufFree(struct NetBuf *nb);

+

释放net buffer。

+

struct NetBuf *Pbuf2NetBuf(const struct NetDevice *netdev, struct pbuf *lwipBuf);

+

lwip的pbuf转换为net buffer。

+

struct pbuf *NetBuf2Pbuf(const struct NetBuf *nb);

+

net buffer转换为lwip的pbuf。

+
+ +**表 2** 需要开发人员实现的接口 + + + + + + + + + + + + + + + + + + + + + + + + + + + +

头文件

+

接口名称

+

功能描述

+

net_device.h

+

int32_t (*init)(struct NetDevice *netDev);

+

初始化net device。

+

struct NetDevStats *(*getStats)(struct NetDevice *netDev);

+

获取net device的状态。

+

int32_t (*setMacAddr)(struct NetDevice *netDev, void *addr);

+

设置mac地址。

+

void (*deInit)(struct NetDevice *netDev);

+

注销net device。

+

int32_t (*open)(struct NetDevice *netDev);

+

打开net device。

+

int32_t (*stop)(struct NetDevice *netDev);

+

关闭net device。

+
+ +2.上层业务接口 + +3.对上业务功能 + +Wi-Fi驱动模块对HAL层开发人员提供的接口功能有:建立/关闭Wi-Fi热点、扫描Wi-Fi、开始关联、断开连接等等 + +**表 3** 上层业务接口 + + + + + + + + + + + + + + + + + + + + + + + + + + + +

头文件

+

接口名称

+

功能描述

+

hdf_wifi_cmd.h

+

ErrorCode WifiHalScan(const RequestContext *context, const DataBlock *reqData, DataBlock *rspData);

+

启动扫描。

+

ErrorCode WifiHalSetAp(const RequestContext *context, const DataBlock *reqData, DataBlock *rspData);

+

设置AP启动参数。

+

ErrorCode WifiHalStopAp(const RequestContext *context, const DataBlock *reqData, DataBlock *rspData);

+

关闭AP模式。

+

ErrorCode WifiHalSendEapol(const RequestContext *context, const DataBlock *reqData, DataBlock *rspData);

+

发送EAPOL帧。

+

ErrorCode WifiHalReceiveEapol(const RequestContext *context, const DataBlock *reqData, DataBlock *rspData);

+

接收EAPOL帧。

+

ErrorCode WifiHalStaRemove(const RequestContext *context, const DataBlock *reqData, DataBlock *rspData);

+

删除STA

+
+ +Wi-Fi驱动模块提供了驱动开发人员可直接调用的能力接口,主要功能有:创建/释放Wi-Fi Module、关联/取消关联、申请/释放net buf、开始关联、lwip的pbuf和netbuf的相互转换等等。 + diff --git a/wlan/bundle.json b/wlan/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..4ed8e8c4ed03f9c903acfb2d8e4edbd87b9f0bc6 --- /dev/null +++ b/wlan/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/wlan", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "WLAN 是目前比较主流的接入方式,WLAN本身业务较为复杂,驱动代码量大,技术门槛相对较高,同时对芯片厂家高度依赖。HDF基于WLAN的业务特点,设计组件化的驱动开发框架,建立不同框架体系下一致的WIFI抽象,并以相同的规则来约束和规范鸿蒙生态中不同设备形态下WLAN驱动的开发。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/foundation/communication &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "wlan" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "foundation" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-m", + "board": "hi3861" + } +} \ No newline at end of file diff --git a/wpa_supplicant/LICENSE b/wpa_supplicant/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/wpa_supplicant/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/wpa_supplicant/README.md b/wpa_supplicant/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a9f806967bf9ea157532a8fbc98559db6ddb48c2 --- /dev/null +++ b/wpa_supplicant/README.md @@ -0,0 +1,56 @@ +wpa_supplicant and hostapd +-------------------------- + +Copyright (c) 2002-2019, Jouni Malinen and contributors +All Rights Reserved. + +These programs are licensed under the BSD license (the one with +advertisement clause removed). + +If you are submitting changes to the project, please see CONTRIBUTIONS +file for more instructions. + + +This package may include either wpa_supplicant, hostapd, or both. See +README file respective subdirectories (wpa_supplicant/README or +hostapd/README) for more details. + +Source code files were moved around in v0.6.x releases and compared to +earlier releases, the programs are now built by first going to a +subdirectory (wpa_supplicant or hostapd) and creating build +configuration (.config) and running 'make' there (for Linux/BSD/cygwin +builds). + + +License +------- + +This software may be distributed, used, and modified under the terms of +BSD license: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name(s) of the above-listed copyright holder(s) nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/wpa_supplicant/bundle.json b/wpa_supplicant/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..916ab30d05f7990a3a3d46103f7496cbfc2c857e --- /dev/null +++ b/wpa_supplicant/bundle.json @@ -0,0 +1,24 @@ +{ + "name": "@ohos/wpa_supplicant", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "wpa_supplicant", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/wpa_supplicant&&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "thirdparty", + "wpasupplicant" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file diff --git a/xts/LICENSE b/xts/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/xts/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/xts/README.md b/xts/README.md new file mode 100644 index 0000000000000000000000000000000000000000..62b1a5d6b837950ed1f9858b99bb8866fc4138c2 --- /dev/null +++ b/xts/README.md @@ -0,0 +1,435 @@ +# XTS认证子系统 + +## 简介 + +XTS是OpenHarmony生态认证测试套件的集合,当前包括acts(application compatibility test suite)应用兼容性测试套,后续会拓展dcts(device compatibility test suite)设备兼容性测试套等。 + +test/xts仓当前包括acts与tools软件包: + +- acts,存放acts相关测试用例源码与配置文件,其目的是帮助终端设备厂商尽早发现软件与OpenHarmony的不兼容性,确保软件在整个开发过程中满足OpenHarmony的兼容性要求。 +- tools,提供acts编写与编译所依赖的测试用例开发框架。 + +## 目录 + +test/xts源代码目录结构: + +├── acts + +│ ├── BUILD.gn 测试用例编译配置 + +│ └── A测试子系统\_lite A测试子系统测试用例源码 + +│ └── B测试子系统\_lite B测试子系统测试用例源码 + +└── tools + +│ └── build 测试用例编译相关的模板与脚本 + +│ └── hcpptest 智慧视觉类设备(Ipcamera)测试用例开发框架源码 + +│ └── hctest 联接类模组测试用例开发框架源码 + +│ └── BUILD.gn 工具编译配置 + +│ └── build.sh 编译入口 + +## 约束 + +联接类模组acts用例开发语言是C,智慧视觉类设备(Ipcamera)acts用例开发语言是C++。 + +## 编写联接类模组acts测试用例 + +当前使用的测试框架是hctest测试框架。 + +hctest测试框架支持使用C语言编写测试用例,在联接类模组上执行,是在开源测试框架unity的基础上进行增强和适配。 + +**1,用例目录规范:测试用例存储到test/xts/acts仓中。** + +├── acts + +│ ├── BUILD.gn + +│ └──测试子系统\_lite + +│ │ └── 测试模块\_hal + +│ │ │ └── BUILD.gn + +│ │ │ └── src 存放测试用例源码 + +**2,src目录下用例编写样例:** + +(1)引用测试框架 + +``` +#include "hctest.h" +``` + +(2)使用宏定义LITE\_TEST\_SUIT定义子系统、模块、测试套件名称 + +``` +/** +* @tc.name: register a test suit named "IntTestSuite" +* @param: test subsystem name +* @param: example module name +* @param: IntTestSuite test suit name +*/ +LITE_TEST_SUIT(test, example, IntTestSuite); +``` + +(3)定义Setup与TearDown + +命名方式:测试套件名称+Setup,测试套件名称+TearDown。 + +Setup与TearDown必须存在可以为空函数。 + +(4)使用宏定义LITE\_TEST\_CASE写测试用例 + +包括三个参数:测试套件名称,测试用例名称,用例级别。 + +用例级别取值为如下内容之一: + +“Level0”,“Level1”,“Level2”,“Level3”,“Level4”。 + +``` +LITE_TEST_CASE(IntTestSuite, TestCase001, Level0) +{ + //do something +}; +``` + +**备注:** + +用例级别说明: + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

级别名称

+

基本定义

+

测试范围

+

Level0

+

冒烟

+

验证关键功能点基本功能/最基本DFX属性在最常见输入下的表现,通过表示功能基本可运行。

+

Level1

+

基本

+

验证各功能点基本功能/基本DFX属性在常见输入下的表现,通过表示功能基本可测试。

+

Level2

+

重要

+

验证各功能点的基本功能/基本DFX属性在常规输入/常见异常情况下的表现,通过表示功能基本正常可用,可开展Beta。

+

Level3

+

一般

+

验证各功能点的全部功能/全部DFX属性在各种常规/非常规输入组合下,或各种正常/异常预置条件组合下的表现。

+

Level4

+

生僻

+

验证关键功能点在极端异常预置条件下、用户难以触及的异常输入组合下的表现。

+
+ +(5)使用宏定义 RUN\_TEST\_SUITE注册测试套件; + +``` +RUN_TEST_SUITE(IntTestSuite); +``` + +**3,测试模块的配置文件样例:(BUILD.gn)** + +每个测试模块目录下新建BUILD.gn编译文件,用于指定编译后静态库的名称、依赖的头文件、依赖的库等;具体写法如下: + +``` +import("//test/xts/tools/build/suite_lite.gni") +hctest_suite("ActsDemoTest") { + suite_name = "acts" + sources = [ + "src/test_demo.c", + ] + include_dirs = [ ] + cflags = [ "-Wno-error" ] +} +``` + +**4,acts下BUILD.gn增加编译选项** + +如何将编写的测试代码加入到版本编译中,需要将测试模块加入到acts目录下的编译脚本中,编译脚本为:test/xts/acts/BUILD.gn。 + +``` +lite_component("acts") { + ... + if(board_name == "liteos_riscv") { + features += [ + ... + "//xts/acts/测试子系统_lite/测试模块_hal:ActsDemoTest" + ] + } +} +``` + +**5,测试套件编译命令** + +1\) 命令:python build.py wifiiot -b debug + +2\) 输出:out/wifiiot + +备注:联接类模组acts测试编译中间件为静态库,最终会链接到版本镜像中 :Hi3861\_wifiiot\_app\_allinone.bin; + +## 编写智慧视觉类设备(Ipcamera)acts测试用例 + +hcpptest测试框架是在开源的googletest测试框架的基础上进行的增强和适配。 + +**1,用例目录规范:测试用例存储到test/xts/acts仓中。** + +├── acts + +│ ├── BUILD.gn + +│ └──测试子系统\_lite + +│ │ └── 测试模块\_posix + +│ │ │ └── BUILD.gn + +│ │ │ └── src 存放测试用例源码 + +**2,测试模块src下用例编写样例:** + +(1)引用测试框架: + +需要引用gtest.h 如:\#include "gtest/gtest.h" + +``` +#include "gtest/gtest.h" +``` + +(2)定义Setup与TearDown + +``` +class TestSuite: public testing::Test { +protected: +// SetUpTestCase:测试套预置动作,在第一个TestCase之前执行 +static void SetUpTestCase(void){ +} +// TearDownTestCase:测试套清理动作,在最后一个TestCase之后执行 +static void TearDownTestCase(void){ +} +// 用例的预置动作 +virtual void SetUp() +{ +} +// 用例的清理动作 +virtual void TearDown() +{ +} +}; +``` + +(3)使用宏定义HWTEST或HWTEST\_F写测试用例 + +普通测试用例的定义:HWTEST(测试套名称, 测试用例名称, 用例标注)。 + +包含SetUp和TearDown的测试用例的定义 :HWTEST\_F(测试套名称, 测试用例名称,用例标注)。 + +其他参考上面表格支持的宏定义。 + +宏定义包括三个参数:测试套件名称,测试用例名称,用例级别。 + +用例级别取值为如下内容之一: + +“Level0”,“Level1”,“Level2”,“Level3”,“Level4”。 + +``` +HWTEST_F(TestSuite, TestCase_0001, Level0) { +// do something +} +``` + +**备注:** + +用例级别说明: + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

级别名称

+

基本定义

+

测试范围

+

Level0

+

冒烟

+

验证关键功能点基本功能/最基本DFX属性在最常见输入下的表现,通过表示功能基本可运行。

+

Level1

+

基本

+

验证各功能点基本功能/基本DFX属性在常见输入下的表现,通过表示功能基本可测试。

+

Level2

+

重要

+

验证各功能点的基本功能/基本DFX属性在常规输入/常见异常情况下的表现,通过表示功能基本正常可用,可开展Beta。

+

Level3

+

一般

+

验证各功能点的全部功能/全部DFX属性在各种常规/非常规输入组合下,或各种正常/异常预置条件组合下的表现。

+

Level4

+

生僻

+

验证关键功能点在极端异常预置条件下、用户难以触及的异常输入组合下的表现。

+
+ +**3,测试模块下用例配置文件样例:(BUILD.gn)** + +每个测试模块目录下新建BUILD.gn编译文件,用于指定编译后可执行文件的名称、依赖的头文件、依赖的库等;具体写法如下。每个测试模块将独立编译成.bin可执行文件, 该文件可直接mount到单板上进行测试。 + +举例: + +``` +import("//test/xts/tools/build/suite_lite.gni") + +hcpptest_suite("ActsDemoTest") { + suite_name = "acts" + sources = [ + "src/TestDemo.cpp" + ] + + include_dirs = [ + "src", + ... + ] + deps = [ + ... + ] + cflags = [ "-Wno-error" ] +} + +``` + +4**,acts目录下增加编译选项(BUILD.gn)** + +如何将编写的测试代码加入到版本编译中,需要将测试模块加入到acts目录下的编译脚本中,编译脚本为:test/xts/acts/BUILD.gn。 + +``` + lite_component("acts") { +... +else if(board_name == "liteos_a") { + features += [ + ... + "//xts/acts/测试子系统_lite/测试模块_posix:ActsDemoTest" + ] + } +} +``` + +**5,测试套件编译命令** + +Ipcamera + +1.1 hi3516dv300 : + +1)命令:python build.py ipcamera\_hi3518ev300 -b debug + +2)输出:out/ipcamera\_hi3518ev300 + +1.2 hi3518ev300: + +1\) 命令:python build.py ipcamera\_hi3516dv300 -b debug + +2)输出:out/ipcamera\_hi3516dv300 + +备注:智慧视觉类设备(Ipcamera)acts独立编译成.bin可执行文件, 该文件可直接mount到单板上进行测试。 + +## 执行联接类模组acts测试用例 + +**1,获取测试大包:** + +请在如下目录获取版本镜像,归档目录:out\\wifiiot\\Hi3861\_wifiiot\_app\_allinone.bin。 + +备注:判断当前版本镜像是否集成acts测试套件方法:在map文件中查看对应.a是否被编译即可,out\\wifiiot\\Hi3861\_wifiiot\_app.map。 + +**2,测试大包烧写:** + +版本镜像烧录进开发板 + +**3,测试步骤:** + +(1)使用串口工具登录开发板,并保存串口打印信息; + +(2)重启设备,查看串口日志; + +**4,测试结果分析指导:** + +(1)基于串口打印日志进行分析; + +(2)每个测试套件执行以:Start to run test suite:开始,以xx Tests xx Failures xx Ignored结束。 + +## 执行智慧视觉类设备(Ipcamera)acts测试用例 + +目前的用例执行采用nfs共享的方式,mount到单板去执行; + +**1,环境搭建** + +1. 使用有限网线或无线将Ipcamera开发板与PC进行连接。 +2. Ipcamera开发板配置IP、子网掩码、网关,确保Ipcamera开发板与PC处于同一个网段。 +3. PC安装nfs服务器并完成注册,启动nfs服务。 +4. Ipcamera开发板配置mount命令,确保Ipcamera开发板可以访问PC端的nfs共享文件。 + + 格式:mount \[nfs服务器IP\]:\[/nfs共享目录\] \[/Ipcamera开发板目录\] nfs + + 举例: + + ``` + mount 192.168.1.10:/nfs /nfs nfs + ``` + + +**2,用例执行** + +(1)基于串口打印日志进行分析; + +(2)每个测试套件执行以./测试模块.bin 触发用例执行。 + +## 涉及仓 + +xts\_acts + +xts\_tools\_lite + diff --git a/xts/bundle.json b/xts/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..cd76b7e8da67d9acacac41f021774190c526791c --- /dev/null +++ b/xts/bundle.json @@ -0,0 +1,23 @@ +{ + "name": "@ohos/xts", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "XTS是OpenHarmony生态认证测试套件的集合,当前包括acts(application compatibility test suite)应用兼容性测试套,后续会拓展dcts(device compatibility test suite)设备兼容性测试套等。", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/test &&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "xts" + ], + "license": "Apache V2", + "repository": "", + "homepage": "", + "tags": [ + "test" + ], + "ohos": { + "os": "1.0.0", + "kernel": "liteos-m,liteos-a", + "board": "hi3516,hi3518,hi3861" + } +} \ No newline at end of file diff --git a/zlib/LICENSE b/zlib/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/zlib/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/zlib/README.md b/zlib/README.md new file mode 100644 index 0000000000000000000000000000000000000000..51106de4753292ad59de03de9e634e6814eeb7a2 --- /dev/null +++ b/zlib/README.md @@ -0,0 +1,115 @@ +ZLIB DATA COMPRESSION LIBRARY + +zlib 1.2.11 is a general purpose data compression library. All the code is +thread safe. The data format used by the zlib library is described by RFCs +(Request for Comments) 1950 to 1952 in the files +http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and +rfc1952 (gzip format). + +All functions of the compression library are documented in the file zlib.h +(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example +of the library is given in the file test/example.c which also tests that +the library is working correctly. Another example is given in the file +test/minigzip.c. The compression library itself is composed of all source +files in the root directory. + +To compile all files and run the test program, follow the instructions given at +the top of Makefile.in. In short "./configure; make test", and if that goes +well, "make install" should work for most flavors of Unix. For Windows, use +one of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use +make_vms.com. + +Questions about zlib should be sent to , or to Gilles Vollant + for the Windows DLL version. The zlib home page is +http://zlib.net/ . Before reporting a problem, please check this site to +verify that you have the latest version of zlib; otherwise get the latest +version and check whether the problem still exists or not. + +PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help. + +Mark Nelson wrote an article about zlib for the Jan. 1997 +issue of Dr. Dobb's Journal; a copy of the article is available at +http://marknelson.us/1997/01/01/zlib-engine/ . + +The changes made in version 1.2.11 are documented in the file ChangeLog. + +Unsupported third party contributions are provided in directory contrib/ . + +zlib is available in Java using the java.util.zip package, documented at +http://java.sun.com/developer/technicalArticles/Programming/compression/ . + +A Perl interface to zlib written by Paul Marquess is available +at CPAN (Comprehensive Perl Archive Network) sites, including +http://search.cpan.org/~pmqs/IO-Compress-Zlib/ . + +A Python interface to zlib written by A.M. Kuchling is +available in Python 1.5 and later versions, see +http://docs.python.org/library/zlib.html . + +zlib is built into tcl: http://wiki.tcl.tk/4610 . + +An experimental package to read and write files in .zip format, written on top +of zlib by Gilles Vollant , is available in the +contrib/minizip directory of zlib. + + +Notes for some targets: + +- For Windows DLL versions, please see win32/DLL_FAQ.txt + +- For 64-bit Irix, deflate.c must be compiled without any optimization. With + -O, one libpng test fails. The test works in 32 bit mode (with the -n32 + compiler flag). The compiler bug has been reported to SGI. + +- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works + when compiled with cc. + +- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is + necessary to get gzprintf working correctly. This is done by configure. + +- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with + other compilers. Use "make test" to check your compiler. + +- gzdopen is not supported on RISCOS or BEOS. + +- For PalmOs, see http://palmzlib.sourceforge.net/ + + +Acknowledgments: + + The deflate format used by zlib was defined by Phil Katz. The deflate and + zlib specifications were written by L. Peter Deutsch. Thanks to all the + people who reported problems and suggested various improvements in zlib; they + are too numerous to cite here. + +Copyright notice: + + (C) 1995-2017 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +If you use the zlib library in a product, we would appreciate *not* receiving +lengthy legal documents to sign. The sources are provided for free but without +warranty of any kind. The library has been entirely written by Jean-loup +Gailly and Mark Adler; it does not include third-party code. + +If you redistribute modified sources, we would appreciate that you include in +the file ChangeLog history information documenting your changes. Please read +the FAQ for more information on the distribution of modified source versions. diff --git a/zlib/bundle.json b/zlib/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..2d2106b9a23076ac842e31778834303ae3451fbe --- /dev/null +++ b/zlib/bundle.json @@ -0,0 +1,24 @@ +{ + "name": "@ohos/zlib", + "version": "1.8.0", + "publishAs": "code-segment", + "description": "zlib 1.2.11 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files", + "scripts": { + "install": "DEST_PATH=${DEP_BUNDLE_BASE}/third_party/zlib&&mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH" + }, + "keywords": [ + "thirdparty", + "zlib" + ], + "license": "Apache V2", + "repository": "", + "homepage": "https://github.com/madler/zlib/archive/v1.2.11.zip", + "tags": [ + "third_party" + ], + "ohos": { + "os": "1.0.0", + "kernel": "", + "board": "" + } +} \ No newline at end of file