PPPoS modem library

Palonso
Posts: 95
Joined: Tue Sep 24, 2019 8:43 pm

PPPoS modem library

Postby Palonso » Mon Oct 14, 2019 10:05 pm

Hi,

I need to use the PPPoS API from ESP-IDF, so I've tried the pppos_example code (with some modifications) and managed to make it work as I wanted for my application.

The problem is that when I tried to add it to my main project the program simply won't compile, and i have the next output:

Code: Select all

/home/pablo/esp/Proyect/components/modem/src/esp_modem.c:63:18: error: field 'pppif' has incomplete type
     struct netif pppif;                     /*!< PPP network interface */
                  ^~~~~
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c:64:5: error: unknown type name 'ppp_pcb'
     ppp_pcb *ppp;                           /*!< PPP control block */
     ^~~~~~~
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c: In function 'esp_handle_uart_data':
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c:140:9: error: implicit declaration of function 'pppos_input_tcpip' [-Werror=implicit-function-declaration]
         pppos_input_tcpip(esp_dte->ppp, esp_dte->buffer, length);
         ^~~~~~~~~~~~~~~~~
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c: At top level:
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c:454:35: error: unknown type name 'ppp_pcb'
 static void on_ppp_status_changed(ppp_pcb *pcb, int err_code, void *ctx)
                                   ^~~~~~~
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c:571:40: error: unknown type name 'ppp_pcb'
 static uint32_t pppos_low_level_output(ppp_pcb *pcb, uint8_t *data, uint32_t len, void *ctx)
                                        ^~~~~~~
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c: In function 'esp_modem_setup_ppp':
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c:587:20: error: implicit declaration of function 'pppapi_pppos_create' [-Werror=implicit-function-declaration]
     esp_dte->ppp = pppapi_pppos_create(&(esp_dte->pppif), pppos_low_level_output, on_ppp_status_changed, dte);
                    ^~~~~~~~~~~~~~~~~~~
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c:587:59: error: 'pppos_low_level_output' undeclared (first use in this function); did you mean 'esp_log_level_set'?
     esp_dte->ppp = pppapi_pppos_create(&(esp_dte->pppif), pppos_low_level_output, on_ppp_status_changed, dte);
                                                           ^~~~~~~~~~~~~~~~~~~~~~
                                                           esp_log_level_set
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c:587:59: note: each undeclared identifier is reported only once for each function it appears in
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c:587:83: error: 'on_ppp_status_changed' undeclared (first use in this function)
     esp_dte->ppp = pppapi_pppos_create(&(esp_dte->pppif), pppos_low_level_output, on_ppp_status_changed, dte);
                                                                                   ^~~~~~~~~~~~~~~~~~~~~
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c:594:17: error: implicit declaration of function 'pppapi_set_default' [-Werror=implicit-function-declaration]
     MODEM_CHECK(pppapi_set_default(esp_dte->ppp) == ERR_OK, "set default route failed", err);
                 ^~~~~~~~~~~~~~~~~~
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c:43:15: note: in definition of macro 'MODEM_CHECK'
         if (!(a))                                                                       \
               ^
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c:596:5: error: implicit declaration of function 'ppp_set_usepeerdns' [-Werror=implicit-function-declaration]
     ppp_set_usepeerdns(esp_dte->ppp, 1);
     ^~~~~~~~~~~~~~~~~~
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c:603:2: error: #error "Unsupported AUTH Negotiation"
 #error "Unsupported AUTH Negotiation"
  ^~~~~
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c:606:17: error: implicit declaration of function 'pppapi_connect' [-Werror=implicit-function-declaration]
     MODEM_CHECK(pppapi_connect(esp_dte->ppp, 0) == ERR_OK, "initiate ppp negotiation failed", err);
                 ^~~~~~~~~~~~~~
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c:43:15: note: in definition of macro 'MODEM_CHECK'
         if (!(a))                                                                       \
               ^
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c: In function 'esp_modem_exit_ppp':
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c:619:17: error: implicit declaration of function 'pppapi_close'; did you mean 'pclose'? [-Werror=implicit-function-declaration]
     MODEM_CHECK(pppapi_close(esp_dte->ppp, 0) == ERR_OK, "close ppp connection failed", err);
                 ^~~~~~~~~~~~
/home/pablo/esp/Proyect/components/modem/src/esp_modem.c:43:15: note: in definition of macro 'MODEM_CHECK'
         if (!(a))                                                                       \
               ^
cc1: some warnings being treated as errors
/home/pablo/esp/esp-idf/make/component_wrapper.mk:291: recipe for target 'src/esp_modem.o' failed
make[1]: *** [src/esp_modem.o] Error 1
/home/pablo/esp/esp-idf/make/project.mk:604: recipe for target 'component-modem-build' failed
make: *** [component-modem-build] Error 2

I don't know why it says that some functions are "undeclared" or "undefined" when that's the point of using libraries.

Is this some problem with the compiler? I have the same CMake files as the pppos_example project.

Does someone has any idea?

Thanks,
P

akbarhash
Posts: 7
Joined: Thu Sep 05, 2019 6:35 am

Re: PPPoS modem library

Postby akbarhash » Tue Oct 15, 2019 4:30 am

enable pppos in menuconfig
components -> lwip -> enable PPP support
also inside
do
notify call back
and
pap support
save build it will work

Who is online

Users browsing this forum: No registered users and 136 guests