From cf153b22914bed442c4dee3600af2e4cb72ffa15 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Sat, 28 Sep 2024 14:59:40 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E5=9C=A8ble=E6=96=AD=E8=BF=9E?= =?utf8?q?=E5=90=8EANCS=E6=97=A0=E6=B3=95=E9=87=8D=E6=96=B0=E5=8F=91?= =?utf8?q?=E7=8E=B0=E6=9C=8D=E5=8A=A1=EF=BC=8C=E7=9B=B4=E6=8E=A5=E5=B0=9D?= =?utf8?q?=E8=AF=95=E8=AE=A2=E9=98=85=EF=BC=8C=E5=AE=9E=E6=B5=8B=E6=9C=89?= =?utf8?q?=E6=94=B9=E5=96=84=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5=E5=A4=B1?= =?utf8?q?=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../wearable/service/ble_service/bleservice/bleANCS.c | 6 ++++++ code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c | 8 ++++++++ 2 files changed, 14 insertions(+) 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; } -- 2.17.1