From: hcj <1224667075@qq.com> Date: Sat, 28 Sep 2024 06:59:40 +0000 (+0800) Subject: 增加在ble断连后ANCS无法重新发现服务,直接尝试订阅,实测有改善消息通知失效问题 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1046%2F1;p=mirrors%2FFD230.git 增加在ble断连后ANCS无法重新发现服务,直接尝试订阅,实测有改善消息通知失效问题 --- diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleANCS.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleANCS.c index 18e083e8c..763a23abf 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleANCS.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleANCS.c @@ -432,6 +432,12 @@ static uint8_t ble_ancs_client_at_cmd_setup(uint16_t conn_id) { errcode_t ret = ble_ancs_client_setup_service(g_client_id, conn_id); printf("ble ancs client setup ret:0x%x %d\r\n", ret,conn_id); + //若发现服务失败直接尝试定订阅通知 + if(ret!=ERRCODE_SUCC) + { + ret = uapi_get_timestampe_ss(&subscribe_notify_creationTime); + ble_ancs_client_subscribe_notify(conn_id,1); + } return 0; } diff --git a/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c b/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c index d22244926..e4520d8e3 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c @@ -1109,6 +1109,14 @@ static uint32_t BLE_TEST(uint8_t *para, uint32_t paraLen, char *strCommonCmd) uapi_open_voice_recognition( ); else uapi_close_voice_recognition( ); + break; + case 15: + ble_test_ANCS(); + break; + case 16: + ble_test_ANCS_notify(type_2); + break; + default: break; }