From: penglei <1624952103@qq.com> Date: Tue, 24 Sep 2024 03:24:06 +0000 (+0800) Subject: 优化省电模式逻辑,修复cywee fatal error bug(补交) X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1008%2F2;p=mirrors%2FFD230.git 优化省电模式逻辑,修复cywee fatal error bug(补交) --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModelC.h b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModelC.h index 785a37ad0..e21444227 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModelC.h +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModelC.h @@ -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); diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp index 68612e5ed..c553830d1 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp @@ -1874,7 +1874,17 @@ int uapi_reconnect(void) return 0; } +int uapi_close_br_scan(void) +{ + gap_br_set_bt_scan_mode(GAP_SCAN_MODE_NONE, 0); + return 0; +} +int uapi_open_br_scan(void) +{ + gap_br_set_bt_scan_mode(GAP_SCAN_MODE_CONNECTABLE, 0); + return 0; +} // /////////////////////////////////////////HFP hf端 代码/////////////////////////////////////////////////// diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c index 0d054db62..d0a0e2d57 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c @@ -144,10 +144,10 @@ enum{ static uint8_t ble_adv_falg = 0; static bool g_custom_ble_init_flag = false; -void svr_ble_adv_stop(void) +errcode_t svr_ble_adv_stop(void) { ble_adv_falg = 0; - gap_ble_stop_adv(BLE_ADV_ID); + return gap_ble_stop_adv(BLE_ADV_ID); } void svr_ble_adv_start(void) { diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.h b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.h index 0c45d557e..d15462d48 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.h +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.h @@ -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); // diff --git a/code/sdk/drivers/peripheral/cywee/src/main_dml.c b/code/sdk/drivers/peripheral/cywee/src/main_dml.c index 21fd25e74..2aa8450c8 100644 --- a/code/sdk/drivers/peripheral/cywee/src/main_dml.c +++ b/code/sdk/drivers/peripheral/cywee/src/main_dml.c @@ -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));