You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copies the PDN functionality from the PDN library that is about
to be deprecated, and adds it as a module in the LTE link
controller library.
The functionality is the same, but with naming changes to types
and APIs to align with the rest of LTE link controller.
In addition, PDN events are now part of the LTE LC events, and
there is no longer need for a separate event handler.
Signed-off-by: Jan Tore Guggedal <[email protected]>
Copy file name to clipboardExpand all lines: doc/nrf/libraries/modem/lte_lc.rst
+219Lines changed: 219 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -165,6 +165,30 @@ Environment Evaluation:
165
165
* :c:func:`lte_lc_env_eval`
166
166
* :c:func:`lte_lc_env_eval_cancel`
167
167
168
+
PDN (Packet Data Network):
169
+
Use the :kconfig:option:`CONFIG_LTE_LC_PDN_MODULE` Kconfig option to enable all the following functionalities related to PDP context and PDN connection management:
For more information on the callback events received in :c:type:`lte_lc_evt_handler_t` and data associated with each event, see the documentation on :c:struct:`lte_lc_evt`.
169
193
For more information on the functions and data associated with each, refer to the API documentation.
170
194
@@ -275,6 +299,201 @@ The :c:func:`lte_lc_env_eval` function starts the environment evaluation for the
275
299
When the environment evaluation is complete, an :c:enumerator:`LTE_LC_EVT_ENV_EVAL_RESULT` event with the evaluation results is received.
276
300
For each found PLMN, the :c:struct:`lte_lc_conn_eval_params` structure is populated with the evaluation results.
277
301
302
+
.. _lte_lc_pdn:
303
+
304
+
PDN management
305
+
==============
306
+
307
+
The LTE link control library provides functionality to manage Packet Data Protocol (PDP) contexts and Packet Data Network (PDN) connections.
308
+
309
+
The PDN functionality provides the following capabilities:
310
+
311
+
* Creating and configuring PDP contexts
312
+
* Receiving events pertaining to PDN connections
313
+
* Managing PDN connections
314
+
* Retrieving PDN connection information
315
+
316
+
To enable PDN functionality, set the :kconfig:option:`CONFIG_LTE_LC_PDN_MODULE` Kconfig option to ``y``.
317
+
318
+
AT commands used
319
+
----------------
320
+
321
+
The PDN functionality uses several AT commands, and it relies on the following two types of AT notifications to work:
322
+
323
+
* Packet domain events notifications (``+CGEV``) - Subscribed by using the ``AT+CGEREP=1`` command.
324
+
See the `AT+CGEREP set command`_ section in the nRF9160 AT Commands Reference Guide or the `nRF91x1 AT+CGEREP set command`_ section in the nRF91x1 AT Commands Reference Guide, depending on the SiP you are using.
325
+
* Notifications for unsolicited reporting of error codes sent by the network (``+CNEC``) - Subscribed by using the ``AT+CNEC=16`` command.
326
+
See the `AT+CNEC set command`_ section in the nRF9160 AT Commands Reference Guide or the `nRF91x1 AT+CNEC set command`_ section in the nRF91x1 AT Commands Reference Guide, depending on the SiP you are using.
327
+
328
+
The LTE link control library automatically subscribes to the necessary AT notifications.
329
+
This includes automatically resubscribing to the notifications upon functional mode changes.
330
+
331
+
.. note::
332
+
The subscription to AT notifications is lost upon changing the functional mode of the modem to ``+CFUN=0``.
333
+
If the application subscribes to these notifications manually, it must also take care of resubscription.
334
+
335
+
Following are the AT commands that are used by the PDN functionality:
336
+
337
+
* ``AT%XNEWCID`` - To create a PDP context
338
+
* ``AT+CGDCONT`` - To configure or destroy a PDP context
339
+
* ``AT+CGACT`` - To activate or deactivate a PDN connection
340
+
* ``AT%XGETPDNID`` - To retrieve the PDN ID for a given PDP context
341
+
* ``AT+CGAUTH`` - To set the PDN connection authentication parameters
342
+
343
+
For more information about these commands, see `Packet Domain AT commands`_ in the nRF9160 AT Commands Reference Guide or the `nRF91x1 packet Domain AT commands`_ section in the nRF91x1 AT Commands Reference Guide, depending on the SiP you are using.
344
+
345
+
Creating and managing PDN connections
346
+
--------------------------------------
347
+
348
+
The application can create PDP contexts by using the :c:func:`lte_lc_pdn_ctx_create` function.
349
+
PDN events are sent to all registered LTE link control event handlers.
350
+
The application can use the :c:func:`lte_lc_register_handler` function to register an event handler for events pertaining to all PDP contexts, including the default PDP context.
351
+
352
+
A PDN connection is identified by an ID as reported by ``AT%XGETPDNID``, and it is distinct from the PDP context ID (CID).
353
+
The modem creates a PDN connection for a PDP context as necessary.
354
+
Multiple PDP contexts might share the same PDN connection if they are configured similarly.
355
+
356
+
The application can use the following functions to manage PDP contexts and PDN connections:
357
+
358
+
* :c:func:`lte_lc_pdn_ctx_create` - Creates a PDP context.
359
+
* :c:func:`lte_lc_register_handler` - Registers an event handler for events pertaining to all PDP contexts, including the default PDP context.
360
+
* :c:func:`lte_lc_pdn_ctx_configure` - Configures a PDP context with address family, access point name, and optional additional configuration options.
361
+
* :c:func:`lte_lc_pdn_ctx_auth_set` - Sets authentication parameters for a PDP context.
362
+
* :c:func:`lte_lc_pdn_activate` - Activates a PDN connection for a PDP context.
363
+
* :c:func:`lte_lc_pdn_deactivate` - Deactivates a PDN connection.
364
+
* :c:func:`lte_lc_pdn_ctx_destroy` - Destroys a PDP context.
365
+
The PDN connection must be inactive when the PDP context is destroyed.
366
+
* :c:func:`lte_lc_pdn_id_get` - Retrieves the PDN ID for a given PDP context.
367
+
The PDN ID can be used to route traffic through a specific PDN connection.
368
+
* :c:func:`lte_lc_pdn_dynamic_info_get` - Retrieves dynamic parameters such as DNS addresses and MTU sizes for a given PDN connection.
369
+
* :c:func:`lte_lc_pdn_ctx_default_apn_get` - Retrieves the default Access Point Name (APN) of the default PDP context (CID 0).
370
+
371
+
PDN events
372
+
----------
373
+
374
+
The following PDN events are sent to registered LTE link control event handlers:
The associated payload for PDN events is the :c:member:`lte_lc_evt.pdn` member of type :c:struct:`lte_lc_pdn_evt`.
387
+
This structure contains the PDP context ID (CID) and, for :c:enumerator:`LTE_LC_EVT_PDN_ESM_ERROR` events, the ESM error code.
388
+
389
+
PDN configuration
390
+
-----------------
391
+
392
+
The LTE link control library can override the default PDP context configuration automatically after the :ref:`nrfxlib:nrf_modem` is initialized, if the :kconfig:option:`CONFIG_LTE_LC_PDN_DEFAULTS_OVERRIDE` Kconfig option is set.
393
+
The default PDP context configuration consists of the following parameters, each controlled with a Kconfig setting:
394
+
395
+
* Access point name - :kconfig:option:`CONFIG_LTE_LC_PDN_DEFAULT_APN`
396
+
* Address family - :kconfig:option:`CONFIG_LTE_LC_PDN_DEFAULT_FAM_IPV4`, :kconfig:option:`CONFIG_LTE_LC_PDN_DEFAULT_FAM_IPV6`, :kconfig:option:`CONFIG_LTE_LC_PDN_DEFAULT_FAM_IPV4V6`, or :kconfig:option:`CONFIG_LTE_LC_PDN_DEFAULT_FAM_NONIP`
397
+
* Authentication method - :kconfig:option:`CONFIG_LTE_LC_PDN_DEFAULT_AUTH_NONE`, :kconfig:option:`CONFIG_LTE_LC_PDN_DEFAULT_AUTH_PAP`, or :kconfig:option:`CONFIG_LTE_LC_PDN_DEFAULT_AUTH_CHAP`
398
+
* Authentication credentials - :kconfig:option:`CONFIG_LTE_LC_PDN_DEFAULT_USERNAME` and :kconfig:option:`CONFIG_LTE_LC_PDN_DEFAULT_PASSWORD`
399
+
400
+
.. note::
401
+
The default PDP context configuration must be overridden before the device is registered with the network.
402
+
403
+
Additional configuration options:
404
+
405
+
* :kconfig:option:`CONFIG_LTE_LC_PDN_LEGACY_PCO` - Use legacy PCO mode instead of ePCO during PDN connection establishment
406
+
* :kconfig:option:`CONFIG_LTE_LC_PDN_ESM_TIMEOUT` - Timeout for waiting for an ESM notification when activating a PDN
407
+
* :kconfig:option:`CONFIG_LTE_LC_PDN_ESM_STRERROR` - Compile a table with textual descriptions of ESM error reasons
408
+
409
+
PDN usage example
410
+
-----------------
411
+
412
+
The following code snippet demonstrates how to use the PDN functionality:
LOG_INF("PDN connection activated with PDN ID: %d", pdn_id);
490
+
491
+
/* Continue execution... */
492
+
}
493
+
494
+
.. note::
495
+
You have to register the event handler for LTE events before the device is registered to the network (``CFUN=1``) to receive the first activation event.
Copy file name to clipboardExpand all lines: doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -907,6 +907,8 @@ Modem libraries
907
907
* Description of new features supported by mfw_nrf91x1 and mfw_nrf9151-ntn in receive only functional mode.
908
908
* Sending of the ``LTE_LC_EVT_PSM_UPDATE`` event with ``tau`` and ``active_time`` set to ``-1`` when registration status is ``LTE_LC_NW_REG_NOT_REGISTERED``.
909
909
* New registration statuses and functional modes for the ``mfw_nrf9151-ntn`` modem firmware.
910
+
* Support for PDP context and PDN connection management.
911
+
The functionality is available when the :kconfig:option:`CONFIG_LTE_LC_PDN_MODULE` Kconfig option is enabled.
0 commit comments