From 5680ce5f56208d94bf8b5bc0e11dcd99db333623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Teppo=20J=C3=A4rvelin?= Date: Tue, 5 Mar 2019 12:08:35 +0200 Subject: [PATCH] Increased timeout for lwip waiting netif_is_link_up Cellular PPP connect fails too often if timeout is 15s so increased to 60 seconds. Tested to be enough with BG96 and MTB_MTS_DRAGONFLY. --- features/lwipstack/LWIPInterface.cpp | 2 +- features/lwipstack/lwipopts.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/features/lwipstack/LWIPInterface.cpp b/features/lwipstack/LWIPInterface.cpp index e713d9f607..9166f4e1da 100644 --- a/features/lwipstack/LWIPInterface.cpp +++ b/features/lwipstack/LWIPInterface.cpp @@ -647,7 +647,7 @@ nsapi_error_t LWIP::Interface::bringup(bool dhcp, const char *ip, const char *ne if (!netif_is_link_up(&netif)) { if (blocking) { - if (osSemaphoreAcquire(linked, 15000) != osOK) { + if (osSemaphoreAcquire(linked, LINK_TIMEOUT * 1000) != osOK) { if (ppp) { (void) ppp_lwip_disconnect(hw); } diff --git a/features/lwipstack/lwipopts.h b/features/lwipstack/lwipopts.h index 9deced5ab2..da9b6c443c 100644 --- a/features/lwipstack/lwipopts.h +++ b/features/lwipstack/lwipopts.h @@ -58,6 +58,7 @@ #endif #define DHCP_TIMEOUT 60 +#define LINK_TIMEOUT 60 #define PREF_IPV4 1 #define PREF_IPV6 2