From 21cf66ef831997fd9c4f9236a287415b2e8e652f Mon Sep 17 00:00:00 2001 From: SnickerSun Date: Wed, 20 Mar 2024 19:00:36 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?utf8?q?=E9=80=9A=E8=BF=87ble=5Fservice=20SUPPORT=5FBLE=5FSERVICE?= =?utf8?q?=E5=8F=AF=E4=BB=A5=E6=8E=A7=E5=88=B6ble=E6=9C=8D=E5=8A=A1?= =?utf8?q?=E6=A8=A1=E5=9D=97=E6=98=AF=E5=90=A6=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?utf8?q?=E7=B3=BB=E7=BB=9F=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../brandy/brandy_standard/thread_pri_init.c | 2 ++ .../wearable/alipay/service/alipay_bluetooth.c | 2 ++ .../src/ClassicBlueToothPresenter.cpp | 15 ++++++++------- .../wearable/service/ble_service/bleEvent.c | 2 ++ .../wearable/service/hid_service/hidService.c | 4 +++- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/code/sdk/application/brandy/brandy_standard/thread_pri_init.c b/code/sdk/application/brandy/brandy_standard/thread_pri_init.c index 24eba13c3..c34ab780f 100755 --- a/code/sdk/application/brandy/brandy_standard/thread_pri_init.c +++ b/code/sdk/application/brandy/brandy_standard/thread_pri_init.c @@ -9,7 +9,9 @@ #include "common_def.h" #include "pm.h" #include "watchdog.h" +#ifdef SUPPORT_BLE_SERVICE #include "bleService.h" +#endif // #include "hidService.h" // #include "ble_hid_take_photo_server.h" /* after reboot system emmc need write exc info to the file system from sector */ diff --git a/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c b/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c index e03503436..c83f5fb2d 100644 --- a/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c +++ b/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c @@ -15,7 +15,9 @@ #include "alipay_feature.h" #include "securec.h" #include "wearable_log.h" +#ifdef SUPPORT_BLE_SERVICE #include "bleService.h" +#endif #include "alipay_bluetooth.h" // Alipay 蓝牙模块全局变量 diff --git a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp index cf45fc220..908b12f75 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp @@ -119,18 +119,19 @@ namespace OHOS { case UICheckBox::SELECTED: WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BlueTooth Capability Is Enabled"); + #ifdef SUPPORT_BLE_SERVICE openBle();//主动开启蓝牙 + #else + init_btaddr_btname(); + #endif break; case UICheckBox::UNSELECTED: WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BlueTooth Capability Is Disabled"); + #ifdef SUPPORT_BLE_SERVICE closeBle(); - - // init_btaddr_btname(); - // break; - //case UICheckBox::UNSELECTED: - // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BlueTooth Capability Is Disabled"); - // disable_bt_service(); - + #else + disable_bt_service(); + #endif break; default: break; diff --git a/code/sdk/application/wearable/service/ble_service/bleEvent.c b/code/sdk/application/wearable/service/ble_service/bleEvent.c index 3db715ced..f1ff522c7 100644 --- a/code/sdk/application/wearable/service/ble_service/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleEvent.c @@ -25,7 +25,9 @@ #include "bts_a2dp_sink.h" #include "osal_timer.h" #include "bleEvent.h" +#ifdef SUPPORT_BLE_SERVICE #include "app_common_api.h" +#endif #include "../../../../../open_source/openharmony/third_party/cJSON/cJSON.h" #include "errcode.h" diff --git a/code/sdk/application/wearable/service/hid_service/hidService.c b/code/sdk/application/wearable/service/hid_service/hidService.c index e1c88266f..ed8a5ca42 100644 --- a/code/sdk/application/wearable/service/hid_service/hidService.c +++ b/code/sdk/application/wearable/service/hid_service/hidService.c @@ -3,7 +3,9 @@ * Description: BT HID Service Server Module. */ #include "hidService.h" +#ifdef SUPPORT_BLE_SERVICE #include "bleService.h" +#endif #include "bts_gatt_stru.h" #include "bts_a2dp_source.h" #include "bts_gatt_server.h" @@ -269,7 +271,7 @@ void ble_hid_add_characters_and_descriptors(uint8_t server_id, uint16_t srvc_han /* HID Control Point */ ble_hid_add_character_hid_control_point(server_id, srvc_handle); } -#include "bleService.h" + /* 初始化HID device */ void ble_hid_server_init(void) { -- 2.17.1