From 645f474378a5aa4bd779741b32073005b7bacbc3 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Sat, 20 Jul 2024 09:59:45 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=20=E8=BF=9E=E6=8E=A5=E7=8A=B6?= =?utf8?q?=E6=80=81=E6=94=B9=E5=8F=98(=E8=A1=A5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/bluetooth/include/BluetoothModel.h | 2 +- .../nativeui/bluetooth/src/BluetoothModel.cpp | 15 +++++++-------- .../peripheral/config/include/ConfigModel.h | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModel.h b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModel.h index e02a1ec3f..679b45112 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModel.h @@ -132,7 +132,7 @@ void bluetooth_init(void); void InitBluetoothInfo(void); void bluetooth_enable_all(void); void bluetooth_close_all(void); -void bluetooth_set_auto_reconnect(uint8_t flag); +void bluetooth_set_auto_reconnect_closed(uint8_t flag); int uapi_a2dp_snk_get_device_connect_state(void); int uapi_a2dp_snk_connect(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 f7935fd6d..791697307 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp @@ -120,7 +120,7 @@ void InitBluetoothInfo(void) } } //1关 0开 -void bluetooth_set_auto_reconnect(uint8_t flag) +void bluetooth_set_auto_reconnect_closed(uint8_t flag) { bts_feature_t bts_feature = { 0 }; bts_feature.bt_auto_reconnect_closed = flag; @@ -137,7 +137,7 @@ static int bluetooth_init_all(void) errcode_t ret; // 设置自动回连,ios一键双连依赖此配置 - bluetooth_set_auto_reconnect(1); + bluetooth_set_auto_reconnect_closed(1); ret = enable_bt_stack(); WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "bt enable_bt_stack ret = %u", ret); @@ -198,12 +198,11 @@ void bluetooth_enable_all(void) errcode_t ret; // 设置自动回连,ios一键双连依赖此配置 - // bts_feature_t bts_feature = { 0 }; - // bts_feature.bt_auto_reconnect_closed = 1; - // ret = bts_set_features(&bts_feature); - - //WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "bt bts_set_features ret = %u", ret); - gap_ble_sec_params_t sec_param = { 1, GAP_BLE_IO_CAPABILITY_NOINPUTNOOUTPUT, 1, GAP_BLE_GAP_SECURITY_MODE1_LEVEL3 }; + bts_feature_t bts_feature = { 0 }; + bts_feature.bt_auto_reconnect_closed = 0; + ret = bts_set_features(&bts_feature); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "bt bts_set_features ret = %u", ret); + // gap_ble_sec_params_t sec_param = { 1, GAP_BLE_IO_CAPABILITY_NOINPUTNOOUTPUT, 1, GAP_BLE_GAP_SECURITY_MODE1_LEVEL3 }; gap_ble_sec_params_t sec_param = { 1, GAP_BLE_IO_CAPABILITY_NOINPUTNOOUTPUT, 0, GAP_BLE_GAP_SECURITY_MODE1_LEVEL2 }; ret = gap_ble_set_sec_param(&sec_param); WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "bt gap_ble_set_sec_param ret = %u", ret); diff --git a/code/sdk/drivers/peripheral/config/include/ConfigModel.h b/code/sdk/drivers/peripheral/config/include/ConfigModel.h index 7d71a528d..11cf5c54a 100644 --- a/code/sdk/drivers/peripheral/config/include/ConfigModel.h +++ b/code/sdk/drivers/peripheral/config/include/ConfigModel.h @@ -323,7 +323,7 @@ namespace OHOS {ConfigDataType::DATATYPE_INT, "heartrate_remind", "0"},// CONFIGMODEL_ITEM_HEARTRATE_REMIND//提醒开关 {ConfigDataType::DATATYPE_INT, "heartrate_threshold_value", "0"},// CONFIGMODEL_ITEM_HEARTRATE_THRESHOLD_VALUE// - {ConfigDataType::DATATYPE_BOOL, "heart_max_min", "0"},// CONFIGMODEL_ITEM_HEARTRATE_MAX_MIN//最大值还是最小值 + {ConfigDataType::DATATYPE_INT, "heart_max_min", "0"},// CONFIGMODEL_ITEM_HEARTRATE_MAX_MIN//最大值或者最小值 {ConfigDataType::DATATYPE_INT, "oxygen_freq", "0" },// CONFIGMODEL_ITEM_OXYGEN_DETECTED,//频率 -- 2.17.1