From: hcj <1224667075@qq.com> Date: Sat, 20 Jul 2024 01:59:45 +0000 (+0800) Subject: 增加 连接状态改变(补) X-Git-Tag: release_V1.2.70_20241020_135402~745^2~28 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F558%2F2;p=mirrors%2FFD230.git 增加 连接状态改变(补) --- 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,//频率