• Home
Name Date Size #Lines LOC

..--

frameworks/12-May-2024-1,7471,352

hals/12-May-2024-24533

interfaces/kits/12-May-2024-35294

LICENSED12-May-202410.1 KiB177150

README.mdD12-May-20243.2 KiB8560

README_zh.mdD12-May-20242.9 KiB8560

bundle.jsonD12-May-20242 KiB8280

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/ota_lite
17├── frameworks        # OTA update implementation, including update package parsing, verification, writing, and updating
18│   └── test          # Self-test code
19│   └── unittest      # Unit test code
20│   └── source        # updater module source code
21│       └── updater   # updater module code
22│       └── verify    # Verification algorithm code
23├── interfaces
24│   └── kits          # External APIs for OTA update
25├── hals              # Chip adaptation code, for example, HiSilicon chip adaptation code is located at device\hisilicon\hardware\update
26```
27
28## Constraints<a name="section1718733212019"></a>
29
30The 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.
31
32## Usage<a name="section18867101215181"></a>
33
34Add the dependency on the update subsystem. The following uses the Hi3516D V300 development board as an example.
35
36-   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**:
37
38    ```
39    {
40            "subsystem": "update",
41            "components": [
42              { "component": "hota", "features": [] }
43            ]
44     },
45    ```
46
47
48-   Add the  **update.json**  file to the  **build\\lite\\components**  directory.
49
50    ```
51    "components": [
52        {
53          "component": "hota",
54          "description": "",
55          "optional": "false",
56          "dirs": [
57            "base/update/ota_lite/frameworks",
58            "base/update/ota_lite/interfaces/kits"
59          ],
60          "targets": [
61            "//base/update/ota_lite/frameworks:ota_lite"
62          ],
63    ...
64    ```
65
66
67-   Add test code. For example, add  **subsystem\_test**  to the  **base\\update\\ota\_lite\\frameworks\\BUILD.gn**  file.
68
69-   Run the following commands to compile the system. You can experience the OTA update function after flashing the system to the Hi3516 chip.
70
71    ```
72    hb set
73    hb build
74    ```
75
76
77## Repositories Involved<a name="section68521336131912"></a>
78
79[Update subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/update.md)
80
81**update\_ota\_lite**
82
83[device\_hisilicon\_hardware](https://gitee.com/openharmony/device_hisilicon_hardware/blob/master/README.md)
84
85

README_zh.md

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