From 411250518e5135eb748ea38b2442bd31e346e4ba Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Tue, 24 Sep 2024 11:24:06 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E7=9C=81=E7=94=B5=E6=A8=A1?= =?utf8?q?=E5=BC=8F=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BF=AE=E5=A4=8Dcywee=20fa?= =?utf8?q?tal=20error=20bug=EF=BC=88=E8=A1=A5=E4=BA=A4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/bluetooth/include/BluetoothModelC.h | 10 ++++++++++ .../fd230app/nativeui/bluetooth/src/BluetoothModel.cpp | 10 ++++++++++ .../service/ble_service/bleservice/bleService.c | 4 ++-- .../service/ble_service/bleservice/bleService.h | 2 +- code/sdk/drivers/peripheral/cywee/src/main_dml.c | 2 +- 5 files changed, 24 insertions(+), 4 deletions(-) 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)); -- 2.17.1