diff --git a/components/ethernet/common/dhcp_client.c b/components/ethernet/common/dhcp_client.c index fb00528c8..4c5b4d7f1 100644 --- a/components/ethernet/common/dhcp_client.c +++ b/components/ethernet/common/dhcp_client.c @@ -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, }; @@ -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 @@ -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; @@ -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); diff --git a/components/ethernet/w5500/w5500.c b/components/ethernet/w5500/w5500.c index 2dcf1c9de..9d369e133 100644 --- a/components/ethernet/w5500/w5500.c +++ b/components/ethernet/w5500/w5500.c @@ -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" diff --git a/components/network/websocket/luat_websocket.c b/components/network/websocket/luat_websocket.c index 71b9f7d5d..aaa888de7 100644 --- a/components/network/websocket/luat_websocket.c +++ b/components/network/websocket/luat_websocket.c @@ -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); diff --git a/luat/include/luat_timer.h b/luat/include/luat_timer.h index bb3d59579..85d684499 100644 --- a/luat/include/luat_timer.h +++ b/luat/include/luat_timer.h @@ -2,7 +2,9 @@ #define LUAT_TIMER_H #include "luat_base.h" +#ifdef __LUATOS__ #include "luat_msgbus.h" +#endif typedef struct luat_timer { @@ -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;