增加在ble断连后ANCS无法重新发现服务,直接尝试订阅,实测有改善消息通知失效问题 1046/1 1046/head 1047/target/1 1048/target/1 1049/target/1 1050/target/1
authorhcj <1224667075@qq.com>
Sat, 28 Sep 2024 06:59:40 +0000 (14:59 +0800)
committerhcj <1224667075@qq.com>
Sat, 28 Sep 2024 06:59:40 +0000 (14:59 +0800)
code/sdk/application/wearable/service/ble_service/bleservice/bleANCS.c
code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c

index 18e083e..763a23a 100644 (file)
@@ -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;
 }
 
index d222449..e4520d8 100644 (file)
@@ -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;
     }