Skip to content

Commit 8f0ec8b

Browse files
committed
pppos client: modem netif fix ignoring potential modem-start error
esp-modem netif glue layer implements esp-netif attach callback to setup corresponding driver functions and start the modem. The error code of esp_modem_start_ppp() was ignored and ESP_OK returned in all cases. Fixed by passing esp_modem_start_ppp()'s error code to post_attach callback. Closes espressif/esp-idf#5430
1 parent 0578214 commit 8f0ec8b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

examples/protocols/pppos_client/components/modem/src/esp_modem_netif.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static esp_err_t esp_modem_dte_transmit(void *h, void *buffer, size_t len)
5353
* @param esp_netif handle to esp-netif object
5454
* @param args pointer to modem-netif driver
5555
*
56-
* @return ESP_OK on success
56+
* @return ESP_OK on success, modem-start error code if starting failed
5757
*/
5858
static esp_err_t esp_modem_post_attach_start(esp_netif_t * esp_netif, void * args)
5959
{
@@ -66,8 +66,7 @@ static esp_err_t esp_modem_post_attach_start(esp_netif_t * esp_netif, void * arg
6666
};
6767
driver->base.netif = esp_netif;
6868
ESP_ERROR_CHECK(esp_netif_set_driver_config(esp_netif, &driver_ifconfig));
69-
esp_modem_start_ppp(dte);
70-
return ESP_OK;
69+
return esp_modem_start_ppp(dte);
7170
}
7271

7372
/**

0 commit comments

Comments
 (0)