From 0b5bb55d703b65046f40a4abe18350087a3499e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E6=99=93=E6=99=93?= Date: Wed, 28 Aug 2024 21:41:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AF=E6=80=BB=E7=BA=BF=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 史晓晓 --- interfaces/inner_kits/native_cpp/BUILD.gn | 6 +++++- .../native_cpp/src/mini/mine_softbus_adapter.c | 8 ++++---- services/service/BUILD.gn | 10 ++++++++++ services/service/src/softbus/mine_softbus_listener.cpp | 6 +++--- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/interfaces/inner_kits/native_cpp/BUILD.gn b/interfaces/inner_kits/native_cpp/BUILD.gn index 25bb77b2..f3ad24c4 100644 --- a/interfaces/inner_kits/native_cpp/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/BUILD.gn @@ -51,12 +51,16 @@ if (defined(ohos_lite)) { deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static", "//commonlibrary/utils_lite:utils", + "//foundation/communication/dsoftbus:dsoftbus", "//foundation/systemabilitymgr/samgr_lite/samgr", "//third_party/bounds_checking_function:libsec_static", ] if (defined(harmony_industry_project)) { - defines = [ "MINE_HARMONY_HICHAIN" ] + defines = [ + "MINE_HARMONY_HICHAIN", + "MINE_HARMONY_SOFTBUS_EX" + ] } cflags = [ diff --git a/interfaces/inner_kits/native_cpp/src/mini/mine_softbus_adapter.c b/interfaces/inner_kits/native_cpp/src/mini/mine_softbus_adapter.c index e646a01b..75136b79 100644 --- a/interfaces/inner_kits/native_cpp/src/mini/mine_softbus_adapter.c +++ b/interfaces/inner_kits/native_cpp/src/mini/mine_softbus_adapter.c @@ -36,7 +36,7 @@ #include "softbus_common.h" #include "softbus_errcode.h" #ifdef MINE_HARMONY_SOFTBUS_EX -#include "softbus_bus_center_ex.h" +#include "softbus_bus_center_ptr.h" #endif static const char * const DM_CAPABILITY_OSD = "osdCapability"; @@ -191,9 +191,9 @@ static IDiscoveryPolicyCallback publishLNNCallback_ = { int PublishDeviceDiscovery(bool enable) { #ifdef MINE_HARMONY_SOFTBUS_EX - int retValue = EnableDiscoveryPolicy(DM_PKG_NAME, DM_CAPABILITY_OSD, enable, &publishLNNCallback_); + int retValue = EnableDiscoveryPolicyPtr(DM_PKG_NAME, DM_CAPABILITY_OSD, enable, &publishLNNCallback_); if (retValue != SOFTBUS_OK) { - DMLOGE("[softbus]failed to call softbus EnableDiscoveryPolicy function with ret: %d.", retValue); + DMLOGE("[softbus]failed to call softbus EnableDiscoveryPolicyPtr function with ret: %d.", retValue); return ERR_DM_SOFTBUS_PUBLISH_LNN; } #endif @@ -791,7 +791,7 @@ static int SendReturnwave(DeviceInfo *deviceInfo, const BroadcastHead *broadcast return ERR_DM_FAILED; } #ifdef MINE_HARMONY_SOFTBUS_EX - retValue = SetDiscoveryPolicy(DM_CAPABILITY_OSD, (DiscoveryPolicy)matchResult, deviceInfo); + retValue = SetDiscoveryPolicyPtr(DM_CAPABILITY_OSD, (DiscoveryPolicy)matchResult, deviceInfo); if (retValue != SOFTBUS_OK) { DMLOGE("failed to set discovery policy with ret: %d.", retValue); return ERR_DM_FAILED; diff --git a/services/service/BUILD.gn b/services/service/BUILD.gn index ec778cf6..563299ef 100644 --- a/services/service/BUILD.gn +++ b/services/service/BUILD.gn @@ -49,6 +49,7 @@ if (defined(ohos_lite)) { "//third_party/bounds_checking_function/include", "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite", "${interfaces_path}/c/ipc/include", + "//foundation/communication/dsoftbus/innerkits/kits/bus_center", "//foundation/distributedshedule/samgr_lite/interfaces/kits/samgr", "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include", "${devicemanager_path}/radar/include", @@ -80,6 +81,10 @@ if (defined(ohos_lite)) { "LOG_DOMAIN=0xD004110", ] + if (defined(harmony_industry_project)) { + defines += [ "MINE_HARMONY" ] + } + deps = [ "${utils_path}:devicemanagerutils", "//base/security/device_auth/services:deviceauth_sdk", @@ -135,6 +140,7 @@ if (defined(ohos_lite)) { "${utils_path}/include/timer", "//third_party/cJSON", "//third_party/json/include", + "//foundation/communication/dsoftbus/innerkits/kits/bus_center", ] } @@ -180,6 +186,10 @@ if (defined(ohos_lite)) { "LOG_DOMAIN=0xD004110", ] + if (defined(harmony_industry_project)) { + defines += [ "MINE_HARMONY" ] + } + deps = [ "${utils_path}:devicemanagerutils", "//third_party/cJSON:cjson", diff --git a/services/service/src/softbus/mine_softbus_listener.cpp b/services/service/src/softbus/mine_softbus_listener.cpp index 0394bce5..ce9d1774 100644 --- a/services/service/src/softbus/mine_softbus_listener.cpp +++ b/services/service/src/softbus/mine_softbus_listener.cpp @@ -39,7 +39,7 @@ #include "openssl/evp.h" #include "openssl/pem.h" #ifdef MINE_HARMONY -#include "softbus_bus_center_ex.h" +#include "softbus_bus_center_ptr.h" #endif namespace OHOS { @@ -601,7 +601,7 @@ bool MineSoftbusListener::DmBase64Decode(unsigned char* outData, size_t &outSize int32_t MineSoftbusListener::PublishDeviceDiscovery(bool enable) { #ifdef MINE_HARMONY - int retValue = EnableDiscoveryPolicy(DM_PKG_NAME, DM_CAPABILITY_OSD, enable, &publishLNNCallback_); + int retValue = EnableDiscoveryPolicyPtr(DM_PKG_NAME, DM_CAPABILITY_OSD, enable, &publishLNNCallback_); if (retValue != SOFTBUS_OK) { LOGE("[softbus]failed to call softbus publishLNN function with ret: %d.", retValue); return ERR_DM_SOFTBUS_PUBLISH_SERVICE; @@ -841,7 +841,7 @@ int32_t MineSoftbusListener::SendReturnwave(DeviceInfo &deviceInfo, const Broadc return ERR_DM_FAILED; } #ifdef MINE_HARMONY - int32_t retValue = SetDiscoveryPolicy(DM_CAPABILITY_OSD, (DiscoveryPolicy)matchResult, &deviceInfo); + int32_t retValue = SetDiscoveryPolicyPtr(DM_CAPABILITY_OSD, (DiscoveryPolicy)matchResult, &deviceInfo); if (retValue != SOFTBUS_OK) { LOGE("failed to set discovery policy with ret: %d.", retValue); } -- Gitee