From cc47c934744c759fa47133fc70b7d23aa4a2d7f1 Mon Sep 17 00:00:00 2001
From: nancy.liao <huihui.liao@greentest.com.cn>
Date: 周一, 21 4月 2025 19:55:59 +0800
Subject: [PATCH] 修改了一部分的宏定义声明和屏蔽了一些调试时的无效干扰

---
 examples/test-LwIP-netconn/scpi_server.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/examples/test-LwIP-netconn/scpi_server.c b/examples/test-LwIP-netconn/scpi_server.c
index 2018bcd..6147235 100644
--- a/examples/test-LwIP-netconn/scpi_server.c
+++ b/examples/test-LwIP-netconn/scpi_server.c
@@ -246,6 +246,10 @@
         } else {
             /* connection established */
             SCPI_Event_DeviceConnected(context, newconn);
+            ip_set_option(newconn->pcb.tcp, SOF_KEEPALIVE);
+            newconn->pcb.tcp->keep_idle   = SCPI_KEEP_IDLE;  // Override TCP_KEEPIDLE_DEFAULT  for this connection.
+            newconn->pcb.tcp->keep_intvl  = SCPI_KEEP_INTVL; // Override TCP_KEEPINTVL_DEFAULT for this connection.
+            newconn->pcb.tcp->keep_cnt    = SCPI_KEEP_CNT;   // Override TCP_KEEPCNT_DEFAULT   for this connection.
             user_data->io = newconn;
         }
     }
@@ -263,6 +267,10 @@
         } else {
             /* control connection established */
             SCPI_Event_ControlConnected(context, newconn);
+            ip_set_option(newconn->pcb.tcp, SOF_KEEPALIVE);
+            newconn->pcb.tcp->keep_idle   = SCPI_KEEP_IDLE;  // Override TCP_KEEPIDLE_DEFAULT  for this connection.
+            newconn->pcb.tcp->keep_intvl  = SCPI_KEEP_INTVL; // Override TCP_KEEPINTVL_DEFAULT for this connection.
+            newconn->pcb.tcp->keep_cnt    = SCPI_KEEP_CNT;   // Override TCP_KEEPCNT_DEFAULT   for this connection.
             user_data->control_io = newconn;
         }
     }

--
Gitblit v1.9.1