优化省电模式逻辑,修复cywee fatal error bug(补交) 1008/2
authorpenglei <1624952103@qq.com>
Tue, 24 Sep 2024 03:24:06 +0000 (11:24 +0800)
committerpenglei <1624952103@qq.com>
Tue, 24 Sep 2024 03:24:06 +0000 (11:24 +0800)
code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModelC.h
code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp
code/sdk/application/wearable/service/ble_service/bleservice/bleService.c
code/sdk/application/wearable/service/ble_service/bleservice/bleService.h
code/sdk/drivers/peripheral/cywee/src/main_dml.c

index 785a37a..e214442 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * @Author: penglei 1624952103@qq.com
+ * @Date: 2024-08-23 10:50:37
+ * @LastEditors: penglei 1624952103@qq.com
+ * @LastEditTime: 2024-09-23 16:59:22
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModelC.h
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
 /*
  * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved.
  * Description: BluetoothModel view
@@ -15,6 +23,8 @@ extern "C" {
 
 int uapi_a2dp_snk_connect_(void);
 int uapi_a2dp_snk_disconnect_(void);
+int uapi_close_br_scan(void);
+int uapi_open_br_scan(void);
 //int uapi_disconnect_remote_device_(void);
 
 int uapi_reconnect_(void);
index 68612e5..c553830 100644 (file)
@@ -1874,7 +1874,17 @@ int uapi_reconnect(void)
     return 0;\r
 }\r
 \r
+int uapi_close_br_scan(void)\r
+{\r
+    gap_br_set_bt_scan_mode(GAP_SCAN_MODE_NONE, 0);\r
+    return 0;\r
+}\r
 \r
+int uapi_open_br_scan(void)\r
+{\r
+    gap_br_set_bt_scan_mode(GAP_SCAN_MODE_CONNECTABLE, 0);\r
+    return 0;\r
+}\r
 \r
 // /////////////////////////////////////////HFP hf端 代码///////////////////////////////////////////////////\r
 \r
index 0d054db..d0a0e2d 100644 (file)
@@ -144,10 +144,10 @@ enum{
 static uint8_t ble_adv_falg = 0;\r
 static bool g_custom_ble_init_flag = false;\r
 \r
-void svr_ble_adv_stop(void)\r
+errcode_t svr_ble_adv_stop(void)\r
 {\r
     ble_adv_falg = 0;\r
-    gap_ble_stop_adv(BLE_ADV_ID);\r
+    return gap_ble_stop_adv(BLE_ADV_ID);\r
 }\r
 void svr_ble_adv_start(void)\r
 {\r
index 0c45d55..d15462d 100644 (file)
@@ -45,7 +45,7 @@ bool ble_gatts_cmp_uuid(const bt_uuid_t *tgt_uuid, const bt_uuid_t *src_uuid);
 void srv_ble_server_register_gatt_callbacks(void);
 errcode_t svr_ble_bt_gatts_noyify(uint8_t *data, uint16_t data_len);
 void svr_ble_adv_start(void);
-void svr_ble_adv_stop(void);
+errcode_t svr_ble_adv_stop(void);
 void ble_avd_mode_change(uint8_t mode);
 //
 
index 21fd25e..2aa8450 100644 (file)
@@ -1267,7 +1267,7 @@ int cywee_main_dml(void)
 #else
     scl.iData[1] = 18; //00000000000000000000000000010010  高位在前
 #endif
-    //CWM_SettingControl(SCL_DML_DEBUG, &scl);
+    CWM_SettingControl(SCL_DML_DEBUG, &scl);
 
     //设置acc gyro 相关参数
     memset(&scl, 0, sizeof(scl));