优化代码,通过ble_service SUPPORT_BLE_SERVICE可以控制ble服务模块是否添加到系统中
authorSnickerSun <snickersun@163.com>
Wed, 20 Mar 2024 11:00:36 +0000 (19:00 +0800)
committerSnickerSun <snickersun@163.com>
Wed, 20 Mar 2024 11:00:36 +0000 (19:00 +0800)
code/sdk/application/brandy/brandy_standard/thread_pri_init.c
code/sdk/application/wearable/alipay/service/alipay_bluetooth.c
code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp
code/sdk/application/wearable/service/ble_service/bleEvent.c
code/sdk/application/wearable/service/hid_service/hidService.c

index 24eba13..c34ab78 100755 (executable)
@@ -9,7 +9,9 @@
 #include "common_def.h"\r
 #include "pm.h"\r
 #include "watchdog.h"\r
+#ifdef SUPPORT_BLE_SERVICE\r
 #include "bleService.h"\r
+#endif\r
 // #include "hidService.h"\r
 // #include "ble_hid_take_photo_server.h"\r
 /* after reboot system emmc need write exc info to the file system from sector */\r
index e035034..c83f5fb 100644 (file)
@@ -15,7 +15,9 @@
 #include "alipay_feature.h"\r
 #include "securec.h"\r
 #include "wearable_log.h"\r
+#ifdef SUPPORT_BLE_SERVICE\r
 #include "bleService.h"\r
+#endif\r
 #include "alipay_bluetooth.h"\r
 \r
 // Alipay 蓝牙模块全局变量\r
index cf45fc2..908b12f 100644 (file)
@@ -119,18 +119,19 @@ namespace OHOS
         {\r
         case UICheckBox::SELECTED:\r
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BlueTooth Capability Is Enabled");\r
+            #ifdef SUPPORT_BLE_SERVICE\r
             openBle();//主动开启蓝牙\r
+            #else\r
+            init_btaddr_btname();\r
+            #endif\r
             break;\r
         case UICheckBox::UNSELECTED:\r
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BlueTooth Capability Is Disabled");\r
+            #ifdef SUPPORT_BLE_SERVICE\r
             closeBle();\r
-\r
-          //  init_btaddr_btname();\r
-            // break;\r
-        //case UICheckBox::UNSELECTED:\r
-          //  WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BlueTooth Capability Is Disabled");\r
-          //  disable_bt_service();\r
-\r
+            #else\r
+            disable_bt_service();\r
+            #endif      \r
             break;\r
         default:\r
             break;\r
index 3db715c..f1ff522 100644 (file)
@@ -25,7 +25,9 @@
 #include "bts_a2dp_sink.h"\r
 #include "osal_timer.h"\r
 #include "bleEvent.h"\r
+#ifdef SUPPORT_BLE_SERVICE\r
 #include "app_common_api.h"\r
+#endif\r
 #include "../../../../../open_source/openharmony/third_party/cJSON/cJSON.h"\r
 #include "errcode.h"\r
 \r
index e1c8826..ed8a5ca 100644 (file)
@@ -3,7 +3,9 @@
  * Description: BT HID Service Server Module.\r
  */\r
 #include "hidService.h"\r
+#ifdef SUPPORT_BLE_SERVICE\r
 #include "bleService.h"\r
+#endif\r
 #include "bts_gatt_stru.h"\r
 #include "bts_a2dp_source.h"\r
 #include "bts_gatt_server.h"\r
@@ -269,7 +271,7 @@ void ble_hid_add_characters_and_descriptors(uint8_t server_id, uint16_t srvc_han
     /* HID Control Point */\r
     ble_hid_add_character_hid_control_point(server_id, srvc_handle);\r
 }\r
-#include "bleService.h"\r
+\r
 /* 初始化HID device */\r
 void ble_hid_server_init(void)\r
 {\r