diff --git a/dsoftbus/OhOeCommunication/OpenHarmonyAppSample/entry/src/main/cpp/include/discovery_service.h b/dsoftbus/OhOeCommunication/OpenHarmonyAppSample/entry/src/main/cpp/include/discovery_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..6df0583f8524eb09008c94e60af16c7ad4dd4c23
--- /dev/null
+++ b/dsoftbus/OhOeCommunication/OpenHarmonyAppSample/entry/src/main/cpp/include/discovery_service.h
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef DISCOVERY_SERVICE_H
+#define DISCOVERY_SERVICE_H
+
+#include "softbus_common.h"
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C" {
+#endif
+#endif
+
+/**
+ * @brief Indicates the maximum length of the device address in IDiscoveryCallback.
+ *
+ */
+#define CONNECT_ADDR_LEN 46
+
+/**
+ * @brief Enumerates error codes for service publishing failures.
+ *
+ * The error codes are returned to the caller through IPublishCallback.
+ *
+ */
+typedef enum {
+ /* Unsupported medium */
+ PUBLISH_FAIL_REASON_NOT_SUPPORT_MEDIUM = 1,
+ /* internal error */
+ PUBLISH_FAIL_REASON_INTERNAL = 2,
+ /* Unknown reason */
+ PUBLISH_FAIL_REASON_UNKNOWN = 0xFF
+} PublishFailReason;
+
+/**
+ * @brief Defines the callbacks for successful and failed service publishing.
+ *
+ */
+typedef struct {
+ /** Callback for successful publishing */
+ void (*OnPublishSuccess)(int publishId);
+ /** Callback for failed publishing */
+ void (*OnPublishFail)(int publishId, PublishFailReason reason);
+} IPublishCallback;
+
+/**
+ * @brief Enumerates error codes for service subscription failures.
+ *
+ * The error codes are returned to the caller through IDiscoveryCallback.
+ *
+ */
+typedef enum {
+ /* Unsupported medium */
+ DISCOVERY_FAIL_REASON_NOT_SUPPORT_MEDIUM = 1,
+ /* internal error */
+ DISCOVERY_FAIL_REASON_INTERNAL = 2,
+ /* Unknown error */
+ DISCOVERY_FAIL_REASON_UNKNOWN = 0xFF
+} DiscoveryFailReason;
+
+/**
+ * @brief Defines a callback for service subscription.
+ *
+ * Three types of callbacks are available.
+ *
+ */
+typedef struct {
+ /** Callback that is invoked when a device is found */
+ void (*OnDeviceFound)(const DeviceInfo *device);
+ /** Callback for a subscription failure */
+ void (*OnDiscoverFailed)(int subscribeId, DiscoveryFailReason failReason);
+ /** Callback for a subscription success */
+ void (*OnDiscoverySuccess)(int subscribeId);
+} IDiscoveryCallback;
+
+/**
+ * @brief Publishes a specified service.
+ *
+ * Peer devices in the same LAN as the device that publishes this service can discover this service as needed.
+ * The service is identified by publicId and pkgName.
+ *
+ * @param pkgName Indicates the pointer to the service package name, which can contain a maximum of 64 bytes.
+ * @param info Indicates the pointer to the service publishing information. For details, see {@link PublishInfo}.
+ * @param cb Indicates the pointer to the service publishing callback {@link IPublishCallback}.
+ * @return Returns SOFTBUS_INVALID_PARAM if any parameter is null or invalid.
+ * @return Returns SOFTBUS_DISCOVER_NOT_INIT if the Intelligent Soft Bus client fails to be initialized.
+ * @return Returns SOFTBUS_LOCK_ERR if the mutex fails to be locked.
+ * @return Returns SOFTBUS_OK if the service is successfully published.
+ */
+int PublishService(const char *pkgName, const PublishInfo *info, const IPublishCallback *cb);
+
+/**
+ * @brief Unpublishes a specified service.
+ *
+ * @param pkgName Indicates the pointer to the service package name, which can contain a maximum of 64 bytes.
+ * @param publishId Indicates the service ID.
+ * @return Returns SOFTBUS_INVALID_PARAM if pkgName is invalid.
+ * @return Returns SOFTBUS_DISCOVER_NOT_INIT if the Intelligent Soft Bus client fails to be initialized.
+ * @return Returns SOFTBUS_OK if the service is successfully unpublished.
+ */
+int UnPublishService(const char *pkgName, int publishId);
+
+/**
+ * @brief Subscribes to a specified service.
+ *
+ * Information about the device that publishes the service will be reported to the device that subscribes to
+ * the service.
+ * The service is identified by subscribeId and pkgName.
+ *
+ * @param pkgName Indicates the pointer to the service package name, which can contain a maximum of 64 bytes.
+ * @param info Indicates the pointer to the service subscription information. For details, see {@link SubscribeInfo}.
+ * @param cb Indicates the service subscription callback {@link IDiscoveryCallback}.
+ * @return Returns SOFTBUS_INVALID_PARAM if any parameter is null or invalid.
+ * @return Returns SOFTBUS_DISCOVER_NOT_INIT if the Intelligent Soft Bus client fails to be initialized.
+ * @return Returns SOFTBUS_LOCK_ERR if the mutex fails to be locked.
+ * @return Returns SOFTBUS_OK if the service subscription is successful.
+ */
+int StartDiscovery(const char *pkgName, const SubscribeInfo *info, const IDiscoveryCallback *cb);
+
+/**
+ * @brief Unsubscribes from a specified service.
+ *
+ * @param pkgName Indicates the pointer to the service package name, which can contain a maximum of 64 bytes.
+ * @param subscribeId Indicates the service ID.
+ * @return Returns SOFTBUS_INVALID_PARAM if pkgName is invalid.
+ * @return Returns SOFTBUS_DISCOVER_NOT_INIT if the Intelligent Soft Bus client fails to be initialized.
+ * @return Returns SOFTBUS_OK if the service unsubscription is successful.
+ */
+int StopDiscovery(const char *pkgName, int subscribeId);
+
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* __cplusplus */
+
+#endif /* DISCOVERY_SERVICE_H */
diff --git a/dsoftbus/OhOeCommunication/OpenHarmonyAppSample/entry/src/main/cpp/include/session.h b/dsoftbus/OhOeCommunication/OpenHarmonyAppSample/entry/src/main/cpp/include/session.h
new file mode 100644
index 0000000000000000000000000000000000000000..a590c04645cd5d35810b9ea817a6ef2165a7aa6c
--- /dev/null
+++ b/dsoftbus/OhOeCommunication/OpenHarmonyAppSample/entry/src/main/cpp/include/session.h
@@ -0,0 +1,434 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @addtogroup Softbus
+ * @{
+ *
+ * @brief Provides high-speed, secure communication between devices.
+ *
+ * This module implements unified distributed communication capability management between
+ * nearby devices, and provides link-independent device discovery and transmission interfaces
+ * to support service publishing and data transmission.
+ *
+ * @since 1.0
+ * @version 1.0
+*/
+
+/**
+ * @file session.h
+ *
+ * @brief Declares unified data transmission interfaces.
+ *
+ * This file provides data transmission capabilities, including creating and removing a session server,
+ * opening and closing sessions, receiving data, and querying basic session information. \n
+ * After multiple nearby devices are discovered and networked, these interfaces can be used to
+ * transmit data across devices. \n
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+#ifndef SESSION_H
+#define SESSION_H
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/**
+ * @brief business type of session
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef enum {
+ TYPE_MESSAGE = 1,
+ TYPE_BYTES,
+ TYPE_FILE,
+ TYPE_STREAM,
+ TYPE_BUTT,
+} SessionType;
+
+typedef enum {
+ INVALID = -1,
+ /*
+ * Send any segment of a frame each time.
+ */
+ RAW_STREAM,
+ /*
+ * Send a whole video frame each time.
+ */
+ COMMON_VIDEO_STREAM,
+ /*
+ * Send a whole audio frame each time.
+ */
+ COMMON_AUDIO_STREAM,
+ /*
+ * Slice frame mode.
+ */
+ VIDEO_SLICE_STREAM,
+} StreamType;
+
+typedef enum {
+ LINK_TYPE_WIFI_WLAN_5G = 1,
+ LINK_TYPE_WIFI_WLAN_2G = 2,
+ LINK_TYPE_WIFI_P2P = 3,
+ LINK_TYPE_BR = 4,
+ LINK_TYPE_MAX = 4,
+} LinkType;
+
+/**
+ * @brief session attribute.
+ *
+ * control the attribute of session.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef struct {
+ /** @brief dataType{@link SessionType} */
+ int dataType;
+ int linkTypeNum;
+ LinkType linkType[LINK_TYPE_MAX];
+ union {
+ struct StreamAttr {
+ int streamType;
+ } streamAttr;
+ } attr;
+} SessionAttribute;
+
+typedef struct {
+ char *buf;
+ int bufLen;
+} StreamData;
+
+typedef struct {
+ int type;
+ int64_t value;
+} TV;
+
+typedef struct {
+ int frameType;
+ int64_t timeStamp;
+ int seqNum;
+ int seqSubNum;
+ int level;
+ int bitMap;
+ int tvCount;
+ TV *tvList;
+} StreamFrameInfo;
+
+typedef enum {
+ QOS_IMPROVE = 0,
+ QOS_RECOVER = 1
+} QosQuality;
+
+typedef enum {
+ TRANS_STREAM_QUALITY_EVENT = 1,
+ TRANS_CHANNEL_QUALITY_EVENT,
+ TRANS_CAN_DELAY_EVENT,
+ TRANS_CANT_DELAY_EVENT,
+ QOS_EVENT_MAX
+} QosEvent;
+
+typedef enum {
+ WIFI_CHANNEL_QUALITY = 1,
+ FRAME_REALTIME_STATUS = 2,
+ BANDWIDTH_ESTIMATE_VALUE = 3,
+ JITTER_DETECTION_VALUE = 4,
+ STREAM_TRAFFIC_STASTICS = 5,
+} TransEnumEventType;
+
+typedef struct {
+ int32_t channel;
+ int32_t score;
+} WifiChannelQuality;
+
+typedef struct {
+ int32_t streamId;
+ int32_t seqNum;
+ int32_t level;
+ int32_t transStatus;
+ int32_t interval;
+} FrameStatus;
+
+typedef struct {
+ uint32_t trend;
+ uint32_t rate; /* kbps */
+} BandwidthDetection;
+
+typedef struct {
+ int32_t jitterLevel;
+ uint32_t bufferTime; /* ms */
+} JitterEstimation;
+
+typedef struct {
+ uint64_t statisticsGotTime; /* time point that stream traficc statistics are obtained (ms) */
+ uint64_t periodRecvBits;
+ uint32_t pktNum;
+ uint32_t periodRecvPkts;
+ uint32_t periodRecvPktLoss;
+ uint32_t periodRecvRate; /* kbps */
+ uint64_t periodRecvRateBps; /* bps */
+ uint32_t periodRtt; /* ms */
+ uint32_t periodRecvPktLossHighPrecision; /* for example when lost rate is 1.10%, then 110 will returned */
+ uint32_t periodSendLostPkts;
+ uint32_t periodSendPkts;
+ uint32_t periodSendPktLossHighPrecision; /* for example when lost rate is 1.10%, then 110 will returned */
+ uint64_t periodSendBits;
+ uint64_t periodSendRateBps; /* bps */
+} StreamStatistics;
+
+typedef struct {
+ TransEnumEventType type;
+ union {
+ WifiChannelQuality wifiChannelInfo;
+ FrameStatus frameStatusInfo;
+ BandwidthDetection bandwidthInfo;
+ JitterEstimation jitterInfo;
+ StreamStatistics appStatistics;
+ } info;
+} QosTv;
+
+/**
+ * @brief Defines session callbacks.
+ *
+ * When a session is opened or closed, or there is data to process, the related callback is invoked.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef struct {
+ /**
+ * @brief Called when a session is opened.
+ *
+ * This function can be used to verify the session or initialize resources related to the session.
+ *
+ * @param sessionId Indicates the session ID.
+ * @param result 0 if the session is opened successfully, returns an error code otherwise.
+ * @return Returns 0 if the session connection is accepted; returns a non-zero value
+ * otherwise (you do not need to call {@link CloseSession} to close the session).
+ * @since 1.0
+ * @version 1.0
+ */
+ int (*OnSessionOpened)(int sessionId, int result);
+
+ /**
+ * @brief Called when a session is closed.
+ *
+ * This function can be used to release resources related to the session.
+ * You do not need to call {@link CloseSession}.
+ *
+ * @param sessionId Indicates the session ID.
+ * @since 1.0
+ * @version 1.0
+ */
+ void (*OnSessionClosed)(int sessionId);
+
+ /**
+ * @brief Called when data is received.
+ *
+ * This function is used to notify that data is received.
+ *
+ * @param sessionId Indicates the session ID.
+ * @param data Indicates the pointer to the data received.
+ * @param dataLen Indicates the length of the data received.
+ * @since 1.0
+ * @version 1.0
+ */
+ void (*OnBytesReceived)(int sessionId, const void *data, unsigned int dataLen);
+
+ /**
+ * @brief Called when message is received.
+ *
+ * This function is used to notify that message is received.
+ *
+ * @param sessionId Indicates the session ID.
+ * @param data Indicates the pointer to the message data received.
+ * @param dataLen Indicates the length of the message received.
+ * @since 1.0
+ * @version 1.0
+ */
+ void (*OnMessageReceived)(int sessionId, const void *data, unsigned int dataLen);
+
+ void (*OnStreamReceived)(int sessionId, const StreamData *data, const StreamData *ext,
+ const StreamFrameInfo *param);
+
+ /**
+ * @brief Called when QoS information is retrieved.
+ *
+ * This function is used to notify that QoS information is retrieved.
+ *
+ * @param sessionId Indicates the session ID.
+ * @param eventId Indicates the type of QoS information, e.g., channel quality and stream quality
+ * @param tvCount Indicates the number of structure returned in the fourth parameters, i.e., tvList.
+ * @param tvList Indicates the detailed information of data transmission.
+ * @since 1.0
+ * @version 1.0
+ */
+ void (*OnQosEvent)(int sessionId, int eventId, int tvCount, const QosTv *tvList);
+} ISessionListener;
+
+typedef struct {
+ int (*OnReceiveFileStarted)(int sessionId, const char *files, int fileCnt);
+ int (*OnReceiveFileProcess)(int sessionId, const char *firstFile, uint64_t bytesUpload, uint64_t bytesTotal);
+ void (*OnReceiveFileFinished)(int sessionId, const char *files, int fileCnt);
+ void (*OnFileTransError)(int sessionId);
+} IFileReceiveListener;
+
+typedef struct {
+ int (*OnSendFileProcess)(int sessionId, uint64_t bytesUpload, uint64_t bytesTotal);
+ int (*OnSendFileFinished)(int sessionId, const char *firstFile);
+ void (*OnFileTransError)(int sessionId);
+} IFileSendListener;
+
+/**
+ * @brief Creates a session server based on a package name and session name.
+ *
+ * A maximum of 18 session servers can be created.
+ *
+ * @param pkgName Indicates the pointer to the package name, which can be used to check whether the
+ * session server is in this package. The value cannot be empty and can contain a maximum of 64 characters.
+ * @param sessionName Indicates the pointer to the session name, which is the unique ID of the session server.
+ * The value cannot be empty and can contain a maximum of 64 characters.
+ * @param listener Indicates the pointer to the session callback structure, which cannot be empty.
+ * @return Returns 0 if the operation is successful; returns -1 otherwise.
+ * @see RemoveSessionServer
+ * @since 1.0
+ * @version 1.0
+ */
+int CreateSessionServer(const char *pkgName, const char *sessionName, const ISessionListener *listener);
+
+/**
+ * @brief Removes a session server based on a package name and session name.
+ *
+ * @param pkgName Indicates the pointer to the name of the registered package, which can be used to check
+ * whether the session server is in this package. The value cannot be empty and can contain a maximum of 64 characters.
+ * @param sessionName Indicates the pointer to the session name. The value cannot be empty and can contain
+ * a maximum of 64 characters.
+ * @return Returns 0 if the operation is successful, returns -1 otherwise.
+ * @see CreateSessionServer
+ * @since 1.0
+ * @version 1.0
+ */
+int RemoveSessionServer(const char *pkgName, const char *sessionName);
+
+/**
+ * @brief Initiate a session open request, which is an asynchronous process.
+ *
+ * The session connection is opened based on the service name to trigger the first packet interaction process.
+ * According to the {@link OnSessionOpened} Notify the user whether the session is successfully opened.
+ * Data can be transmitted only after the session is successfully opened.
+ *
+ * @param mySessionName local session name.
+ * @param peerSessionName remote session name.
+ * @param peerDeviceId remote device id.
+ * @param groupId group id.
+ * @param attr session attribute {@link SessionAttribute}.
+ * @return return sessionId if the session is opened successfully, returns an error code otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+int OpenSession(const char *mySessionName, const char *peerSessionName, const char *peerDeviceId,
+ const char *groupId, const SessionAttribute* attr);
+
+/**
+ * @brief Closes a connected session based on a session ID.
+ *
+ * @param sessionId Indicates the session ID.
+ * @return no return value.
+ * @since 1.0
+ * @version 1.0
+ */
+void CloseSession(int sessionId);
+
+/**
+ * @brief Sends data based on a session ID.
+ *
+ * @param sessionId Indicates the session ID.
+ * @param data Indicates the pointer to the data to send, which cannot be NULL.
+ * @param len Indicates the length of the data to send. The maximum length cannot exceed 984 characters.
+ * @return Returns 0 if the function is called successfully; returns -1 otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+int SendBytes(int sessionId, const void *data, unsigned int len);
+
+/**
+ * @brief Sends message based on a session ID.
+ *
+ * @param sessionId Indicates the session ID.
+ * @param data Indicates the pointer to the message data to send, which cannot be NULL.
+ * @param len Indicates the length of the message to send.
+ * @return Returns 0 if the function is called successfully, returns an error code otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+int SendMessage(int sessionId, const void *data, unsigned int len);
+
+int SendStream(int sessionId, const StreamData *data, const StreamData *ext, const StreamFrameInfo *param);
+
+/**
+ * @brief Obtains the session name registered by the local device based on the session ID.
+ *
+ * @param sessionId Indicates the session ID.
+ * @param sessionName Indicates the pointer to the buffer for storing the session name.
+ * @param len Indicates the length of the buffer.
+ * @return Returns 0 if the operation is successful; returns -1 otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+int GetMySessionName(int sessionId, char *sessionName, unsigned int len);
+
+/**
+ * @brief Obtains the session name registered by the peer device based on the session ID.
+ *
+ * @param sessionId Indicates the session ID.
+ * @param sessionName Indicates the pointer to the buffer for storing the session name.
+ * @param len Indicates the length of the buffer.
+ * @return Returns 0 if the operation is successful; returns -1 otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+int GetPeerSessionName(int sessionId, char *sessionName, unsigned int len);
+
+/**
+ * @brief Obtains the peer device ID based on a session ID.
+ *
+ * @param sessionId Indicates the session ID.
+ * @param devId Indicates the pointer to the buffer for storing the device ID.
+ * @param len Indicates the length of the buffer.
+ * @return Returns 0 if the operation is successful; returns -1 otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+int GetPeerDeviceId(int sessionId, char *devId, unsigned int len);
+
+int GetSessionSide(int sessionId);
+
+int SetFileReceiveListener(const char *pkgName, const char *sessionName,
+ const IFileReceiveListener *recvListener, const char *rootDir);
+
+int SetFileSendListener(const char *pkgName, const char *sessionName, const IFileSendListener *sendListener);
+
+int SendFile(int sessionId, const char *sFileList[], const char *dFileList[], uint32_t fileCnt);
+
+int32_t QosReport(int32_t sessionId, int32_t appType, int32_t quality);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // SESSION_H
diff --git a/dsoftbus/OhOeCommunication/OpenHarmonyAppSample/entry/src/main/cpp/include/softbus_bus_center.h b/dsoftbus/OhOeCommunication/OpenHarmonyAppSample/entry/src/main/cpp/include/softbus_bus_center.h
new file mode 100644
index 0000000000000000000000000000000000000000..f26b925baacb1eb7dce57807a273835aae14f92b
--- /dev/null
+++ b/dsoftbus/OhOeCommunication/OpenHarmonyAppSample/entry/src/main/cpp/include/softbus_bus_center.h
@@ -0,0 +1,649 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @addtogroup Softbus
+ * @{
+ *
+ * @brief Provides high-speed, secure communication between devices.
+ *
+ * This module implements unified distributed communication capability management between nearby devices, and provides
+ * link-independent device discovery and transmission interfaces to support service publishing and data transmission.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+
+/**
+ * @file softbus_bus_center.h
+ *
+ * @brief Declares functions and constants for the bus center of the Intelligent Soft Bus.
+ *
+ * The functions are used to perform
+ * the following operations: \n
+ *
+ * - Adding a device to and removing a device from a LNN
+ * - Listening for device online, offline, and information change events
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+
+#ifndef SOFTBUS_BUS_CENTER_H
+#define SOFTBUS_BUS_CENTER_H
+
+#include
+#include
+
+#include "softbus_common.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Indicates the length of a device name buffer, including the terminating null character \0.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+#define DEVICE_NAME_BUF_LEN 128
+
+/**
+ * @brief Indicates the mask bit for a device online event.
+ * If you want to receive such events, set the mask bit in {@link INodeStateCb.events}.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+#define EVENT_NODE_STATE_ONLINE 0x1
+
+/**
+ * @brief Indicates the mask bit for a device offline event.
+ * If you want to receive such events, set the mask bit in {@link INodeStateCb.events}.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+#define EVENT_NODE_STATE_OFFLINE 0x02
+
+/**
+ * @brief Indicates the mask bit for a peer device information change event.
+ * If you want to receive such events, set the mask bit in {@link INodeStateCb.events}.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+#define EVENT_NODE_STATE_INFO_CHANGED 0x04
+
+/**
+ * @brief Indicates mask bits for {@link INodeStateCb.events}.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+#define EVENT_NODE_STATE_MASK 0x07
+
+/**
+ * @brief The maximum length of meta node bypass info {@link MetaNodeConfigInfo.bypassInfo}.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+#define META_NODE_BYPASS_INFO_LEN 64
+
+/**
+ * @brief The maximum of meta node {@link MetaNodeConfigInfo.bypassInfo}.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+#define MAX_META_NODE_NUM 3
+
+/**
+ * @brief Enumerates keys for an online device.
+ * The key can be obtained via {@link GetNodeKeyInfo}.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef enum {
+ NODE_KEY_UDID = 0, /**< UDID in string format*/
+ NODE_KEY_UUID, /**< UUID in string format */
+} NodeDeviceInfoKey;
+
+/**
+ * @brief Enumerates accuracy for time synchronize among device.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef enum {
+ LOW_ACCURACY = 10,
+ NORMAL_ACCURACY,
+ HIGH_ACCURACY,
+ SUPER_HIGH_ACCURACY,
+ UNAVAIL_ACCURACY = 0xFFFF,
+} TimeSyncAccuracy;
+
+/**
+ * @brief Enumerates time synchronize period among device.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef enum {
+ SHORT_PERIOD = 0,
+ NORMAL_PERIOD,
+ LONG_PERIOD,
+} TimeSyncPeriod;
+
+/**
+ * @brief Enumerates time synchronize flag.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef enum {
+ NODE_SPECIFIC = 0,
+ ALL_LNN,
+ WRITE_RTC,
+} TimeSyncFlag;
+
+/**
+ * @brief Defines the basic information about a device.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef struct {
+ char networkId[NETWORK_ID_BUF_LEN]; /**< Device ID */
+ char deviceName[DEVICE_NAME_BUF_LEN]; /**< Device name */
+ uint16_t deviceTypeId;
+} NodeBasicInfo;
+
+/**
+ * @brief Enumerates device information change types. For details, see {@link INodeStateCb.onNodeBasicInfoChanged}.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef enum {
+ TYPE_NETWORK_ID = 0, /**< Network ID change */
+ TYPE_DEVICE_NAME, /**< Device name change */
+} NodeBasicInfoType;
+
+/**
+ * @brief time synchronize result.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef struct {
+ int32_t millisecond;
+ int32_t microsecond;
+ TimeSyncAccuracy accuracy;
+} TimeSyncResult;
+
+/**
+ * @brief time synchronize result info.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef struct {
+ TimeSyncResult result;
+ TimeSyncFlag flag;
+ union {
+ char targetNetworkId[NETWORK_ID_BUF_LEN];
+ char masterNetworkId[NETWORK_ID_BUF_LEN];
+ } target;
+} TimeSyncResultInfo;
+
+/**
+ * @brief Enumerates error codes for service publishing failures.
+ *
+ * The error codes are returned to the caller through IPublishCallback.
+ *
+ */
+typedef enum {
+ /* publish success */
+ PUBLISH_LNN_SUCCESS = 0,
+ /* Unsupported medium */
+ PUBLISH_LNN_NOT_SUPPORT_MEDIUM = 1,
+ /* internal error */
+ PUBLISH_LNN_INTERNAL = 2,
+ /* Unknown reason */
+ PUBLISH_LNN_UNKNOWN = 0xFF
+} PublishResult;
+
+/**
+ * @brief Enumerates error codes for service subscription failures.
+ *
+ * The error codes are returned to the caller through IDiscoveryCallback.
+ *
+ */
+typedef enum {
+ /* refresh success */
+ REFRESH_LNN_SUCCESS = 0,
+ /* Unsupported medium */
+ REFRESH_LNN_NOT_SUPPORT_MEDIUM = 1,
+ /* internal error */
+ REFRESH_LNN_INTERNAL = 2,
+ /* Unknown error */
+ REFRESH_LNN_UNKNOWN = 0xFF
+} RefreshResult;
+
+/**
+ * @brief Defines the callbacks for successful and failed service publishing.
+ *
+ */
+typedef struct {
+ /** Callback for publish result */
+ void (*OnPublishResult)(int publishId, PublishResult reason);
+} IPublishCb;
+
+/**
+ * @brief Defines a callback for service subscription.
+ *
+ * Three types of callbacks are available.
+ *
+ */
+typedef struct {
+ /** Callback that is invoked when a device is found */
+ void (*OnDeviceFound)(const DeviceInfo *device);
+ /** Callback for a subscription result */
+ void (*OnDiscoverResult)(int32_t refreshId, RefreshResult reason);
+} IRefreshCallback;
+
+/**
+ * @brief Defines a callback that is invoked when the device state or information changes.
+ * For details, see {@link RegNodeDeviceStateCb}.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef struct {
+ /**
+ * Mask of an event that is listened for.
+ * The event can be received only if the corresponding mask bit is set and the callback is specified.
+ */
+ uint32_t events;
+ /**
+ * @brief Called when a specified device gets online.
+ *
+ * @param info Indicates the pointer to the basic information about the device.
+ * For details, see {@link NodeBasicInfo}.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+ void (*onNodeOnline)(NodeBasicInfo *info);
+ /**
+ * @brief Called when a specified device gets offline.
+ *
+ * @param info Indicates the pointer to the basic information about the device.
+ * For details, see {@link NodeBasicInfo}.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+ void (*onNodeOffline)(NodeBasicInfo *info);
+ /**
+ * @brief Called when the basic information of a device changes.
+ *
+ * @param type Indicates the device type. For details, see {@link NodeBasicInfoType}.
+ * @param info Indicates the pointer to the new basic information of the device.
+ * For details, see {@link NodeBasicInfo}.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+ void (*onNodeBasicInfoChanged)(NodeBasicInfoType type, NodeBasicInfo *info);
+} INodeStateCb;
+
+/**
+ * @brief Defines a callback that is invoked when the time synchronize has result.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef struct {
+ /**
+ * @brief Called when the time synchronize has result.
+ *
+ * @param info Contains the time synchronize result info, see {@link TimeSyncResultInfo}.
+ * @param retCode Indicates the result code. Value 0 indicates that the time synchronize is successful and
+ * result is valid, and any other value indicates the opposite.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+ void (*onTimeSyncResult)(const TimeSyncResultInfo *info, int32_t retCode);
+} ITimeSyncCb;
+
+/**
+ * @brief Defines a meta node configuration, see {@link ActiveMetaNode}.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef struct {
+ char udid[UDID_BUF_LEN];
+ char deviceName[DEVICE_NAME_BUF_LEN];
+ uint16_t deviceTypeId;
+ uint8_t addrNum;
+ ConnectionAddr addr[CONNECTION_ADDR_MAX];
+ char bypassInfo[META_NODE_BYPASS_INFO_LEN];
+} MetaNodeConfigInfo;
+
+/**
+ * @brief Defines a meta node infomation, see {@link GetAllMetaNodeInfo}.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef struct {
+ char metaNodeId[NETWORK_ID_BUF_LEN];
+ bool isOnline;
+ MetaNodeConfigInfo configInfo;
+} MetaNodeInfo;
+
+/**
+ * @brief Called when a device is added to a LNN via {@link JoinLNN}.
+ *
+ * @param addr Indicates the pointer to the address of the peer device.
+ * @param networkId Indicates the pointer to the network ID of the device if it is successfully added to the LNN.
+ * This parameter makes no sense if the device fails to be added to the LNN.
+ * @param retCode Indicates the result code. Value 0 indicates that the device is successfully added to the LNN,
+ * and any other value indicates the opposite.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef void (*OnJoinLNNResult)(ConnectionAddr *addr, const char *networkId, int32_t retCode);
+
+/**
+ * @brief Called when a device is removed from a LNN via {@link LeaveLNN}.
+ *
+ * @param networkId Indicates the pointer to the network ID of the device.
+ * @param retCode Indicates the result code. Value 0 indicates that the device is successfully
+ * removed from the LNN, and any other value indicates the opposite.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef void (*OnLeaveLNNResult)(const char *networkId, int32_t retCode);
+
+/**
+ * @brief Adds the current device to the LNN where a specified device resides.
+ *
+ * @param pkgName Indicates the pointer to the caller ID, for example, the package name.
+ * For the same caller, the value of this parameter must be the same for all functions.
+ * @param target Indicates the pointer to the address of the specified device. For details, see {@link ConnectionAddr}.
+ * @param cb Indicates the callback for the result. If you set this parameter to NULL, you will not receive the result.
+ *
+ * @return Returns 0 if the request to add the device is accepted, and the result can be obtained from the
+ * callback; returns any other value if the device fails to be added to the network, in which case you will not receive
+ * the result.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+int32_t JoinLNN(const char *pkgName, ConnectionAddr *target, OnJoinLNNResult cb);
+
+/**
+ * @brief Removes the current device from the LNN.
+ *
+ * @param networkId Indicates the pointer to the network ID that is returned
+ * after the device is added to the LNN via {@link JoinLNN}.
+ * @param cb Indicates the callback for the result. If you set this parameter to NULL,
+ * you will not receive the result.
+ *
+ * @return Returns 0 if the request to remove the device is accepted, and the result can be obtained from the
+ * callback; returns any other value if the device fails to be removed from the network, in which case you will not
+ * receive the result.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+int32_t LeaveLNN(const char *pkgName, const char *networkId, OnLeaveLNNResult cb);
+
+/**
+ * @brief Registers a callback for device state changes.
+ *
+ * @param pkgName Indicates the pointer to the caller ID, for example, the package name.
+ * For the same caller, the value of this parameter must be the same for all functions.
+ * @param callback Indicates the pointer to the callback to register. For details, see {@link INodeStateCb}.
+ *
+ * @return Returns 0 if the registration is successful; returns any other value otherwise.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+int32_t RegNodeDeviceStateCb(const char *pkgName, INodeStateCb *callback);
+
+/**
+ * @brief Unregisters a callback for device state changes.
+ *
+ * @param callback Indicates the pointer to the callback to unregister. For details, see {@link INodeStateCb}.
+ *
+ * @return Returns 0 if the unregistration is successful; returns any other value otherwise.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+int32_t UnregNodeDeviceStateCb(INodeStateCb *callback);
+
+/**
+ * @brief Obtains basic information about all the online devices.
+ *
+ * @param pkgName Indicates the pointer to the caller ID, for example, the package name.
+ * For the same caller, the value of this parameter must be the same for all functions.
+ * @param info Indicates the double pointer to the memory that stores the obtained basic information.
+ * @param infoNum Indicates the pointer to the number of devices.
+ *
+ * @return Returns 0 if the basic information is obtained, in which case info and infoNum are
+ * valid; returns any other value otherwise.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+int32_t GetAllNodeDeviceInfo(const char *pkgName, NodeBasicInfo **info, int32_t *infoNum);
+
+/**
+ * @brief Releases the memory returned by {@link GetAllNodeDeviceInfo}.
+ *
+ * @param info Indicates the pointer to the memory returned by {@link GetAllNodeDeviceInfo}.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+void FreeNodeInfo(NodeBasicInfo *info);
+
+/**
+ * @brief Obtains basic information about the current device.
+ *
+ * @param pkgName Indicates the pointer to the caller ID, for example, the package name.
+ * For the same caller, the value of this parameter must be the same for all functions.
+ * @param info Indicates the double pointer to the memory that stores the obtained basic information.
+ *
+ * @return Returns 0 if the basic information is obtained, in which case info is valid;
+ * returns any other value otherwise.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+int32_t GetLocalNodeDeviceInfo(const char *pkgName, NodeBasicInfo *info);
+
+/**
+ * @brief Obtains a specified {@link NodeDeviceInfoKey} of an online device.
+ *
+ * @param pkgName Indicates the pointer to the caller ID, for example, the package name.
+ * For the same caller, the value of this parameter must be the same for all functions.
+ * @param networkId Indicates the pointer to the network ID of the device.
+ * @param key Indicates the key to be obtained.
+ * @param info Indicates the pointer to the buffer that stores the obtained key.
+ * @param infoLen Indicates the buffer length.
+ *
+ * @return Returns 0 if the {@link NodeDeviceInfoKey} is obtained, in which case info is valid;
+ * returns any other value otherwise.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+int32_t GetNodeKeyInfo(const char *pkgName, const char *networkId,
+ NodeDeviceInfoKey key, uint8_t *info, int32_t infoLen);
+
+/**
+ * @brief Start the time synchronize with specific target node.
+ *
+ * @param pkgName Indicates the pointer to the caller ID, for example, the package name.
+ * For the same caller, the value of this parameter must be the same for all functions.
+ * @param targetNetworkId Indicates the pointer to the address of the specified device.
+ * @param accuracy Time synchronize accuracy.
+ * @param period Time synchronize period
+ * @param cb Indicates the callback for the result.
+ *
+ * @return Returns 0 if the request is accepted, and the result can be obtained from the
+ * callback; returns any other value if the request fails, in which case you will not receive
+ * the result.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+int32_t StartTimeSync(const char *pkgName, const char *targetNetworkId, TimeSyncAccuracy accuracy,
+ TimeSyncPeriod period, ITimeSyncCb *cb);
+
+/**
+ * @brief Stop the time synchronize with specific target node.
+ *
+ * @param pkgName Indicates the pointer to the caller ID, for example, the package name.
+ * For the same caller, the value of this parameter must be the same for all functions.
+ * @param targetNetworkId Indicates the pointer to the address of the specified device.
+ *
+ * @return Returns 0 if the request is removed; returns any other value if the request fails.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+int32_t StopTimeSync(const char *pkgName, const char *targetNetworkId);
+
+/**
+ * @brief Publishes a specified service.
+ *
+ * Peer devices in the same LAN as the device that publishes this service can discover this service as needed.
+ * The service is identified by publicId and pkgName.
+ *
+ * @param pkgName Indicates the pointer to the service package name, which can contain a maximum of 64 bytes.
+ * @param info Indicates the pointer to the service publishing information. For details, see {@link PublishInfo}.
+ * @param cb Indicates the pointer to the service publishing callback {@link IPublishCallback}.
+ * @return Returns SOFTBUS_INVALID_PARAM if any parameter is null or invalid.
+ * @return Returns SOFTBUS_DISCOVER_NOT_INIT if the Intelligent Soft Bus client fails to be initialized.
+ * @return Returns SOFTBUS_LOCK_ERR if the mutex fails to be locked.
+ * @return Returns SOFTBUS_OK if the service is successfully published.
+ */
+int32_t PublishLNN(const char *pkgName, const PublishInfo *info, const IPublishCb *cb);
+
+/**
+ * @brief stoppublishes a specified service.
+ *
+ * @param pkgName Indicates the pointer to the service package name, which can contain a maximum of 64 bytes.
+ * @param publishId Indicates the service ID.
+ * @return Returns SOFTBUS_INVALID_PARAM if pkgName is invalid.
+ * @return Returns SOFTBUS_DISCOVER_NOT_INIT if the Intelligent Soft Bus client fails to be initialized.
+ * @return Returns SOFTBUS_OK if the service is successfully unpublished.
+ */
+int32_t StopPublishLNN(const char *pkgName, int32_t publishId);
+
+/**
+ * @brief Subscribes to a specified service.
+ *
+ * Information about the device that publishes the service will be reported to the device that subscribes to
+ * the service.
+ * The service is identified by subscribeId and pkgName.
+ *
+ * @param pkgName Indicates the pointer to the service package name, which can contain a maximum of 64 bytes.
+ * @param info Indicates the pointer to the service subscription information. For details, see {@link RefreshInfo}.
+ * @param cb Indicates the service subscription callback {@link IRefreshCallback}.
+ * @return Returns SOFTBUS_INVALID_PARAM if any parameter is null or invalid.
+ * @return Returns SOFTBUS_DISCOVER_NOT_INIT if the Intelligent Soft Bus client fails to be initialized.
+ * @return Returns SOFTBUS_LOCK_ERR if the mutex fails to be locked.
+ * @return Returns SOFTBUS_OK if the service subscription is successful.
+ */
+int32_t RefreshLNN(const char *pkgName, const SubscribeInfo *info, const IRefreshCallback *cb);
+
+/**
+ * @brief Unsubscribes from a specified service.
+ *
+ * @param pkgName Indicates the pointer to the service package name, which can contain a maximum of 64 bytes.
+ * @param refreshId Indicates the service ID.
+ * @return Returns SOFTBUS_INVALID_PARAM if pkgName is invalid.
+ * @return Returns SOFTBUS_DISCOVER_NOT_INIT if the Intelligent Soft Bus client fails to be initialized.
+ * @return Returns SOFTBUS_OK if the service unsubscription is successful.
+ */
+int32_t StopRefreshLNN(const char *pkgName, int32_t refreshId);
+
+/**
+ * @brief Active meta node. The meta node online status will be notified by {@link INodeStateCb}
+ *
+ * @param pkgName Indicates the pointer to the caller ID, for example, the package name.
+ * For the same caller, the value of this parameter must be the same for all functions.
+ * @param info Meta node configuration infomation, see {@link MetaNodeConfigInfo}.
+ * @param metaNodeId Save meta node ID when it is activated successfully, its buffer length must be not
+ * less then NETWORK_ID_BUF_LEN
+ *
+ * @return Returns 0 if the meta node is activated; returns any other value if the request fails.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+int32_t ActiveMetaNode(const char *pkgName, const MetaNodeConfigInfo *info, char *metaNodeId);
+
+/**
+ * @brief Deactive meta node. The meta node will be removed.
+ *
+ * @param pkgName Indicates the pointer to the caller ID, for example, the package name.
+ * For the same caller, the value of this parameter must be the same for all functions.
+ * @param metaNodeId The meta node ID which deactivated, it's obtained by {@link ActiveMetaNode}.
+ *
+ * @return Returns 0 if the meta node is deactivated; returns any other value if the request fails.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+int32_t DeactiveMetaNode(const char *pkgName, const char *metaNodeId);
+
+/**
+ * @brief Get all meta node by {@link ActiveMetaNode}.
+ *
+ * @param pkgName Indicates the pointer to the caller ID, for example, the package name.
+ * For the same caller, the value of this parameter must be the same for all functions.
+ * @param infos The buffer for save meta node info.
+ * @param infoNum The infos buffer num which maximum is {@link MAX_META_NODE_NUM}.
+ *
+ * @return Returns 0 if the call is success; returns any other value if it fails.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+int32_t GetAllMetaNodeInfo(const char *pkgName, MetaNodeInfo *infos, int32_t *infoNum);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/** @} */
\ No newline at end of file
diff --git a/dsoftbus/OhOeCommunication/OpenHarmonyAppSample/entry/src/main/cpp/include/softbus_common.h b/dsoftbus/OhOeCommunication/OpenHarmonyAppSample/entry/src/main/cpp/include/softbus_common.h
new file mode 100644
index 0000000000000000000000000000000000000000..0a00e608a199c56d41fe5f5fd3dc903753a5753f
--- /dev/null
+++ b/dsoftbus/OhOeCommunication/OpenHarmonyAppSample/entry/src/main/cpp/include/softbus_common.h
@@ -0,0 +1,386 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @addtogroup SoftBus
+ * @{
+ *
+ * @brief Provides high-speed, secure communication between devices.
+ *
+ * This module implements unified distributed communication capability management between nearby devices, and provides
+ * link-independent device discovery and transmission interfaces to support service publishing and data transmission.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+
+/**
+ * @file softbus_common.h
+ *
+ * @brief Declares common APIs for the Intelligent Soft Bus.
+ *
+ * This file provides common functions and constants for each submodule of the Intelligent Soft Bus, including: \n
+ *
+ *
+ * - Constants such as the network ID length
+ * - Functions such as that for initializing the Intelligent Soft Bus client
+ *
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+
+#ifndef SOFTBUS_CLIENT_COMMON_H
+#define SOFTBUS_CLIENT_COMMON_H
+
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Indicates the length of the Bluetooth device MAC address in string format,
+ * including the terminating null character \0.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+#define BT_MAC_LEN 18
+
+/**
+ * @brief Indicates the length of the network ID string, including the terminating null character \0.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+#define NETWORK_ID_BUF_LEN 65
+
+/**
+ * @brief Indicates the length of the UDID string, including the terminating null character \0.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+#define UDID_BUF_LEN 65
+
+/**
+ * @brief Indicates the length of the UDID hash value.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+#define UDID_HASH_LEN 32
+
+/**
+ * @brief Indicates the length of the UUID string, including the terminating null character \0.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+#define UUID_BUF_LEN 65
+
+/**
+ * @brief Indicates the maximum length of an IP address in string format,
+ * including the terminating null character \0. IPv6 addresses are supported.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+#define IP_STR_MAX_LEN 46
+
+/**
+ * @brief Indicates the maximum length of the account hash code in IDiscoveryCallback.
+ *
+ */
+#define MAX_ACCOUNT_HASH_LEN 96
+
+/**
+ * @brief Indicates the maximum length of the capability data in PublishInfo and SubscribeInfo.
+ *
+ */
+#define MAX_CAPABILITYDATA_LEN 513
+
+/**
+ * @brief Indicates the maximum length of the custom data in IDiscoveryCallback.
+ *
+ */
+#define DISC_MAX_CUST_DATA_LEN 219
+
+/**
+ * @brief Indicates the maximum number of capabilities contained in the bitmap in IDiscoveryCallback.
+ *
+ */
+#define DISC_MAX_CAPABILITY_NUM 2
+
+/**
+ * @brief Indicates the maximum length of the device name in IDiscoveryCallback.
+ *
+ */
+#define DISC_MAX_DEVICE_NAME_LEN 65
+
+/**
+ * @brief Indicates the maximum length of the device ID in IDiscoveryCallback.
+ *
+ */
+#define DISC_MAX_DEVICE_ID_LEN 96
+
+/**
+ * @brief Enumerates {@link ConnectionAddr} types of a device that is added to a LNN.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef enum {
+ CONNECTION_ADDR_WLAN = 0, /**< WLAN */
+ CONNECTION_ADDR_BR, /**< BR */
+ CONNECTION_ADDR_BLE, /**< BLE */
+ CONNECTION_ADDR_ETH, /**< Ethernet */
+ CONNECTION_ADDR_MAX /**< Invalid type */
+} ConnectionAddrType;
+/**
+ * @brief Defines the address of a device that is added to a LNN.
+ * For details, see {@link ConnectionAddr}.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef struct {
+ /**< Address type. This field is used to explain the info field. */
+ ConnectionAddrType type;
+ /**< Connection address information */
+ union {
+ /**< BR address */
+ struct BrAddr {
+ char brMac[BT_MAC_LEN]; /**< BR MAC address in string format */
+ } br;
+ /**< BLE address */
+ struct BleAddr {
+ char bleMac[BT_MAC_LEN]; /**< BLE MAC address in string format */
+ uint8_t udidHash[UDID_HASH_LEN]; /**< udid hash value */
+ } ble;
+ /**< IPv4 or IPv6 address */
+ struct IpAddr {
+ /**
+ * IP address in string format. It can be an IPv4 address written in dotted decimal notation
+ * or an IPv6 address written in hexadecimal colon-separated notation.
+ */
+ char ip[IP_STR_MAX_LEN];
+ uint16_t port; /**< Port number represented by the host byte order */
+ } ip;
+ } info;
+ char peerUid[MAX_ACCOUNT_HASH_LEN];
+} ConnectionAddr;
+
+/**
+ * @brief Enumerates the modes in which services are published.
+ *
+ */
+typedef enum {
+ /* Passive */
+ DISCOVER_MODE_PASSIVE = 0x55,
+ /* Proactive */
+ DISCOVER_MODE_ACTIVE = 0xAA
+} DiscoverMode;
+
+/**
+ * @brief Enumerates media, such as Bluetooth, Wi-Fi, and USB, used for publishing services.
+ *
+ * Currently, only COAP is supported.
+ * When AUTO is selected, all the supported media will be called automatically.
+ */
+typedef enum {
+ /** Automatic medium selection */
+ AUTO = 0,
+ /** Bluetooth */
+ BLE = 1,
+ /** Wi-Fi */
+ COAP = 2,
+ /** USB */
+ USB = 3,
+ /** HiLink */
+ COAP1 = 4,
+ MEDIUM_BUTT
+} ExchanageMedium;
+
+/**
+ * @brief Enumerates frequencies for publishing services.
+ *
+ * This enumeration applies only to Bluetooth and is not supported currently.
+ */
+typedef enum {
+ /** Low */
+ LOW = 0,
+ /** Medium */
+ MID = 1,
+ /** High */
+ HIGH = 2,
+ /** Super-high */
+ SUPER_HIGH = 3,
+ FREQ_BUTT
+} ExchangeFreq;
+
+/**
+ * @brief Enumerates supported capabilities published by a device.
+ *
+ */
+typedef enum {
+ /** MeeTime */
+ HICALL_CAPABILITY_BITMAP = 0,
+ /** Video reverse connection in the smart domain */
+ PROFILE_CAPABILITY_BITMAP = 1,
+ /** Gallery in Vision */
+ HOMEVISIONPIC_CAPABILITY_BITMAP = 2,
+ /** cast+ */
+ CASTPLUS_CAPABILITY_BITMAP,
+ /** Input method in Vision */
+ AA_CAPABILITY_BITMAP,
+ /** Device virtualization tool package */
+ DVKIT_CAPABILITY_BITMAP,
+ /** Distributed middleware */
+ DDMP_CAPABILITY_BITMAP,
+ /** Osd capability */
+ OSD_CAPABILITY_BITMAP
+} DataBitMap;
+
+/**
+ * @brief Defines the mapping between supported capabilities and bitmaps.
+ *
+ */
+typedef struct {
+ /** Bitmaps. For details, see {@link DataBitMap}. */
+ DataBitMap bitmap;
+ /** Capability. For details, see {@link g_capabilityMap}. */
+ char *capability;
+} CapabilityMap;
+
+/**
+ * @brief Defines the mapping between supported capabilities and bitmaps.
+ *
+ */
+static const CapabilityMap g_capabilityMap[] = {
+ {HICALL_CAPABILITY_BITMAP, (char *)"hicall"},
+ {PROFILE_CAPABILITY_BITMAP, (char *)"profile"},
+ {HOMEVISIONPIC_CAPABILITY_BITMAP, (char *)"homevisionPic"},
+ {CASTPLUS_CAPABILITY_BITMAP, (char *)"castPlus"},
+ {AA_CAPABILITY_BITMAP, (char *)"aaCapability"},
+ {DVKIT_CAPABILITY_BITMAP, (char *)"dvKit"},
+ {DDMP_CAPABILITY_BITMAP, (char *)"ddmpCapability"},
+ {OSD_CAPABILITY_BITMAP, (char *)"osdCapability"},
+};
+
+/**
+ * @brief Defines service publishing information.
+ *
+ */
+typedef struct {
+ /** Service ID */
+ int publishId;
+ /** Discovery mode for service publishing. For details, see {@link Discovermode}. */
+ DiscoverMode mode;
+ /** Service publishing medium. For details, see {@link ExchanageMedium}. */
+ ExchanageMedium medium;
+ /** Service publishing frequency. For details, see {@link ExchangeFre}. */
+ ExchangeFreq freq;
+ /** Service publishing capabilities. For details, see {@link g_capabilityMap}. */
+ const char *capability;
+ /** Capability data for service publishing */
+ unsigned char *capabilityData;
+ /** Maximum length of the capability data for service publishing (512 bytes) */
+ unsigned int dataLen;
+} PublishInfo;
+
+/**
+ * @brief Defines service subscription information.
+ *
+ */
+typedef struct {
+ /** Service ID */
+ int subscribeId;
+ /** Discovery mode for service subscription. For details, see {@link Discovermode}. */
+ DiscoverMode mode;
+ /** Service subscription medium. For details, see {@link ExchanageMedium}. */
+ ExchanageMedium medium;
+ /** Service subscription frequency. For details, see {@link ExchangeFre}. */
+ ExchangeFreq freq;
+ /** only find the device with the same account */
+ bool isSameAccount;
+ /** find the sleeping devices */
+ bool isWakeRemote;
+ /** Service subscription capability. For details, see {@link g_capabilityMap}. */
+ const char *capability;
+ /** Capability data for service subscription */
+ unsigned char *capabilityData;
+ /** Maximum length of the capability data for service subscription (512 bytes) */
+ unsigned int dataLen;
+} SubscribeInfo;
+
+/**
+ * @brief Enumerates device types.
+ *
+ */
+typedef enum {
+ /* Smart speaker */
+ SMART_SPEAKER = 0x00,
+ /* PC */
+ DESKTOP_PC,
+ /* Laptop */
+ LAPTOP,
+ /* Mobile phone */
+ SMART_PHONE,
+ /* Tablet */
+ SMART_PAD,
+ /* Smart watch */
+ SMART_WATCH,
+ /* Smart car */
+ SMART_CAR,
+ /* Kids' watch */
+ CHILDREN_WATCH,
+ /* Smart TV */
+ SMART_TV,
+} DeviceType;
+
+/**
+ * @brief Defines the device information returned by IDiscoveryCallback.
+ *
+ */
+typedef struct {
+ /** Device ID. Its maximum length is specified by {@link DISC_MAX_DEVICE_ID_LEN}. */
+ char devId[DISC_MAX_DEVICE_ID_LEN];
+ /** Account hash code. Its maximum length is specified by {@link MAX_ACCOUNT_HASH_LEN}. */
+ char accountHash[MAX_ACCOUNT_HASH_LEN];
+ /** Device type. For details, see {@link DeviceType}. */
+ DeviceType devType;
+ /** Device name. Its maximum length is specified by {@link DISC_MAX_DEVICE_NAME_LEN}. */
+ char devName[DISC_MAX_DEVICE_NAME_LEN];
+ /** Number of available connections */
+ unsigned int addrNum;
+ /** Connection information. For details, see {@link ConnectAddr}. */
+ ConnectionAddr addr[CONNECTION_ADDR_MAX];
+ /** Number of capabilities */
+ unsigned int capabilityBitmapNum;
+ /** Device capability bitmap.
+ * The maximum number of capabilities in the bitmap is specified by {@link DISC_MAX_CAPABILITY_NUM}.
+ */
+ unsigned int capabilityBitmap[DISC_MAX_CAPABILITY_NUM];
+ /** Custom data. Its length is specified by {@link DISC_MAX_CUST_DATA_LEN}. */
+ char custData[DISC_MAX_CUST_DATA_LEN];
+} DeviceInfo;
+#ifdef __cplusplus
+}
+#endif
+#endif
+/** @} */
diff --git a/dsoftbus/OhOeCommunication/OpenHarmonyAppSample/entry/src/main/cpp/include/softbus_errcode.h b/dsoftbus/OhOeCommunication/OpenHarmonyAppSample/entry/src/main/cpp/include/softbus_errcode.h
new file mode 100644
index 0000000000000000000000000000000000000000..4dd89ae3121b44abdceef724f252566fb62e7773
--- /dev/null
+++ b/dsoftbus/OhOeCommunication/OpenHarmonyAppSample/entry/src/main/cpp/include/softbus_errcode.h
@@ -0,0 +1,206 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SOFTBUS_ERROR_CODE_H
+#define SOFTBUS_ERROR_CODE_H
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C" {
+#endif
+#endif
+
+enum SoftBusErrNo {
+ SOFTBUS_PUBLIC_ERR_BASE = (-13000),
+
+ SOFTBUS_FRAMEWORK_ERR_BASE = (-12000),
+ SOFTBUS_INVALID_PKGNAME,
+ SOFTBUS_FUNC_NOT_SUPPORT,
+ SOFTBUS_SERVER_NOT_INIT,
+
+ SOFTBUS_TRANS_ERR_BASE = (-11000),
+
+ SOFTBUS_TRANS_INVALID_SESSION_ID,
+ SOFTBUS_TRANS_INVALID_SESSION_NAME,
+ SOFTBUS_TRANS_INVALID_CHANNEL_TYPE,
+ SOFTBUS_TRANS_INVALID_CLOSE_CHANNEL_ID,
+ SOFTBUS_TRANS_SESSION_REPEATED,
+ SOFTBUS_TRANS_SESSION_CNT_EXCEEDS_LIMIT,
+ SOFTBUS_TRANS_SESSIONSERVER_NOT_CREATED,
+ SOFTBUS_TRANS_SESSION_OPENING,
+ SOFTBUS_TRANS_GET_LANE_INFO_ERR,
+ SOFTBUS_TRANS_INVALID_DATA_LENGTH,
+ SOFTBUS_TRANS_FUNC_NOT_SUPPORT,
+ SOFTBUS_TRANS_OPEN_AUTH_CHANNANEL_FAILED,
+ SOFTBUS_TRANS_GET_P2P_INFO_FAILED,
+ SOFTBUS_TRANS_OPEN_AUTH_CONN_FAILED,
+
+ SOFTBUS_TRANS_PROXY_PACKMSG_ERR,
+ SOFTBUS_TRANS_PROXY_SENDMSG_ERR,
+ SOFTBUS_TRANS_PROXY_SEND_CHANNELID_INVALID,
+ SOFTBUS_TRANS_PROXY_CHANNLE_STATUS_INVALID,
+ SOFTBUS_TRANS_PROXY_DEL_CHANNELID_INVALID,
+ SOFTBUS_TRANS_PROXY_SESS_ENCRYPT_ERR,
+ SOFTBUS_TRANS_PROXY_INVALID_SLICE_HEAD,
+ SOFTBUS_TRANS_PROXY_ASSEMBLE_PACK_NO_INVALID,
+ SOFTBUS_TRANS_PROXY_ASSEMBLE_PACK_EXCEED_LENGTH,
+ SOFTBUS_TRANS_PROXY_ASSEMBLE_PACK_DATA_NULL,
+
+ SOFTBUS_TRANS_UDP_CLOSE_CHANNELID_INVALID,
+ SOFTBUS_TRANS_UDP_SERVER_ADD_CHANNEL_FAILED,
+ SOFTBUS_TRANS_UDP_CLIENT_ADD_CHANNEL_FAILED,
+ SOFTBUS_TRANS_UDP_SERVER_NOTIFY_APP_OPEN_FAILED,
+ SOFTBUS_TRANS_UDP_CLIENT_NOTIFY_APP_OPEN_FAILED,
+ SOFTBUS_TRANS_UDP_START_STREAM_SERVER_FAILED,
+ SOFTBUS_TRANS_UDP_START_STREAM_CLIENT_FAILED,
+ SOFTBUS_TRANS_UDP_SEND_STREAM_FAILED,
+
+ SOFTBUS_TRANS_QOS_REPORT_FAILED,
+ SOFTBUS_TRANS_QOS_REPORT_TOO_FREQUENT,
+
+ SOFTBUS_AUTH_ERR_BASE = (-9000),
+ SOFTBUS_AUTH_VERIFIED,
+ SOFTBUS_AUTH_VERIFYING,
+ SOFTBUS_AUTH_SYNC_DEVID_FAILED,
+ SOFTBUS_AUTH_UNPACK_DEVID_FAILED,
+ SOFTBUS_AUTH_HICHAIN_PROCESS_FAILED,
+ SOFTBUS_AUTH_HICHAIN_AUTH_DEVICE_FAILED,
+ SOFTBUS_AUTH_HICHAIN_AUTH_ERROR,
+ SOFTBUS_AUTH_TIMEOUT,
+ SOFTBUS_AUTH_EXISTED,
+ SOFTBUS_AUTH_NOT_EXISTED,
+
+ SOFTBUS_NETWORK_ERR_BASE = (-7000),
+ SOFTBUS_NETWORK_CONN_FSM_DEAD,
+ SOFTBUS_NETWORK_JOIN_CANCELED,
+ SOFTBUS_NETWORK_JOIN_LEAVING,
+ SOFTBUS_NETWORK_JOIN_TIMEOUT,
+ SOFTBUS_NETWORK_UNPACK_DEV_INFO_FAILED,
+ SOFTBUS_NETWORK_DEV_NOT_TRUST,
+ SOFTBUS_NETWORK_LEAVE_OFFLINE,
+ SOFTBUS_NETWORK_AUTH_DISCONNECT,
+ SOFTBUS_NETWORK_TIME_SYNC_HANDSHAKE_ERR, // time sync channel pipe broken
+ SOFTBUS_NETWORK_TIME_SYNC_HANDSHAKE_TIMEOUT, // timeout during handshake
+ SOFTBUS_NETWORK_TIME_SYNC_TIMEOUT, // timeout during sync
+ SOFTBUS_NETWORK_TIME_SYNC_INTERFERENCE, // interference
+ SOFTBUS_NETWORK_HEARTBEAT_REPEATED,
+ SOFTBUS_NETWORK_HEARTBEAT_UNTRUSTED,
+ SOFTBUS_NETWORK_NODE_OFFLINE,
+
+ SOFTBUS_CONN_ERR_BASE = (-5000),
+ SOFTBUS_CONN_FAIL,
+ SOFTBUS_CONN_MANAGER_TYPE_NOT_SUPPORT,
+ SOFTBUS_CONN_MANAGER_OP_NOT_SUPPORT,
+ SOFTBUS_CONN_MANAGER_PKT_LEN_INVALID,
+ SOFTBUS_CONN_MANAGER_LIST_NOT_INIT,
+ SOFTBUS_CONN_INVALID_CONN_TYPE,
+ SOFTBUS_CONNECTION_BASE,
+ SOFTBUS_CONNECTION_ERR_CLOSED,
+ SOFTBUS_CONNECTION_ERR_DRIVER_CONGEST,
+ SOFTBUS_CONNECTION_ERR_SOFTBUS_CONGEST,
+ SOFTBUS_CONNECTION_ERR_CONNID_INVALID,
+ SOFTBUS_CONNECTION_ERR_SENDQUEUE_FULL,
+ SOFTBUS_BRCONNECTION_POSTBYTES_ERROR,
+ SOFTBUS_BRCONNECTION_GETCONNINFO_ERROR,
+ SOFTBUS_BRCONNECTION_STRNCPY_ERROR,
+ SOFTBUS_BRCONNECTION_PACKJSON_ERROR,
+ SOFTBUS_BRCONNECTION_CONNECTDEVICE_MALLOCFAIL,
+ SOFTBUS_BRCONNECTION_CONNECTDEVICE_GETSOCKETIDFAIL,
+ SOFTBUS_BRCONNECTION_DISCONNECT_NOTFIND,
+ SOFTBUS_TCPCONNECTION_SOCKET_ERR,
+ SOFTBUS_BLECONNECTION_REG_GATTS_CALLBACK_FAIL,
+ SOFTBUS_BLECONNECTION_ADD_SERVICE_FAIL,
+ SOFTBUS_BLECONNECTION_ADD_CHAR_FAIL,
+ SOFTBUS_BLECONNECTION_ADD_DES_FAIL,
+ SOFTBUS_BLECONNECTION_NOT_INIT,
+ SOFTBUS_BLECONNECTION_NOT_START,
+ SOFTBUS_BLECONNECTION_GETCONNINFO_ERROR,
+ SOFTBUS_BLECONNECTION_MTU_OVERFLOW_ERROR,
+ SOFTBUS_BLECONNECTION_MUTEX_LOCK_ERROR,
+ SOFTBUS_BLECONNECTION_GATT_CLIENT_NOT_SUPPORT,
+ SOFTBUS_GATTC_INTERFACE_FAILED,
+ SOFTBUS_BLEGATTC_NONT_INIT,
+ SOFTBUS_BLEGATTC_NOT_READY,
+ SOFTBUS_GATTC_DUPLICATE_PARAM,
+ SOFTBUS_GATTC_NONE_PARAM,
+ SOFTBUS_BLEGATTC_NODE_NOT_EXIST,
+
+ SOFTBUS_DISCOVER_ERR_BASE = (-3000),
+
+ SOFTBUS_DISCOVER_NOT_INIT,
+ SOFTBUS_DISCOVER_INVALID_PKGNAME,
+ SOFTBUS_DISCOVER_SERVER_NO_PERMISSION,
+ SOFTBUS_DISCOVER_MANAGER_NOT_INIT,
+ SOFTBUS_DISCOVER_MANAGER_ITEM_NOT_CREATE,
+ SOFTBUS_DISCOVER_MANAGER_INFO_NOT_CREATE,
+ SOFTBUS_DISCOVER_MANAGER_INFO_NOT_DELETE,
+ SOFTBUS_DISCOVER_MANAGER_INNERFUNCTION_FAIL,
+ SOFTBUS_DISCOVER_MANAGER_CAPABILITY_INVALID,
+ SOFTBUS_DISCOVER_MANAGER_DUPLICATE_PARAM,
+ SOFTBUS_DISCOVER_MANAGER_INVALID_PARAM,
+ SOFTBUS_DISCOVER_MANAGER_INVALID_MEDIUM,
+ SOFTBUS_DISCOVER_MANAGER_INVALID_PKGNAME,
+ SOFTBUS_DISCOVER_MANAGER_INVALID_MODULE,
+ SOFTBUS_DISCOVER_COAP_NOT_INIT,
+ SOFTBUS_DISCOVER_COAP_INIT_FAIL,
+ SOFTBUS_DISCOVER_COAP_MERGE_CAP_FAIL,
+ SOFTBUS_DISCOVER_COAP_CANCEL_CAP_FAIL,
+ SOFTBUS_DISCOVER_COAP_REGISTER_CAP_FAIL,
+ SOFTBUS_DISCOVER_COAP_SET_FILTER_CAP_FAIL,
+ SOFTBUS_DISCOVER_COAP_REGISTER_DEVICE_FAIL,
+ SOFTBUS_DISCOVER_COAP_START_PUBLISH_FAIL,
+ SOFTBUS_DISCOVER_COAP_STOP_PUBLISH_FAIL,
+ SOFTBUS_DISCOVER_COAP_START_DISCOVER_FAIL,
+ SOFTBUS_DISCOVER_COAP_STOP_DISCOVER_FAIL,
+
+ SOFTBUS_COMMOM_ERR_BASE = (-1000),
+ SOFTBUS_TIMOUT,
+ SOFTBUS_INVALID_PARAM,
+ SOFTBUS_MEM_ERR,
+ SOFTBUS_NOT_IMPLEMENT,
+ SOFTBUS_NO_URI_QUERY_KEY,
+ SOFTBUS_NO_INIT,
+ SOFTBUS_PARSE_JSON_ERR,
+ SOFTBUS_PERMISSION_DENIED,
+ SOFTBUS_MALLOC_ERR,
+ SOFTBUS_ENCRYPT_ERR,
+ SOFTBUS_DECRYPT_ERR,
+ SOFTBUS_INVALID_SESS_OPCODE,
+ SOFTBUS_INVALID_NUM,
+ SOFTBUS_SERVER_NAME_REPEATED,
+ SOFTBUS_TCP_SOCKET_ERR,
+ SOFTBUS_LOCK_ERR,
+ SOFTBUS_GET_REMOTE_UUID_ERR,
+ SOFTBUS_NO_ENOUGH_DATA,
+ SOFTBUS_INVALID_DATA_HEAD,
+ SOFTBUS_INVALID_FD,
+ SOFTBUS_FILE_ERR,
+ SOFTBUS_DATA_NOT_ENOUGH,
+ SOFTBUS_SLICE_ERROR,
+ SOFTBUS_ALREADY_EXISTED,
+ SOFTBUS_GET_CONFIG_VAL_ERR,
+ SOFTBUS_PEER_PROC_ERR,
+ SOFTBUS_NOT_FIND,
+
+ SOFTBUS_ERR = (-1),
+ SOFTBUS_OK = 0,
+};
+
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* __cplusplus */
+#endif /* SOFTBUS_ERRCODE_H */
diff --git a/dsoftbus/OhOeCommunication/required_so/libsec_shared.z.so b/dsoftbus/OhOeCommunication/required_so/libsec_shared.z.so
new file mode 100644
index 0000000000000000000000000000000000000000..3edf282c907329eae344a342c8258b2b67d9e475
Binary files /dev/null and b/dsoftbus/OhOeCommunication/required_so/libsec_shared.z.so differ
diff --git a/dsoftbus/OhOeCommunication/required_so/libsoftbus_client.z.so b/dsoftbus/OhOeCommunication/required_so/libsoftbus_client.z.so
new file mode 100644
index 0000000000000000000000000000000000000000..090a1f1101453c321ca1ee48dfa65dca15a7f461
Binary files /dev/null and b/dsoftbus/OhOeCommunication/required_so/libsoftbus_client.z.so differ