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
@@ -53,7 +53,7 @@ static esp_err_t esp_modem_dte_transmit(void *h, void *buffer, size_t len)
* @param esp_netif handle to esp-netif object
* @param args pointer to modem-netif driver
*
- * @return ESP_OK on success
+ * @return ESP_OK on success, modem-start error code if starting failed
*/
static esp_err_t esp_modem_post_attach_start(esp_netif_t * esp_netif, void * args)
{
@@ -66,8 +66,7 @@ static esp_err_t esp_modem_post_attach_start(esp_netif_t * esp_netif, void * arg
};
driver->base.netif = esp_netif;
ESP_ERROR_CHECK(esp_netif_set_driver_config(esp_netif, &driver_ifconfig));
- esp_modem_start_ppp(dte);
- return ESP_OK;
+ return esp_modem_start_ppp(dte);
}
/**
