@@ -163,6 +163,7 @@ static int get_netif_num(esp_netif_t *netif)
163163 return netif_cnt ;
164164}
165165
166+ #ifdef CONFIG_EPPP_LINK_USES_PPP
166167static void on_ppp_event (void * arg , esp_event_base_t base , int32_t event_id , void * data )
167168{
168169 esp_netif_t * * netif = data ;
@@ -172,6 +173,7 @@ static void on_ppp_event(void *arg, esp_event_base_t base, int32_t event_id, voi
172173 h -> netif_stop = true;
173174 }
174175}
176+ #endif // CONFIG_EPPP_LINK_USES_PPP
175177
176178static void on_ip_event (void * arg , esp_event_base_t base , int32_t event_id , void * data )
177179{
@@ -222,7 +224,9 @@ static void remove_handlers(void)
222224 vEventGroupDelete (s_event_group );
223225 s_event_group = NULL ;
224226 esp_event_handler_unregister (IP_EVENT , ESP_EVENT_ANY_ID , on_ip_event );
227+ #ifdef CONFIG_EPPP_LINK_USES_PPP
225228 esp_event_handler_unregister (NETIF_PPP_STATUS , ESP_EVENT_ANY_ID , on_ppp_event );
229+ #endif
226230 }
227231}
228232
@@ -296,11 +300,13 @@ esp_netif_t *eppp_open(eppp_type_t role, eppp_config_t *config, int connect_time
296300 remove_handlers ();
297301 return NULL ;
298302 }
303+ #ifdef CONFIG_EPPP_LINK_USES_PPP
299304 if (esp_event_handler_register (NETIF_PPP_STATUS , ESP_EVENT_ANY_ID , on_ppp_event , NULL ) != ESP_OK ) {
300305 ESP_LOGE (TAG , "Failed to register PPP status handler" );
301306 remove_handlers ();
302307 return NULL ;
303308 }
309+ #endif // CONFIG_EPPP_LINK_USES_PPP
304310 }
305311 esp_netif_t * netif = eppp_init (role , config );
306312 if (!netif ) {
0 commit comments