@@ -483,13 +483,15 @@ enum lte_lc_evt_type {
483483 LTE_LC_EVT_PDN = 14 ,
484484#endif /* CONFIG_LTE_LC_PDN_MODULE */
485485
486+ #if defined(CONFIG_LTE_LC_CELLULAR_PROFILE_MODULE )
486487 /**
487488 * A cellular profile is activated for the current access technology.
488489 *
489- * The associated payload is the @c lte_lc_evt.cellular_profile_id member in the event,
490- * which is the cellular profile ID of the active cellular profile .
490+ * The associated payload is the @c lte_lc_evt.cellular_profile member of type
491+ * @ref lte_lc_cellular_profile_evt in the event .
491492 */
492493 LTE_LC_EVT_CELLULAR_PROFILE_ACTIVE = 15 ,
494+ #endif /* CONFIG_LTE_LC_CELLULAR_PROFILE_MODULE */
493495};
494496
495497/** RRC connection state. */
@@ -1537,6 +1539,11 @@ struct lte_lc_pdn_evt {
15371539 int8_t cellular_profile_id ;
15381540};
15391541
1542+ struct lte_lc_cellular_profile_evt {
1543+ /** Cellular profile ID. */
1544+ int8_t profile_id ;
1545+ };
1546+
15401547/** LTE event. */
15411548struct lte_lc_evt {
15421549 /** Event type. */
@@ -1602,6 +1609,11 @@ struct lte_lc_evt {
16021609 /** Payload for event @ref LTE_LC_EVT_PDN. */
16031610 struct lte_lc_pdn_evt pdn ;
16041611#endif /* CONFIG_LTE_LC_PDN_MODULE */
1612+
1613+ #if defined(CONFIG_LTE_LC_CELLULAR_PROFILE_MODULE )
1614+ /** Payload for event @ref LTE_LC_EVT_CELLULAR_PROFILE_ACTIVE. */
1615+ struct lte_lc_cellular_profile_evt cellular_profile ;
1616+ #endif /* CONFIG_LTE_LC_CELLULAR_PROFILE_MODULE */
16051617 };
16061618};
16071619
@@ -1678,23 +1690,51 @@ enum lte_lc_uicc {
16781690 /** Physical SIM or eSIM */
16791691 LTE_LC_UICC_PHYSICAL = 0 ,
16801692 /** SoftSIM */
1681- LTE_LC_UICC_SOFTSIM = 1 ,
1693+ LTE_LC_UICC_SOFTSIM = 2 ,
1694+ };
1695+
1696+ /**
1697+ * @brief LTE access technology (AcT) bitmap.
1698+ *
1699+ * This bitmap selects which access technologies are enabled for an operation.
1700+ * It maps directly to the AcT bitmask in AT commands such as `AT%CELLULARPRFL`
1701+ * and `AT%PALL`.
1702+ */
1703+ enum lte_lc_act {
1704+ /** LTE-M (Cat-M1). */
1705+ LTE_LC_ACT_LTEM = BIT (0 ),
1706+ /** NB-IoT. */
1707+ LTE_LC_ACT_NBIOT = BIT (1 ),
1708+ /** NTN NB-IoT. */
1709+ LTE_LC_ACT_NTN = BIT (2 ),
16821710};
16831711
16841712/**
16851713 * @brief Cellular profile.
16861714 *
1687- * Used to set the cellular profile for the PDN connection.
1715+ * Cellular profiles are used when there is a need for simultaneous terrestrial and
1716+ * non-terrestrial LTE registrations and PDN connections. There can be only one physical
1717+ * access at a time, but a second access is logically stored by the modem. Typically,
1718+ * this means that there are more than one USIM card or profile, so that certain USIM
1719+ * card or profile is used in certain access technology. A cellular profile combines
1720+ * the information that is needed for LTE registration and is identified by the
1721+ * cellular profile ID.
16881722 *
1689- * @note The profile ID 0 is associated with PDN contexts in the range 0-9, while profile ID 1
1690- * is associated with PDN contexts in the range 10-19. The default context for each profile
1723+ * @note The profile ID 0 is associated with PDP contexts in the range 0-9, while profile ID 1
1724+ * is associated with PDP contexts in the range 10-19. The default context for each profile
16911725 * is the first context in the range.
16921726 */
16931727struct lte_lc_cellular_profile {
16941728 /** Cellular profile ID. Valid values are 0 and 1. */
16951729 uint8_t id ;
1696- /** LTE mode for the profile (access technology) */
1697- enum lte_lc_lte_mode lte_mode ;
1730+
1731+ /**
1732+ * Access technology bitmap for the profile.
1733+ *
1734+ * This is a combination of @ref lte_lc_act values.
1735+ */
1736+ uint8_t act ;
1737+
16981738 /** UICC configuration */
16991739 enum lte_lc_uicc uicc ;
17001740};
@@ -2487,26 +2527,32 @@ const char *lte_lc_pdn_esm_strerror(int reason);
24872527 * The active cellular profile is reported in the @ref LTE_LC_EVT_CELLULAR_PROFILE_ACTIVE
24882528 * event if an event handler is registered.
24892529 *
2530+ * @note Requires `CONFIG_LTE_LC_CELLULAR_PROFILE_MODULE` to be enabled.
2531+ *
2532+ * @note A cellular profile can only be configured when the modem is in functional mode
2533+ * @ref LTE_LC_FUNC_MODE_POWER_OFF or @ref LTE_LC_FUNC_MODE_OFFLINE.
2534+ *
24902535 * @param[in] profile The cellular profile to set.
24912536 *
24922537 * @retval 0 on success, otherwise negative error code.
24932538 */
24942539int lte_lc_cellular_profile_configure (struct lte_lc_cellular_profile * profile );
24952540
2496- #if defined(CONFIG_LTE_LC_PDN_ESM_STRERROR )
2497-
24982541/**
2499- * Retrieve a statically allocated textual description for a given ESM error reason .
2542+ * Remove a cellular profile .
25002543 *
2501- * @param[in] reason ESM error reason .
2544+ * This clears the configuration for the given cellular profile ID .
25022545 *
2503- * @return ESM error reason description.
2504- * If no textual description for the given error is found,
2505- * a placeholder string is returned instead.
2546+ * @note Requires `CONFIG_LTE_LC_CELLULAR_PROFILE_MODULE` to be enabled.
2547+ *
2548+ * @note A cellular profile can only be removed when the modem is in functional mode
2549+ * @ref LTE_LC_FUNC_MODE_POWER_OFF or @ref LTE_LC_FUNC_MODE_OFFLINE.
2550+ *
2551+ * @param[in] id Cellular profile ID to remove.
2552+ *
2553+ * @retval 0 on success, otherwise negative error code.
25062554 */
2507- const char * lte_lc_pdn_esm_strerror (int reason );
2508-
2509- #endif /* CONFIG_LTE_LC_PDN_ESM_STRERROR */
2555+ int lte_lc_cellular_profile_remove (uint8_t id );
25102556
25112557/** @} */
25122558
0 commit comments