• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# DSoftBus<a name="EN-US_TOPIC_0000001090266209"></a>
2
3## Introduction<a name="section11660541593"></a>
4
5The DSoftBus subsystem provides communication capabilities for OpenHarmony, including WLAN, Bluetooth, DSoftBus, and remote procedure call \(RPC\).
6
7WLAN: basic WLAN functions, peer-to-peer \(P2P\) connection, and WLAN notification, enabling your application to communicate with other devices through a WLAN
8
9Bluetooth: classic Bluetooth and Bluetooth Low Energy \(BLE\)
10
11DSoftBus: distributed communications between near-field devices, and device discovery, connection setup, networking, and data transmission capabilities regardless of communication modes
12
13RPC: communications between processes on a device or across devices
14
15## Architecture<a name="section342962219551"></a>
16
17**Figure  1**  DSoftBus subsystem architecture<a name="fig4460722185514"></a>
18
19
20![](figures/dsoftbus.png)
21
22## Directory Structure<a name="section161941989596"></a>
23
24The main code directory structure of the DSoftBus subsystem is as follows:
25
26```
27/foundation/communication
28├── bluetooth       # Bluetooth code
29├── dsoftbus        # DSoftBus code
30├── ipc             # IPC code
31└── wifi            # WLAN code
32```
33
34## Constraints<a name="section119744591305"></a>
35
36-   Networking: Devices must be in the same LAN.
37
38## Usage Guidelines<a name="section1312121216216"></a>
39
40### RPC<a name="section129654513264"></a>
41
42In RPC, the requesting process \(client\) can obtain the proxy of the process that provides the service \(server\). Through the proxy, the two processes can communicate with each other.
43
441.  Implement the server and its capabilities.
452.  To be more specific, the client obtains a proxy of the server. This proxy provides the same capabilities as the server. Then the client can call a method of the server by accessing the corresponding method of the proxy. The proxy forwards the request to the server.
463.  The server processes the received request and returns the result to the proxy via the driver.
474.  The proxy returns the result to the client.
48
49### DSoftBus<a name="section36252592710"></a>
50
51-   Networking
52
531.  After the service is started, obtain the list of online devices.
542.  Register a listener for device status changes.
553.  Obtain the device ID, name, and type.
564.  Obtain extended information about the device, such as the device type, networking type, and device capability.
575.  Delete the registered listener.
58
59-   Transmission
60
611.  Create a session server and register a callback.
622.  After a device goes online, open a session with the device.
633.  Send data through the session.
644.  Close the session if you no longer need it.
655.  Remove the created session server if you no longer want to use distributed transmission \(such as exiting the process\).
66
67## Repositories Involved<a name="section1371113476307"></a>
68
69**DSoftBus subsystem**
70
71[communication\_bluetooth](https://gitee.com/openharmony/communication_bluetooth)
72
73[communication\_dsoftbus](https://gitee.com/openharmony/communication_dsoftbus)
74
75[communication\_ipc](https://gitee.com/openharmony/communication_ipc)
76
77[communication\_wifi](https://gitee.com/openharmony/communication_wifi)
78
79