3 Star 0 Fork 3

OpenHarmony / distributedschedule_dms_fwk_lite

Create your Gitee Account
Explore and code with more than 8 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

NOTICE

The distributedschedule_dms_fwk_lite repository is renamed ability_dmsfwk_lite since July 2022. The distributedschedule_dms_fwk_lite repository is archived and no longer maintained.

To obtain the latest code, go to the dmsfwk_lite repository.

dms_fwk_lite

Introduction

The Distributed Scheduler is used for cross-device component management. It allows the local device to access or control remote components, and enables application collaboration in distributed scenarios. The following figure shows the modules in the Distributed Scheduler.

Directory Structure

The following table describes the directory structure of the Distributed Scheduler.

Table 1 Directory structure of the major source code

Directory

Description

dmsfwk_lite

Implementation of the Distributed Scheduler

safwk_lite

Implementation of the foundation process

The source code directory structure of the Distributed Scheduler is as follows:

├── BUILD.gn
├── include
│  ├── dmslite.h        # Header file for the open APIs provided by the Distributed Scheduler
│  ├── dmslite_check_remote_permission.h     # Header file for the permission management module of the Distributed Scheduler
│  ├── dmslite_famgr.h                       # Header file for the FA management module of the Distributed Scheduler
│  ├── dmslite_inner_common.h                # Internal common file for the Distributed Scheduler
│  ├── dmslite.h                             # Header file for the implementation of the Distributed Scheduler Service (also called the Distributed Manager Service)
│  ├── dmslite_log.h                         # Header file for the log module
│  ├── dmslite_parser.h                  # Header file for the distributed message parsing module
│  ├── dmslite_tlv_common.h                  # Header file for the TLV data parsing module
│  └── dmslite_session.h                     # Header file for the inter-device communication module
├── 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

Constraints

Programming language: C/C++

Networking environment: The primary and secondary devices must be on the same LAN and can ping each other.

Operating system: OpenHarmony

Limitations and constraints on remote startup:

  • Only Feature Abilities (FAs) can be started remotely. Remote startup is unavailable to abilities using the Service template.
  • Before the remote startup, ensure that the distributed networking between the primary and secondary devices is successful. Otherwise, the remote startup fails.

Usage

  • Compiling and Building the Distributed Scheduler

The code of the Distributed Scheduler is stored in the following directory:

foundation/ability/dmsfwk_lite

When compiling and building the code for a specific platform, you need to specify the target platform.

hb build
  • Primary device development (taking FA startup as an example)

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.

import ohos.aafwk.ability.Ability;
import ohos.aafwk.content.Want;
import ohos.bundle.ElementName;

// Create a Want instance that will be passed to the startAbility method.
Want want = new Want();
ElementName name = new ElementName(remote_device_id, "ohos.dms.remote_bundle_name", "remote_ability_name"); 
want.setElement(name); // Add information about the target FA for startup to the Want instance.
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.

// Start the remote FA on the secondary device.
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 the IDE, use the parameter name and type in the IDE.
  • Prerequisites

The target FA with the specified bundle name must have been installed on the secondary device.

  • Execution (taking FA startup as an example)

Call the startAbility method on the primary device to start the target FA on the secondary device.

Repositories Involved

[Distributed Scheduler subsystem]

dmsfwk_lite

About

Implementation code of the Distributed Scheduler | 分布式调度模块 expand collapse
C and 2 more languages
Apache-2.0
Cancel

Releases

No release

OpenHarmony

Contributors

All

Activities

Load More
can not load any more
1
https://gitee.com/openharmony/distributedschedule_dms_fwk_lite.git
git@gitee.com:openharmony/distributedschedule_dms_fwk_lite.git
openharmony
distributedschedule_dms_fwk_lite
distributedschedule_dms_fwk_lite
master

Search

10d9f8b4 4838521 8bde8327 4838521