From: luozheng <1732036298@qq.com> Date: Tue, 14 Oct 2025 03:11:53 +0000 (+0800) Subject: ln设备接口文档更新 X-Git-Tag: V1.0.9_20251128_194606_LN~251^2~9 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=29e4528308a5dbf98c4a981e5134cb7f7ca4a46c;p=mirrors%2FFD230.git ln设备接口文档更新 --- diff --git a/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c b/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c index 200e5ea2b..4de93ce6a 100644 --- a/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c +++ b/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c @@ -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; } } diff --git a/code/sdk/zhihui/leiniao/imsl_ln/ln_api_token.c b/code/sdk/zhihui/leiniao/imsl_ln/ln_api_token.c index 6bc2d56af..fcdf2341a 100644 --- a/code/sdk/zhihui/leiniao/imsl_ln/ln_api_token.c +++ b/code/sdk/zhihui/leiniao/imsl_ln/ln_api_token.c @@ -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; } diff --git "a/code/sdk/zhihui/leiniao/\350\256\276\345\244\207API\346\216\245\345\217\243\346\226\207\346\241\243.md" "b/code/sdk/zhihui/leiniao/\350\256\276\345\244\207API\346\216\245\345\217\243\346\226\207\346\241\243.md" index 60418e086..105ea0935 100644 --- "a/code/sdk/zhihui/leiniao/\350\256\276\345\244\207API\346\216\245\345\217\243\346\226\207\346\241\243.md" +++ "b/code/sdk/zhihui/leiniao/\350\256\276\345\244\207API\346\216\245\345\217\243\346\226\207\346\241\243.md" @@ -1595,8 +1595,8 @@ WebSocket连接需要设备Token认证,有以下两种方式传递Token: "data": { "textContent": "你好,我听到了你的话", "audioUrl": "https://example.com/response_audio.mp3", - "intention": null, - "npcEmotion": null + "intention": "None", + "npcEmotion": "Winking" } } } @@ -1608,7 +1608,8 @@ WebSocket连接需要设备Token认证,有以下两种方式传递Token: |--------|------|------| | textContent | String | 回复的文本内容 | | audioUrl | String | 回复音频文件URL | -| intention | String | 用户意图识别结果,如"StartSleepMode"等 | +| audioDuration | Integer | 回复音频时长,单位:毫秒 | +| intention | String | 用户意图识别结果,如"None","StartSleepMode"等 | | npcEmotion | String | NPC情感状态,如"happy"等 |