Merge #2340 into sdk650pathc0423 from refs/changes/2340/head 2342/target/1
author胡传军 <1224667075@qq.com>
Sat, 20 Sep 2025 13:02:17 +0000 (13:02 +0000)
committer罗正 <1732036298@qq.com>
Sat, 20 Sep 2025 13:02:17 +0000 (13:02 +0000)
Code review from 胡传军

* refs/changes/2340/head: (5 commits squashed)

  - 修改ws 的stop调用

  - 增加ln ws休眠接口

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - 扩大ws栈

  - 合并

Signed-off-by: aliyun8003852482 <1224667075@qq.com>
Merged-by: 罗正 <1732036298@qq.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/2340
code/sdk/zhihui/leiniao/imsl_ln/ln_api_websocket.c

index 86251d1..da7d709 100644 (file)
@@ -140,7 +140,7 @@ static void ln_ws_on_close(int client)
     printf("WebSocketClientConstructor [LN][WS] ln_ws_on_close %d\r\n",client);
     
     // 在断开回调触发时,将关闭状态设置为成功
-    g_ws_close_status = WS_CLOSE_SUCCESS;
+ 
     printf("[LN][WS] WebSocket close callback triggered, status set to SUCCESS (%d)\n", g_ws_close_status);
     
     g_ws_connected = WS_STATE_DISCONNECTED;
@@ -148,9 +148,13 @@ static void ln_ws_on_close(int client)
     if(g_ws_client_fd>=0)
     {
         // 这里不再调用 ln_ws_close_with_status,因为回调已经触发说明关闭成功
+        if(g_ws_close_status==WS_CLOSE_NOT_EXECUTED)
+        {
+            // int ret = WebSocketClientClose(g_ws_client_fd);
+       
+        }
         g_ws_client_fd=-1;
     }
-
     /* 断开后增加重连计数,由监督线程在下一次连接时携带 */
     if (g_ws_running) {
         if (g_ws_reconnect_count < 0xFFFFFFFFu) {
@@ -415,7 +419,7 @@ int ln_ws_start(ws_message_callback_t callback)
         app_task_definition_ext_t main_task = {
             .attr = {
                 .name = "ln_ws_main",
-                .stack_size = 4096,
+                .stack_size = 0x2000,
                 .priority = osPriorityNormal
             },
             .func = ln_ws_main_thread,