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