ln设备接口文档更新
authorluozheng <1732036298@qq.com>
Tue, 14 Oct 2025 03:11:53 +0000 (11:11 +0800)
committerluozheng <1732036298@qq.com>
Tue, 14 Oct 2025 03:11:53 +0000 (11:11 +0800)
code/sdk/zhihui/leiniao/imsl_ln/ln_api.c
code/sdk/zhihui/leiniao/imsl_ln/ln_api_token.c
code/sdk/zhihui/leiniao/设备API接口文档.md

index 200e5ea..4de93ce 100644 (file)
@@ -288,6 +288,16 @@ char *uapi_ln_get_device_token(void)
         else
         {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[TOKEN] 刷新 Token 失败");
+            websocket_retry_connect_count++;
+            if (websocket_retry_connect_count >= 100)
+            {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[TOKEN] 网络离线,无法刷新 Token,重试次数超过10次,进入休眠");
+                ln_ws_enter_sleep();
+            }
+            else
+            {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[TOKEN] 网络离线,无法刷新 Token,重试次数: %d", websocket_retry_connect_count);
+            }
             return NULL;
         }
     }
index 6bc2d56..fcdf234 100644 (file)
@@ -230,7 +230,7 @@ uint32_t ln_get_device_token_http(const char *device_id,
 {
     if (device_id == NULL || device_iccid == NULL)
     {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ln_get_device_token_http: invalid parameters");
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ln_get_device_token_http: invalid parameters,device_id=%s,device_iccid=%s", device_id, device_iccid);
         return ERRCODE_FAIL;
     }
 
index 60418e0..105ea09 100644 (file)
@@ -1595,8 +1595,8 @@ WebSocket连接需要设备Token认证,有以下两种方式传递Token:
     "data": {\r
       "textContent": "你好,我听到了你的话",\r
       "audioUrl": "https://example.com/response_audio.mp3",\r
-      "intention": null,\r
-      "npcEmotion": null\r
+      "intention": "None",\r
+      "npcEmotion": "Winking"\r
     }\r
   }\r
 }\r
@@ -1608,7 +1608,8 @@ WebSocket连接需要设备Token认证,有以下两种方式传递Token:
 |--------|------|------|\r
 | textContent | String | 回复的文本内容 |\r
 | audioUrl | String | 回复音频文件URL |\r
-| intention | String | 用户意图识别结果,如"StartSleepMode"等 |\r
+| audioDuration | Integer | 回复音频时长,单位:毫秒 |\r
+| intention | String | 用户意图识别结果,如"None","StartSleepMode"等 |\r
 | npcEmotion | String | NPC情感状态,如"happy"等 |\r
 \r
 \r