Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 17-Mar-2025 | - | ||||
figures/ | H | 17-Mar-2025 | - | |||
include/ | H | 17-Mar-2025 | - | 820 | 455 | |
interfaces/innerkits/ | H | 17-Mar-2025 | - | 79 | 55 | |
moduletest/dtbschedmgr_lite/ | H | 17-Mar-2025 | - | 659 | 429 | |
source/ | H | 17-Mar-2025 | - | 1,716 | 1,336 | |
BUILD.gn | H A D | 17-Mar-2025 | 2.8 KiB | 83 | 72 | |
LICENSE | H A D | 17-Mar-2025 | 10.1 KiB | 177 | 150 | |
OAT.xml | H A D | 17-Mar-2025 | 6.2 KiB | 88 | 37 | |
README.md | H A D | 17-Mar-2025 | 4.1 KiB | 106 | 72 | |
README_zh.md | H A D | 17-Mar-2025 | 4.5 KiB | 124 | 88 | |
bundle.json | H A D | 17-Mar-2025 | 1.6 KiB | 55 | 54 |
README.md
1# dmsfwk_lite 2 3## Introduction 4 5The Lite Distributed Ability Manager Service Framework (dmsfwk_lite) component provides the capability of starting Feature Abilities (FAs) across devices and supports application collaboration in distributed scenarios. The following figure shows the architecture of dmsfwk_lite. 6 7 8 9## Directory Structure 10 11The table below describes the directory structure of the dmsfwk_lite source code. 12 13**Table 1** Directory structure of the major source code 14 15| Directory | Description | 16| ----------- | -------------------- | 17| dmsfwk_lite | Implementation of dmsfwk_lite| 18 19The source code directory structure of dmsfwk_lite is as follows: 20 21``` 22├── BUILD.gn 23├── include 24│ ├── dmslite.h # Header file for the open APIs provided by dmsfwk_lite 25│ ├── dmslite_check_remote_permission.h # Header file for the permission management module of dmsfwk_lite 26│ ├── dmslite_famgr.h # Header file for the FA management module of dmsfwk_lite 27│ ├── dmslite_inner_common.h # Internal common file of dmsfwk_lite 28│ ├── dmslite.h # Header file for the implementation of the dmsfwk_lite service 29│ ├── dmslite_log.h # Header file for the log module 30│ ├── dmslite_parser.h # Header file for the distributed message parsing module 31│ ├── dmslite_tlv_common.h # Header file for the TLV data parsing module 32│ └── dmslite_session.h # Header file for the inter-device communication module 33├── readme.md 34├── LICENSE 35├── source 36 ├── distributed_schedule_service.c 37 ├── dmslite.c 38 ├── dmslite_check_remote_permission.c 39 ├── dmslite_famgr.c 40 ├── dmslite_msg_parser.c 41 ├── dmslite_tlv_common.c 42 └── dmslite_session.c 43``` 44 45## Constraints 46 47**Programming language**: C/C++ 48 49**Networking environment**: The local and remote devices must be on the same LAN and can ping each other. 50 51**Operating system**: OpenHarmony 52 53**Remote startup**: 54 55- Only FAs can be started remotely. 56- Before the remote startup, ensure that the distributed networking between the local and remote devices is successful. Otherwise, the remote startup fails. 57 58## Usage 59 60- **Building** 61 62 The code of dmsfwk_lite is stored in the following directory: 63 64 ``` 65 foundation/ability/dmsfwk_lite 66 ``` 67 68 When building the code for a specific platform, you must specify the target platform. 69 70 ``` 71 hb build 72 ``` 73 74- **Local device development** (taking FA startup as an example) 75 76 Create a **Want** instance to set the remote device ID, bundle name, and ability class name of the target FA and set the **Want.FLAG\_ABILITYSLICE\_MULTI\_DEVICE** flag to enable distributed startup. 77 78 ``` 79 import ohos.aafwk.ability.Ability; 80 import ohos.aafwk.content.Want; 81 import ohos.bundle.ElementName; 82 83 // Create a Want instance that will be passed to the startAbility method. 84 Want want = new Want(); 85 ElementName name = new ElementName(remote_device_id, "ohos.dms.remote_bundle_name", "remote_ability_name"); 86 want.setElement(name); // Add information about the target FA to the Want instance. 87 want.setFlags(Want.FLAG_ABILITYSLICE_MULTI_DEVICE); // Set the multi-device startup flag. If this flag is not set, remote FA startup will be unavailable. 88 89 // Start the remote FA on the remote device. 90 startAbility(want); // Start the specified FA based on the want parameter. If the name and type of the want parameter are different from those used in DevEco Studio, use the parameter name and type in DevEco Studio. 91 ``` 92 93- **Prerequisites** 94 95 The target FA with the specified bundle name must have been installed on the remote device. 96 97- **Execution** (taking FA startup as an example) 98 99 Call the **startAbility** method on the local device to start the target FA on the remote device. 100 101## Repositories Involved 102 103dmsfwk_lite 104 105[**dmsfwk\_lite**](https://gitee.com/openharmony/ability_dmsfwk_lite) 106
README_zh.md
1# 轻量级分布式组件管理部件<a name="ZH-CN_TOPIC_0000001128264105"></a> 2 3- [简介](#section11660541593) 4- [目录](#section1464106163817) 5- [约束](#section1718733212019) 6- [使用](#section10729231131110) 7- [相关仓](#section176111311166) 8 9## 简介<a name="section11660541593"></a> 10 11轻量级分布式组件管理模块负责跨设备启动FA的能力,支持分布式场景下的应用协同。轻量级分布式调度模块组成如下图所示: 12 13 14 15## 目录<a name="section1464106163817"></a> 16 17轻量级分布式组件管理源代码目录结构如下表所示: 18 19**表1**主要源代码目录结构 20 21<a name="table43531856201716"></a> 22<table><thead align="left"><tr id="row20416556201718"><th class="cellrowborder" valign="top" width="50%" id="mcps1.1.3.1.1"><p id="p10416456121716"><a name="p10416456121716"></a><a name="p10416456121716"></a>名称</p> 23</th> 24<th class="cellrowborder" valign="top" width="50%" id="mcps1.1.3.1.2"><p id="p1841645631717"><a name="p1841645631717"></a><a name="p1841645631717"></a>描述</p> 25</th> 26</tr> 27</thead> 28<tbody><tr id="row64161056151718"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p4160914132218"><a name="p4160914132218"></a><a name="p4160914132218"></a>dmsfwk_lite</p> 29</td> 30<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p541645611177"><a name="p541645611177"></a><a name="p541645611177"></a>轻量级分布式组件管理</p> 31</td> 32</tr> 33</tbody> 34</table> 35 36其中轻量级分布式组件管理的源代码目录结构如下: 37 38``` 39├── BUILD.gn 40├── include 41│ ├── dmslite.h # 轻量级分布式组件管理对外接口 42│ ├── dmslite_check_remote_permission.h # 轻量级分布式组件管理权限管理模块 43│ ├── dmslite_famgr.h # 轻量级分布式组件管理FA管理模块 44│ ├── dmslite_inner_common.h # 轻量级分布式组件管理内部通用文件 45│ ├── dmslite.h # 轻量级分布式组件管理服务实现 46│ ├── dmslite_log.h # 日志模块 47│ ├── dmslite_parser.h # 分布式消息解析模块 48│ ├── dmslite_tlv_common.h # TLV格式数据解析模块 49│ └── dmslite_session.h # 跨设备通信收发模块 50├── readme.md 51├── LICENSE 52├── source 53 ├── distributed_schedule_service.c 54 ├── dmslite.c 55 ├── dmslite_check_remote_permission.c 56 ├── dmslite_famgr.c 57 ├── dmslite_msg_parser.c 58 ├── dmslite_tlv_common.c 59 └── dmslite_session.c 60``` 61 62## 约束<a name="section1718733212019"></a> 63 64**语言限制**:C/C++语言 65 66**组网环境**:必须确保设备在同一个局域网中,主从设备能互相ping通 67 68**操作系统限制**:OpenHarmony操作系统 69 70**远程启动的约束与限制:** 71 72- 支持远程启动FA 73- 远程启动前必须确保主设备与从设备间分布式组网成功,否则无法远程启动 74 75## 使用<a name="section10729231131110"></a> 76 77- **轻量级分布式组件管理模块编译** 78 79轻量级分布式组件管理模块,其代码所在目录如下: 80 81``` 82foundation/ability/dmsfwk_lite 83``` 84 85在针对不同平台进行编译时,需要提前指定目标平台: 86 87``` 88hb build 89``` 90 91- **主设备程序开发**(以拉起FA为例) 92 93构造意图参数want,设置需要启动的远端设备ID,包名,元能力类名信息,以及分布式标志位Want.FLAG\_ABILITYSLICE\_MULTI\_DEVICE以使能分布式启动 94 95``` 96import ohos.aafwk.ability.Ability; 97import ohos.aafwk.content.Want; 98import ohos.bundle.ElementName; 99 100// 构造want参数 101Want want = new Want(); 102ElementName name = new ElementName(remote_device_id, "ohos.dms.remote_bundle_name", "remote_ability_name"); 103want.setElement(name); // 将待启动的FA信息添加到Want中 104want.setFlags(Want.FLAG_ABILITYSLICE_MULTI_DEVICE); // 设置分布式标记,若不设置将无法使用分布式能力 105 106// 启动远程设备FA 107startAbility(want); // 按照Want启动指定FA,want参数命名以实际开发平台API为准 108``` 109 110- **预置条件** 111 112从设备侧需安装对应包名的FA 113 114- **运行**(以拉起FA为例) 115 116执行主设备侧的startAbility即可拉起从设备FA 117 118## 相关仓<a name="section176111311166"></a> 119 120轻量级分布式组件管理 121 122[**dmsfwk\_lite**](https://gitee.com/openharmony/ability_dmsfwk_lite) 123 124