Runtime setting of APN when using the 'LTE Link Controller' library

Our system is working fine defining the default APN in the prj.conf file. We are using the LTE Link Controller. 

What I need to do is set the APN based on the SIM that happens to be installed (without a recompile). This is pretty standard behavior on most products I am familiar with. 

The LTE Link Controller documentation states that the APN can be set (as well as a number of things) but I don't see any API to do so. From the documentation: 

"The LTE link can be controlled through library configurations and API calls to enable a range of features such as specifying the Access Point Name (APN), switching between LTE network modes (NB-IoT or LTE-M), enabling GNSS support ... snip.... "

I assume this would be done after the call to lte_lc_init() and the call to lte_lc_connect() but I am not really sure. Perhaps I am going about this all wrong. I really trying to avoid re-inventing the wheel and use the link_controller provided by Nordic as it seems very complete except for an obvious way to set the APN. 

If I use the PDN library, I am not sure how compatible that is with the lte link controller operation. I am not even sure what context ID the link controller is using. 

Any ideas or pointers to documentation? 

  • Hi Riley,

    Thank you for contacting DevZone at NordicSemi.

    The LTE Link Controller documentation states that the APN can be set (as well as a number of things) but I don't see any API to do so. From the documentation: 

    Yes, you are referring to the LTE Link Controller library in the Modem Libraries.

    There are other libraries within the Modem Libraries page:

    Modem Information library can be used to obtain specific data from modem.

    PDN Library can be used to manage PDP contexts and connections.

    Yes, the PDN library is compatible with LTE Link Controller.

    Have a look at this PDN sample for nrf9160 (source code: PDN Sample on GIT) to 

    There is more discussion here if you find it relevant.

    Regards,

    Naeem

Related