• Home
Name Date Size #Lines LOC

..--

figures/12-May-2024-

frameworks/12-May-2024-1,7461,351

hals/12-May-2024-26933

interfaces/kits/12-May-2024-35294

LICENSED12-May-202410.1 KiB177150

README.mdD12-May-20243.2 KiB8661

README_zh.mdD12-May-20243.4 KiB9666

bundle.jsonD12-May-20242 KiB8078

README.md

1# OTA<a name="EN-US_TOPIC_0000001078451366"></a>
2
3-   [Introduction](#section11660541593)
4-   [Directory Structure](#section1464106163817)
5-   [Constraints](#section1718733212019)
6-   [Usage](#section18867101215181)
7-   [Repositories Involved](#section68521336131912)
8
9## Introduction<a name="section11660541593"></a>
10
11Over the Air \(OTA\) provides the remote device update capability. Your devices will be able to support OTA update after secondary development based on the provided APIs. By providing unified update APIs externally, the update subsystem shields the differences of underlying chips.
12
13## Directory Structure<a name="section1464106163817"></a>
14
15```
16/base/update/sys_installer_lite
17.
18├── frameworks         # OTA update implementation, including update package parsing, verification, writing, and updating
19│   ├── source         # updater module source code
20│   │   ├── updater    # updater module code
21│   │   └── verify     # Verification algorithm code
22│   └── test           # Self-test code
23│       └── unittest   # Unit test code
24├── hals               # Chip adaptation code
25└── interfaces         # External APIs
26    └── kits           # OTA update APIs
27```
28
29## Constraints<a name="section1718733212019"></a>
30
31The update subsystem is compiled using the C language. Currently, only the Hi3518EV300, Hi3516DV300, and Hi3861 development boards are supported. If you want to support devices that use other chips, you can implement the OpenHarmony integration APIs in the  **vendor**  directory. Currently, only the full-package update is supported.
32
33## Usage<a name="section18867101215181"></a>
34
35Add the dependency on the update subsystem. The following uses the Hi3516D V300 development board as an example.
36
37-   Add  **update**  to the  **subsystem\_list field in the vendor\\hisilicon\\ipcamera\_hi3516dv300\_liteos\\config.json**  file, and add the following code under  **subsystem\_list**:
38
39    ```
40    {
41            "subsystem": "update",
42            "components": [
43              { "component": "hota", "features": [] }
44            ]
45     },
46    ```
47
48
49-   Add the  **update.json**  file to the  **build\\lite\\components**  directory.
50
51    ```
52    "components": [
53        {
54          "component": "hota",
55          "description": "",
56          "optional": "false",
57          "dirs": [
58            "base/update/sys_installer_lite/frameworks",
59            "base/update/sys_installer_lite/interfaces/kits"
60          ],
61          "targets": [
62            "//base/update/sys_installer_lite/frameworks:sys_installer_lite"
63          ],
64    ...
65    ```
66
67
68-   Add test code. For example, add  **subsystem\_test**  to the  **base\\update\\ota\_lite\\frameworks\\BUILD.gn**  file.
69
70-   Run the following commands to compile the system. You can experience the OTA update function after flashing the system to the Hi3516 chip.
71
72    ```
73    hb set
74    hb build
75    ```
76
77
78## Repositories Involved<a name="section68521336131912"></a>
79
80[Update subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/update.md)
81
82**update\_ota\_lite**
83
84[device\_hisilicon\_hardware](https://gitee.com/openharmony/device_hisilicon_hardware/blob/master/README.md)
85
86

README_zh.md

1# OTA组件<a name="ZH-CN_TOPIC_0000001078451366"></a>
2
3-   [简介](#section11660541593)
4-   [目录](#section1464106163817)
5-   [约束](#section1718733212019)
6-   [说明](#section18867101215181)
7    -   [使用说明](#section18867101215200)
8
9-   [相关仓](#section68521336131912)
10
11## 简介<a name="section11660541593"></a>
12
13OTA(Over the Air)提供对设备远程升级能力,基于提供的接口进行二次开发后,可以让您的设备轻松支持OTA升级能力。升级子系统对用户屏蔽了底层芯片的差异,对外提供了统一的升级接口。
14
15更多升级子系统相关概念,请参考:[升级子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/%E5%8D%87%E7%BA%A7%E5%AD%90%E7%B3%BB%E7%BB%9F.md)
16
17**图 1**  升级子系统架构图
18
19![](figures/Openharmony-updater-升级子系统架构图.png)
20
21## 目录<a name="section1464106163817"></a>
22
23```
24/base/update/sys_installer_lite
25.
26├── frameworks         # OTA升级实现,主要包括升级包解析验证、写入、升级的功能
27│   ├── source         # updater组件代码存放目录
28│   │   ├── updater    # updater组件代码目录
29│   │   └── verify     # 效验算法代码目录
30│   └── test           # 自测试代码存放目录
31│       └── unittest   # 单元测试代码存放目录
32├── hals               # 芯片适配层
33└── interfaces         # 对外接口存放目录
34    └── kits           # OTA升级接口
35```
36
37## 约束<a name="section1718733212019"></a>
38
39升级子系统使用C语言编写,目前支持Hi3518EV300、Hi3516DV300、Hi3861开发板。如果您想接入其它芯片,通过实现vendor路径下的OpenHarmony集成接口,可以适配不同芯片的产品。目前仅支持全量包升级方式。
40
41## 说明<a name="section18867101215181"></a>
42
43### 使用说明<a name="section18867101215200"></a>
44
45添加对升级子系统的依赖,以hi3516dv300开发板为例。
46
47-   vendor\\hisilicon\\ipcamera\_hi3516dv300\_liteos\\config.json中添加update,在subsystem\_list字段下面添加:
48
49    ```
50    {
51            "subsystem": "update",
52            "components": [
53              { "component": "hota", "features": [] }
54            ]
55     },
56    ```
57
58
59-   在build\\lite\\components下,添加update.json文件:
60
61    ```
62    "components": [
63        {
64          "component": "hota",
65          "description": "",
66          "optional": "false",
67          "dirs": [
68            "base/update/sys_installer_lite/frameworks",
69            "base/update/sys_installer_lite/interfaces/kits"
70          ],
71          "targets": [
72            "//base/update/sys_installer_lite/frameworks:sys_installer_lite"
73          ],
74      ......
75    ```
76
77
78-   添加测试代码,这里以test为例,将subsystem\_test加入到base\\update\\ota\_lite\\frameworks\\BUILD.gn中。
79
80-   添加完上述的配置后,执行如下命令编译整个系统,烧录到3516芯片平台上即可体验OTA功能。
81
82    ```
83    hb set
84    hb build
85    ```
86
87
88## 相关仓<a name="section68521336131912"></a>
89
90[升级子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/%E5%8D%87%E7%BA%A7%E5%AD%90%E7%B3%BB%E7%BB%9F.md)
91
92[**update\_sys\_installer\_lite**](https://gitee.com/openharmony/update_sys_installer_lite)
93
94[device\_hisilicon\_hardware](https://gitee.com/openharmony/device_hisilicon_hardware)
95
96