# openharmony_dsoftbus **Repository Path**: fragile_xia/openharmony_dsoftbus ## Basic Information - **Project Name**: openharmony_dsoftbus - **Description**: 基于ohos2.0分布式软总线模块(dsoftbus)x86适配和相关原理解读。 - **Primary Language**: C++ - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 5 - **Forks**: 1 - **Created**: 2023-03-30 - **Last Updated**: 2025-08-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 分布式软总线 ### 介绍 - 本仓库以开源鸿蒙操作系统为基础,对其中的分布式软总线模块(**dsoftbus**)适配移植(**x86架构**)和相关原理解读和分析。 - 以ohos2.0为基础进行研究,主要原因有如下几点 - ohos2.0实现了完整的分布式通信子系统功能。 - ohos2.0代码较为精简,可读性强。 - ohos2.0可从官网直接获取,并且版本经过测试较为稳定。 ### 使用说明 ```bash interface # 接口相关文档 repo # dsoftbus源码 test # 测试文档 build # 构建文件 README.md # 使用文档 writeups # 原理性研究 ``` ### 构建方法 #### 1.进入build文件夹 ```bash cd build ``` #### 2.选择你需要构建的版本复制到软总线目录上 ```bash cp ./build/xx ./repo/. ``` #### 3.进行构建 ``` bash make make install ``` #### 4.进行测试demo.c(以ohos1.0接口为例) ```bash g++ ./test/demo.c -g -fPIC -Wall -D__LINUX -o -Wno-deprecated demo ``` #### 5.运行demo程序 ![image-20221104105507913](https://gitee.com/fragile_xia/git_test/raw/master/11.4/54.png) - 鸿蒙手机开启发现服务![image-20221104105723866](https://gitee.com/fragile_xia/git_test/raw/master/11.4/55.png) - linux主机成功发现鸿蒙手机! #### 6.捕获linux主机发往鸿蒙手机的报文 ![](C:\Users\jack\AppData\Roaming\Typora\typora-user-images\image-20221104144921989.png) - 解析数据部分得到的结果如下: ```c ip: 192.168.9.80 device_discover { {"deviceId": "BB480B16128D1F62 E8BCA0F3D9C1AFE2 ..."}, "devicename": "DEV_L1", "type": "242", "hicomversion": "", "mode":0, "deviceHash":"0", "serviceData": "", "port:37475,01", "wlanIp":"192.168.9.60", "capabilityBitmap":[64]} }. ``` #### 7.尝试获取设备号 ![](https://gitee.com/fragile_xia/git_test/raw/master/3.30/1_1.png) ![](https://gitee.com/fragile_xia/git_test/raw/master/3.30/1_2.png) ### 参与贡献 - Fork 本仓库 - 新建 Feat_xxx 分支 - 提交代码 - 新建 Pull Request