Compare commits

..

2 Commits

Author SHA1 Message Date
吴俊潮 887c05a289 Merge branch 'develop' of http://git.jsgsdt.com:8070/wxsmart-test/acdt into develop 2025-04-23 20:07:13 +08:00
吴俊潮 5038e83734 存档:
1、拔插服务端网线可以实现重连;
2、软件重开可以实现重连;
3、客户端拔插网线(断网)。无法实现重连;
2025-04-23 19:55:13 +08:00
11 changed files with 7852 additions and 6925 deletions

View File

@ -454,7 +454,6 @@ void ch395_interrupt_handler(void)
{
uint16_t init_status;
init_status = ch395_cmd_get_glob_int_status_all();
if (init_status & GINT_STAT_UNREACH) /* 不可达中断,读取不可达信息 */
@ -564,11 +563,24 @@ void ch395q_handler(void)
* @param
* @retval
*/
//socket_watch[0]:0x05->socket_open, 0x00->socket_closed
//socket_watch[1]:0x01->listen, 0x04->established
uint8_t socket_watch[8][2];
uint8_t rec_test_flag = 0;
void ch395_reconnection(void)
{
for (uint8_t socket_index = CH395Q_SOCKET_0 ; socket_index <= CH395Q_SOCKET_7 ; socket_index ++ )
if (rec_test_flag == 1)
{
rec_test_flag = 0;
//ch395_tcp_disconnect(0);
ch395_close_socket(0);
}
for (uint8_t socket_index = CH395Q_SOCKET_0 ; socket_index <= CH395Q_SOCKET_7 ; socket_index ++ )
{
/* 检查sokect是否打开成功 */
if (g_ch395q_sta.phy_status == PHY_DISCONN && (g_ch395q_sta.dhcp_status == DHCP_UP || g_ch395q_sta.dhcp_status == DHCP_DOWN || g_ch395q_sta.dhcp_status == DHCP_STA))
{
reconnect_times++;
@ -583,6 +595,14 @@ void ch395_reconnection(void)
}
else
{
ch395_cmd_get_socket_status(socket_index, socket_watch[socket_index]);
if(socket_watch[CH395Q_SOCKET_0][0] != 0x05)
{
//客户端断连后会关闭socket因此在这里重新打开
ch395_open_socket(CH395Q_SOCKET_0);
ch395_tcp_listen(CH395Q_SOCKET_0);
}
if (g_ch395q_sta.phy_status != PHY_DISCONN && g_ch395q_sta.socket[socket_index].config.socket_enable == CH395Q_DISABLE)
{
g_ch395q_sta.socket[socket_index].config.socket_enable = CH395Q_ENABLE;
@ -669,8 +689,8 @@ uint16_t ch395_port = 8080;
//uint8_t ch395_macaddr[6] = {0x5C,0x53,0x10,0x6C,0x18,0x49};
/* 远程IP地址设置 */
//uint8_t ch395_des_ipaddr[4] = {192,168,1,111};
static uint8_t socket0_send_buf[1024];
static uint8_t socket0_recv_buf[1024];
static uint8_t socket0_send_buf[255];
static uint8_t socket0_recv_buf[255];
ch395_socket cha95_sockct_sta[8];
/**

File diff suppressed because one or more lines are too long

View File

@ -223,12 +223,12 @@
<Ww>
<count>14</count>
<WinNumber>1</WinNumber>
<ItemText>p_flt_window</ItemText>
<ItemText>socket_watch</ItemText>
</Ww>
<Ww>
<count>15</count>
<WinNumber>1</WinNumber>
<ItemText>temp_5803</ItemText>
<ItemText>rec_test_flag</ItemText>
</Ww>
</WatchWindow1>
<Tracepoint>

Binary file not shown.

View File

@ -1,9 +1,9 @@
<html>
<body>
<pre>
<h1>µVision Build Log</h1>
<h1><EFBFBD>Vision Build Log</h1>
<h2>Tool Versions:</h2>
IDE-Version: ¦ÌVision V5.39.0.0
IDE-Version: <EFBFBD><EFBFBD>Vision V5.39.0.0
Copyright (C) 2023 ARM Ltd and ARM Germany GmbH. All rights reserved.
License Information: 1111 admin, 111, LIC=CZLZX-HG49K-CXUU6-DWQ8R-YUSX2-8I4LW
@ -29,7 +29,7 @@ Project File Date: 04/09/2025
Build target 'VOQC'
compiling gpios.c...
linking...
Program Size: Code=37462 RO-data=514 RW-data=516 ZI-data=9908
Program Size: Code=41082 RO-data=514 RW-data=548 ZI-data=8564
FromELF: creating hex file...
"VOQC\VOQC.axf" - 0 Error(s), 0 Warning(s).
@ -54,7 +54,7 @@ Package Vendor: Keil
<h2>Collection of Component Files used:</h2>
* Component: ARM::CMSIS:CORE@5.6.0
Build Time Elapsed: 00:00:08
Build Time Elapsed: 00:00:10
</pre>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.