From 62b2759508a22df2ce28dea46a20e8f87bf46337 Mon Sep 17 00:00:00 2001
From: tianhang <tian_hang@hoperun.com>
Date: Tue, 26 Sep 2023 13:42:14 +0800
Subject: [PATCH] only support network coap

---
 .../src/dependency/softbus/softbus_connector.cpp            | 2 +-
 services/service/src/softbus/softbus_listener.cpp           | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/services/implementation/src/dependency/softbus/softbus_connector.cpp b/services/implementation/src/dependency/softbus/softbus_connector.cpp
index 6640fff..4c655e2 100644
--- a/services/implementation/src/dependency/softbus/softbus_connector.cpp
+++ b/services/implementation/src/dependency/softbus/softbus_connector.cpp
@@ -135,7 +135,7 @@ int32_t SoftbusConnector::PublishDiscovery(const DmPublishInfo &dmPublishInfo)
     (void)memset_s(&publishInfo, sizeof(PublishInfo), 0, sizeof(PublishInfo));
     publishInfo.publishId = dmPublishInfo.publishId;
     publishInfo.mode = (DiscoverMode)dmPublishInfo.mode;
-    publishInfo.medium = ExchangeMedium::AUTO;
+    publishInfo.medium = ExchangeMedium::COAP;
     publishInfo.freq = (ExchangeFreq)dmPublishInfo.freq;
     publishInfo.capability = DM_CAPABILITY_OSD;
     publishInfo.ranging = dmPublishInfo.ranging;
diff --git a/services/service/src/softbus/softbus_listener.cpp b/services/service/src/softbus/softbus_listener.cpp
index b882271..b4d36b5 100644
--- a/services/service/src/softbus/softbus_listener.cpp
+++ b/services/service/src/softbus/softbus_listener.cpp
@@ -100,7 +100,7 @@ void SoftbusListener::SetPublishInfo(PublishInfo &dmPublishInfo)
 {
     dmPublishInfo.publishId = DISTRIBUTED_HARDWARE_DEVICEMANAGER_SA_ID;
     dmPublishInfo.mode = DiscoverMode::DISCOVER_MODE_ACTIVE;
-    dmPublishInfo.medium = ExchangeMedium::AUTO;
+    dmPublishInfo.medium = ExchangeMedium::COAP;
     dmPublishInfo.freq = ExchangeFreq::HIGH;
     dmPublishInfo.capability = DM_CAPABILITY_OSD;
     dmPublishInfo.ranging = false;
@@ -288,7 +288,7 @@ void SoftbusListener::OnParameterChgCallback(const char *key, const char *value,
         (void)memset_s(&dmPublishInfo, sizeof(PublishInfo), 0, sizeof(PublishInfo));
         dmPublishInfo.publishId = DISTRIBUTED_HARDWARE_DEVICEMANAGER_SA_ID;
         dmPublishInfo.mode = DiscoverMode::DISCOVER_MODE_ACTIVE;
-        dmPublishInfo.medium = ExchangeMedium::AUTO;
+        dmPublishInfo.medium = ExchangeMedium::COAP;
         dmPublishInfo.freq = ExchangeFreq::HIGH;
         dmPublishInfo.capability = DM_CAPABILITY_OSD;
         dmPublishInfo.ranging = false;
@@ -331,4 +331,4 @@ void SoftbusListener::OnSoftbusDeviceInfoChanged(NodeBasicInfoType type, NodeBas
     LOGD("SoftbusListener::OnSoftbusDeviceInfoChanged.");
 }
 } // namespace DistributedHardware
-} // namespace OHOS
\ No newline at end of file
+} // namespace OHOS
-- 
2.33.0

