diff --git a/ESPTest/src/main.c b/ESPTest/src/main.c index 3b458b7..4bcc2d9 100644 --- a/ESPTest/src/main.c +++ b/ESPTest/src/main.c @@ -13,6 +13,17 @@ #include "lwip/err.h" #include "lwip/sys.h" +static const char *WIFI_TAG = "wifi station"; +static const char *SERVER_TAG = "http server"; + +int my_hook(struct pbuf *pbuf, struct netif *input_netif) +{ + ESP_LOGI(WIFI_TAG, "TESTING!"); + return ESP_OK; +} + +#define LWIP_HOOK_IP4_INPUT(pbuf, input_netif) my_hook(pbuf, input_netif) + /* FreeRTOS event group to signal when we are connected*/ static EventGroupHandle_t s_wifi_event_group; @@ -22,9 +33,6 @@ static EventGroupHandle_t s_wifi_event_group; #define WIFI_CONNECTED_BIT BIT0 #define WIFI_FAIL_BIT BIT1 -static const char *WIFI_TAG = "wifi station"; -static const char *SERVER_TAG = "http server"; - static int s_retry_num = 0; static void event_handler(void *arg, esp_event_base_t event_base, @@ -118,14 +126,6 @@ void wifi_init_sta(void) } } -int my_hook(struct pbuf *pbuf, struct netif *input_netif) -{ - ESP_LOGI(WIFI_TAG, "TESTING!"); - return ESP_OK; -} - -#define LWIP_HOOK_IP4_INPUT(pbuf, input_netif) my_hook(pbuf, input_netif) - static esp_err_t hello_get_handler(httpd_req_t *req) { /* Send response with custom headers and body set as the