Using modem/nrf_modem_lib.h and modem/lte_lc.h

Hello dear Nordic support staff,

I'm working on some legacy code (NCS 1.8.0 in case it's relevant) and see this in the inclusion list of one of the files:

#include <modem/nrf_modem_lib.h>
#include <modem/lte_lc.h>

Functions from both libraries are used to set up the modem and create a connection. I'm new to network code on the nrf9160, but looking at samples and documentation, it seems like using only one of the libraries is enough, where you choose lte_lc if you want more granular control.

E.g, the udp sample uses only lte_lc.h, while the http_update sample uses only nrf_modem_lib.h. I also see that the modem_shell sample uses both. Why?

Parents
  • Hello,

    Functions from both libraries are used to set up the modem and create a connection. I'm new to network code on the nrf9160, but looking at samples and documentation, it seems like using only one of the libraries is enough, where you choose lte_lc if you want more granular control.

    I think it should be the other way around, modem library is for more granular control. lte_lc library uses the modem library for setting up and handling LTE connection, including setting PSM and EDRX. If you want full control you should rather use the modem library. Then you will also be able to send AT commands directly to the modem. The lte_lc library is mostly for convenience as far as I know.

Reply
  • Hello,

    Functions from both libraries are used to set up the modem and create a connection. I'm new to network code on the nrf9160, but looking at samples and documentation, it seems like using only one of the libraries is enough, where you choose lte_lc if you want more granular control.

    I think it should be the other way around, modem library is for more granular control. lte_lc library uses the modem library for setting up and handling LTE connection, including setting PSM and EDRX. If you want full control you should rather use the modem library. Then you will also be able to send AT commands directly to the modem. The lte_lc library is mostly for convenience as far as I know.

Children
No Data
Related