Skip to content

Commit

Permalink
Merge branch 'master' of https://gitee.com/openLuat/LuatOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Dozingfiretruck committed Nov 9, 2023
2 parents 573bbb9 + ab035f8 commit ae04a5f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions components/ethernet/common/dhcp_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ void make_ip4_dhcp_select_msg(dhcp_client_info_t *dhcp, uint16_t flag, Buffer_St
31,33,43,44,46,47,
DHCP_OPTION_SERVER_ID,
DHCP_OPTION_LEASE_TIME,
DHCP_OPTION_IP_TTL,
119,121,249,252
//DHCP_OPTION_138,
};
Expand Down Expand Up @@ -280,6 +279,8 @@ int ip4_dhcp_run(dhcp_client_info_t *dhcp, Buffer_Struct *in, Buffer_Struct *out
dhcp->last_tx_time = 0;
dhcp->lease_p1_time = 0;
dhcp->lease_p2_time = 0;
dhcp->weak_temp_ip = 0;
dhcp->weak_server_ip = 0;
}
}
else
Expand Down Expand Up @@ -367,7 +368,6 @@ int ip4_dhcp_run(dhcp_client_info_t *dhcp, Buffer_Struct *in, Buffer_Struct *out
if (in && (result == DHCP_OFFER))
{
LLOGD("select offer, wait ack");
dhcp->xid++;
dhcp->state = DHCP_STATE_WAIT_SELECT_ACK;
dhcp->wait_selec_ack_cnt = 0;
goto DHCP_NEED_REQUIRE;
Expand Down Expand Up @@ -420,7 +420,7 @@ int ip4_dhcp_run(dhcp_client_info_t *dhcp, Buffer_Struct *in, Buffer_Struct *out
}
else
{
if (luat_mcu_tick64_ms() >= (dhcp->last_tx_time + 2100))
if (luat_mcu_tick64_ms() >= (dhcp->last_tx_time + 1900))
{
dhcp->wait_selec_ack_cnt++;
LLOGD("select ip no ack,resend %d", dhcp->wait_selec_ack_cnt);
Expand Down
2 changes: 2 additions & 0 deletions components/ethernet/w5500/w5500.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
#include "luat_spi.h"
#ifdef LUAT_USE_W5500
#include "luat_rtos.h"
#ifdef __LUATOS__
#include "luat_zbuff.h"
#endif
#include "luat_gpio.h"
#include "w5500_def.h"
#include "luat_crypto.h"
Expand Down
4 changes: 2 additions & 2 deletions components/network/websocket/luat_websocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,13 +596,13 @@ int32_t luat_websocket_callback(void *data, void *param)
}
// LLOGD("luat_websocket_read_packet ret:%d",ret);
luat_stop_rtos_timer(websocket_ctrl->ping_timer);
luat_start_rtos_timer(websocket_ctrl->ping_timer, websocket_ctrl->keepalive * 1000 * 0.75, 1);
luat_start_rtos_timer(websocket_ctrl->ping_timer, websocket_ctrl->keepalive * 1000, 1);
}
}
else if (event->ID == EV_NW_RESULT_TX)
{
luat_stop_rtos_timer(websocket_ctrl->ping_timer);
luat_start_rtos_timer(websocket_ctrl->ping_timer, websocket_ctrl->keepalive * 1000 * 0.75, 1);
luat_start_rtos_timer(websocket_ctrl->ping_timer, websocket_ctrl->keepalive * 1000, 1);
if (websocket_ctrl->frame_wait) {
websocket_ctrl->frame_wait --;
l_luat_websocket_msg_cb(websocket_ctrl, WEBSOCKET_MSG_SENT, 0);
Expand Down
5 changes: 5 additions & 0 deletions luat/include/luat_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#define LUAT_TIMER_H

#include "luat_base.h"
#ifdef __LUATOS__
#include "luat_msgbus.h"
#endif

typedef struct luat_timer
{
Expand All @@ -11,7 +13,10 @@ typedef struct luat_timer
size_t timeout;
size_t type;
int repeat;
#ifdef __LUATOS__
luat_msg_handler func;
#endif

}luat_timer_t;


Expand Down

0 comments on commit ae04a5f

Please sign in to comment.