diff --git a/src/PPPOS.c b/src/PPPOS.c index 3ac487d..f18e95f 100644 --- a/src/PPPOS.c +++ b/src/PPPOS.c @@ -1,16 +1,16 @@ #include -#include +#include "FreeRTOS.h" //#include "freertos/task.h" //#include "freertos/event_groups.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include "tcpip_adapter.h" +#include "netif/ppp/pppos.h" +#include "lwip/err.h" +#include "lwip/sockets.h" +#include "lwip/sys.h" +#include "lwip/netdb.h" +#include "lwip/dns.h" +#include "netif/ppp/pppapi.h" #include "PPPOS.h" @@ -45,85 +45,85 @@ static void ppp_status_cb(ppp_pcb *pcb, int err_code, void *ctx) switch (err_code) { case PPPERR_NONE: { - ESP_LOGE(TAG, "status_cb: Connected\n"); + //ESP_LOGE(TAG, "status_cb: Connected\n"); #if PPP_IPV4_SUPPORT - ESP_LOGE(TAG, " ipaddr_v4 = %s\n", ipaddr_ntoa(&pppif->ip_addr)); - ESP_LOGE(TAG, " gateway = %s\n", ipaddr_ntoa(&pppif->gw)); - ESP_LOGE(TAG, " netmask = %s\n", ipaddr_ntoa(&pppif->netmask)); + //ESP_LOGE(TAG, " ipaddr_v4 = %s\n", ipaddr_ntoa(&pppif->ip_addr)); + //ESP_LOGE(TAG, " gateway = %s\n", ipaddr_ntoa(&pppif->gw)); + //ESP_LOGE(TAG, " netmask = %s\n", ipaddr_ntoa(&pppif->netmask)); #endif /* PPP_IPV4_SUPPORT */ #if PPP_IPV6_SUPPORT - ESP_LOGE(TAG, " ipaddr_v6 = %s\n", ip6addr_ntoa(netif_ip6_addr(pppif, 0))); + //ESP_LOGE(TAG, " ipaddr_v6 = %s\n", ip6addr_ntoa(netif_ip6_addr(pppif, 0))); #endif /* PPP_IPV6_SUPPORT */ PPPOS_connected = true; break; } case PPPERR_PARAM: { - ESP_LOGE(TAG, "status_cb: Invalid parameter\n"); + //ESP_LOGE(TAG, "status_cb: Invalid parameter\n"); break; } case PPPERR_OPEN: { - ESP_LOGE(TAG, "status_cb: Unable to open PPP session\n"); + //ESP_LOGE(TAG, "status_cb: Unable to open PPP session\n"); break; } case PPPERR_DEVICE: { - ESP_LOGE(TAG, "status_cb: Invalid I/O device for PPP\n"); + //ESP_LOGE(TAG, "status_cb: Invalid I/O device for PPP\n"); break; } case PPPERR_ALLOC: { - ESP_LOGE(TAG, "status_cb: Unable to allocate resources\n"); + //ESP_LOGE(TAG, "status_cb: Unable to allocate resources\n"); break; } case PPPERR_USER: { - ESP_LOGE(TAG, "status_cb: User interrupt\n"); + //ESP_LOGE(TAG, "status_cb: User interrupt\n"); PPPOS_started = false; PPPOS_connected = false; break; } case PPPERR_CONNECT: { - ESP_LOGE(TAG, "status_cb: Connection lost\n"); + //ESP_LOGE(TAG, "status_cb: Connection lost\n"); PPPOS_started = false; PPPOS_connected = false; break; } case PPPERR_AUTHFAIL: { - ESP_LOGE(TAG, "status_cb: Failed authentication challenge\n"); + //ESP_LOGE(TAG, "status_cb: Failed authentication challenge\n"); PPPOS_started = false; PPPOS_connected = false; break; } case PPPERR_PROTOCOL: { - ESP_LOGE(TAG, "status_cb: Failed to meet protocol\n"); + //ESP_LOGE(TAG, "status_cb: Failed to meet protocol\n"); PPPOS_started = false; PPPOS_connected = false; break; } case PPPERR_PEERDEAD: { - ESP_LOGE(TAG, "status_cb: Connection timeout\n"); + //ESP_LOGE(TAG, "status_cb: Connection timeout\n"); PPPOS_started = false; PPPOS_connected = false; break; } case PPPERR_IDLETIMEOUT: { - ESP_LOGE(TAG, "status_cb: Idle Timeout\n"); + //ESP_LOGE(TAG, "status_cb: Idle Timeout\n"); PPPOS_started = false; PPPOS_connected = false; break; } case PPPERR_CONNECTTIME: { - ESP_LOGE(TAG, "status_cb: Max connect time reached\n"); + //ESP_LOGE(TAG, "status_cb: Max connect time reached\n"); PPPOS_started = false; PPPOS_connected = false; break; } case PPPERR_LOOPBACK: { - ESP_LOGE(TAG, "status_cb: Loopback detected\n"); + //ESP_LOGE(TAG, "status_cb: Loopback detected\n"); PPPOS_started = false; PPPOS_connected = false; break; } default: { - ESP_LOGE(TAG, "status_cb: Unknown error code %d\n", err_code); + //ESP_LOGE(TAG, "status_cb: Unknown error code %d\n", err_code); PPPOS_started = false; PPPOS_connected = false; break;