nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches
lte_lc.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <zephyr/kernel.h>
#include <zephyr/net/net_ip.h>

Go to the source code of this file.

Data Structures

struct  lte_lc_psm_cfg
 Power Saving Mode (PSM) configuration. More...
 
struct  lte_lc_edrx_cfg
 eDRX configuration. More...
 
struct  lte_lc_ncell
 Neighbor cell information. More...
 
struct  lte_lc_cell
 Cell information. More...
 
struct  lte_lc_cells_info
 Results of neighbor cell measurements. More...
 
struct  lte_lc_modem_sleep
 Modem sleep information. More...
 
struct  lte_lc_invalid_band_conf
 Detected conflicting band lock or operator restrictions. More...
 
struct  lte_lc_modem_evt
 Modem domain event. More...
 
struct  lte_lc_rai_cfg
 RAI configuration. More...
 
struct  lte_lc_conn_eval_params
 Connection evaluation parameters. More...
 
struct  lte_lc_ncellmeas_params
 Neighbor cell measurement initiation parameters. More...
 
struct  lte_lc_env_eval_plmn
 PLMN to evaluate. More...
 
struct  lte_lc_env_eval_params
 Environment evaluation parameters. More...
 
struct  lte_lc_periodic_search_range_cfg
 Configuration for periodic search of type LTE_LC_PERIODIC_SEARCH_PATTERN_RANGE. More...
 
struct  lte_lc_periodic_search_table_cfg
 Configuration for periodic search of type LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE. More...
 
struct  lte_lc_periodic_search_pattern
 Periodic search pattern. More...
 
struct  lte_lc_periodic_search_cfg
 Periodic search configuration. More...
 
struct  lte_lc_env_eval_result
 Environment evaluation results. More...
 
struct  lte_lc_cfun_cb
 Callback for modem functional mode changes. More...
 
struct  lte_lc_pdn_evt
 PDN event payload. More...
 
struct  lte_lc_cellular_profile_evt
 
struct  lte_lc_evt
 LTE event. More...
 
struct  lte_lc_pdn_pdp_context_opts
 Additional Packet Data Protocol (PDP) context configuration options. More...
 
struct  lte_lc_pdn_dynamic_info
 PDN connection dynamic information structure. More...
 
struct  lte_lc_cellular_profile
 Cellular profile. More...
 

Macros

#define LTE_LC_CELL_TIMING_ADVANCE_MAX   20512
 Maximum timing advance value.
 
#define LTE_LC_CELL_TIMING_ADVANCE_INVALID   65535
 Invalid timing advance value.
 
#define LTE_LC_CELL_EARFCN_MAX   262143
 Maximum EARFCN value.
 
#define LTE_LC_CELL_RSRP_INVALID   255
 Unknown or undetectable RSRP value.
 
#define LTE_LC_CELL_RSRQ_INVALID   255
 Unknown or undetectable RSRQ value.
 
#define LTE_LC_CELL_EUTRAN_ID_INVALID   UINT32_MAX
 Cell ID value not valid.
 
#define LTE_LC_CELL_EUTRAN_ID_MAX   268435455
 Maximum cell ID value.
 
#define LTE_LC_CELL_TAC_INVALID   UINT32_MAX
 Tracking Area Code value not valid.
 
#define LTE_LC_CELL_TIME_DIFF_INVALID   0
 Time difference not valid.
 

Typedefs

typedef void(* lte_lc_evt_handler_t) (const struct lte_lc_evt *const evt)
 Handler for LTE events.
 

Enumerations

enum  lte_lc_nw_reg_status {
  LTE_LC_NW_REG_NOT_REGISTERED = 0 , LTE_LC_NW_REG_REGISTERED_HOME = 1 , LTE_LC_NW_REG_SEARCHING = 2 , LTE_LC_NW_REG_REGISTRATION_DENIED = 3 ,
  LTE_LC_NW_REG_UNKNOWN = 4 , LTE_LC_NW_REG_REGISTERED_ROAMING = 5 , LTE_LC_NW_REG_RX_ONLY_NOT_REGISTERED = 50 , LTE_LC_NW_REG_RX_ONLY_REGISTERED_HOME = 51 ,
  LTE_LC_NW_REG_RX_ONLY_SEARCHING = 52 , LTE_LC_NW_REG_RX_ONLY_REGISTRATION_DENIED = 53 , LTE_LC_NW_REG_RX_ONLY_UNKNOWN = 54 , LTE_LC_NW_REG_RX_ONLY_REGISTERED_ROAMING = 55 ,
  LTE_LC_NW_REG_UICC_FAIL = 90 , LTE_LC_NW_REG_NO_SUITABLE_CELL = 91
}
 Network registration status. More...
 
enum  lte_lc_system_mode {
  LTE_LC_SYSTEM_MODE_LTEM = 1 , LTE_LC_SYSTEM_MODE_NBIOT , LTE_LC_SYSTEM_MODE_GPS , LTE_LC_SYSTEM_MODE_LTEM_GPS ,
  LTE_LC_SYSTEM_MODE_NBIOT_GPS , LTE_LC_SYSTEM_MODE_LTEM_NBIOT , LTE_LC_SYSTEM_MODE_LTEM_NBIOT_GPS , LTE_LC_SYSTEM_MODE_NTN_NBIOT
}
 System mode. More...
 
enum  lte_lc_lte_mode { LTE_LC_LTE_MODE_NONE = 0 , LTE_LC_LTE_MODE_LTEM = 7 , LTE_LC_LTE_MODE_NBIOT = 9 , LTE_LC_LTE_MODE_NTN_NBIOT = 14 }
 LTE mode. More...
 
enum  lte_lc_system_mode_preference {
  LTE_LC_SYSTEM_MODE_PREFER_AUTO = 0 , LTE_LC_SYSTEM_MODE_PREFER_LTEM , LTE_LC_SYSTEM_MODE_PREFER_NBIOT , LTE_LC_SYSTEM_MODE_PREFER_LTEM_PLMN_PRIO ,
  LTE_LC_SYSTEM_MODE_PREFER_NBIOT_PLMN_PRIO
}
 LTE mode preference. More...
 
enum  lte_lc_func_mode {
  LTE_LC_FUNC_MODE_POWER_OFF = 0 , LTE_LC_FUNC_MODE_NORMAL = 1 , LTE_LC_FUNC_MODE_RX_ONLY = 2 , LTE_LC_FUNC_MODE_OFFLINE = 4 ,
  LTE_LC_FUNC_MODE_DEACTIVATE_LTE = 20 , LTE_LC_FUNC_MODE_ACTIVATE_LTE = 21 , LTE_LC_FUNC_MODE_DEACTIVATE_GNSS = 30 , LTE_LC_FUNC_MODE_ACTIVATE_GNSS = 31 ,
  LTE_LC_FUNC_MODE_DEACTIVATE_UICC = 40 , LTE_LC_FUNC_MODE_ACTIVATE_UICC = 41 , LTE_LC_FUNC_MODE_OFFLINE_UICC_ON = 44 , LTE_LC_FUNC_MODE_OFFLINE_KEEP_REG = 45 ,
  LTE_LC_FUNC_MODE_OFFLINE_KEEP_REG_UICC_ON = 46
}
 Functional mode, used to control RF functionality in the modem. More...
 
enum  lte_lc_evt_type {
  LTE_LC_EVT_NW_REG_STATUS = 0 , LTE_LC_EVT_PSM_UPDATE = 1 , LTE_LC_EVT_EDRX_UPDATE = 2 , LTE_LC_EVT_RRC_UPDATE = 3 ,
  LTE_LC_EVT_CELL_UPDATE = 4 , LTE_LC_EVT_LTE_MODE_UPDATE = 5 , LTE_LC_EVT_TAU_PRE_WARNING = 6 , LTE_LC_EVT_NEIGHBOR_CELL_MEAS = 7 ,
  LTE_LC_EVT_MODEM_SLEEP_EXIT_PRE_WARNING = 8 , LTE_LC_EVT_MODEM_SLEEP_EXIT = 9 , LTE_LC_EVT_MODEM_SLEEP_ENTER = 10 , LTE_LC_EVT_MODEM_EVENT = 11 ,
  LTE_LC_EVT_RAI_UPDATE = 12 , LTE_LC_EVT_ENV_EVAL_RESULT = 13 , LTE_LC_EVT_PDN = 14 , LTE_LC_EVT_CELLULAR_PROFILE_ACTIVE = 15
}
 Event type. More...
 
enum  lte_lc_rrc_mode { LTE_LC_RRC_MODE_IDLE = 0 , LTE_LC_RRC_MODE_CONNECTED = 1 }
 RRC connection state. More...
 
enum  lte_lc_modem_sleep_type {
  LTE_LC_MODEM_SLEEP_PSM = 1 , LTE_LC_MODEM_SLEEP_RF_INACTIVITY = 2 , LTE_LC_MODEM_SLEEP_LIMITED_SERVICE = 3 , LTE_LC_MODEM_SLEEP_FLIGHT_MODE = 4 ,
  LTE_LC_MODEM_SLEEP_PROPRIETARY_PSM = 7
}
 Modem sleep type. More...
 
enum  lte_lc_energy_estimate {
  LTE_LC_ENERGY_CONSUMPTION_EXCESSIVE = 5 , LTE_LC_ENERGY_CONSUMPTION_INCREASED = 6 , LTE_LC_ENERGY_CONSUMPTION_NORMAL = 7 , LTE_LC_ENERGY_CONSUMPTION_REDUCED = 8 ,
  LTE_LC_ENERGY_CONSUMPTION_EFFICIENT = 9
}
 Energy consumption estimate. More...
 
enum  lte_lc_tau_triggered { LTE_LC_CELL_IN_TAI_LIST = 0 , LTE_LC_CELL_NOT_IN_TAI_LIST = 1 , LTE_LC_CELL_UNKNOWN = UINT8_MAX }
 Cell in Tracking Area Identifier list. More...
 
enum  lte_lc_ce_level {
  LTE_LC_CE_LEVEL_0 = 0 , LTE_LC_CE_LEVEL_1 = 1 , LTE_LC_CE_LEVEL_2 = 2 , LTE_LC_CE_LEVEL_3 = 3 ,
  LTE_LC_CE_LEVEL_UNKNOWN = UINT8_MAX
}
 CE level. More...
 
enum  lte_lc_modem_evt_type {
  LTE_LC_MODEM_EVT_LIGHT_SEARCH_DONE , LTE_LC_MODEM_EVT_SEARCH_DONE , LTE_LC_MODEM_EVT_RESET_LOOP , LTE_LC_MODEM_EVT_BATTERY_LOW ,
  LTE_LC_MODEM_EVT_OVERHEATED , LTE_LC_MODEM_EVT_NO_IMEI , LTE_LC_MODEM_EVT_CE_LEVEL , LTE_LC_MODEM_EVT_RF_CAL_NOT_DONE ,
  LTE_LC_MODEM_EVT_INVALID_BAND_CONF , LTE_LC_MODEM_EVT_DETECTED_COUNTRY
}
 Modem domain event type. More...
 
enum  lte_lc_band_conf_status { LTE_LC_BAND_CONF_STATUS_OK = 0 , LTE_LC_BAND_CONF_STATUS_INVALID = 1 , LTE_LC_BAND_CONF_STATUS_SYSTEM_NOT_SUPPORTED = 2 }
 Band configuration status. More...
 
enum  lte_lc_neighbor_search_type {
  LTE_LC_NEIGHBOR_SEARCH_TYPE_DEFAULT = 1 , LTE_LC_NEIGHBOR_SEARCH_TYPE_EXTENDED_LIGHT = 2 , LTE_LC_NEIGHBOR_SEARCH_TYPE_EXTENDED_COMPLETE = 3 , LTE_LC_NEIGHBOR_SEARCH_TYPE_GCI_DEFAULT = 4 ,
  LTE_LC_NEIGHBOR_SEARCH_TYPE_GCI_EXTENDED_LIGHT = 5 , LTE_LC_NEIGHBOR_SEARCH_TYPE_GCI_EXTENDED_COMPLETE = 6
}
 Specifies which type of search the modem should perform when a neighbor cell measurement is started. More...
 
enum  lte_lc_env_eval_type { LTE_LC_ENV_EVAL_TYPE_DYNAMIC = 0 , LTE_LC_ENV_EVAL_TYPE_LIGHT = 1 , LTE_LC_ENV_EVAL_TYPE_FULL = 2 }
 Environment evaluation type. More...
 
enum  lte_lc_periodic_search_pattern_type { LTE_LC_PERIODIC_SEARCH_PATTERN_RANGE = 0 , LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE = 1 }
 Search pattern type. More...
 
enum  lte_lc_pdn_evt_type {
  LTE_LC_EVT_PDN_ACTIVATED , LTE_LC_EVT_PDN_DEACTIVATED , LTE_LC_EVT_PDN_IPV6_UP , LTE_LC_EVT_PDN_IPV6_DOWN ,
  LTE_LC_EVT_PDN_SUSPENDED , LTE_LC_EVT_PDN_RESUMED , LTE_LC_EVT_PDN_NETWORK_DETACH , LTE_LC_EVT_PDN_APN_RATE_CONTROL_ON ,
  LTE_LC_EVT_PDN_APN_RATE_CONTROL_OFF , LTE_LC_EVT_PDN_CTX_DESTROYED , LTE_LC_EVT_PDN_ESM_ERROR
}
 
enum  lte_lc_pdn_family { LTE_LC_PDN_FAM_IPV4 = 0 , LTE_LC_PDN_FAM_IPV6 = 1 , LTE_LC_PDN_FAM_IPV4V6 = 2 , LTE_LC_PDN_FAM_NONIP = 3 }
 PDN address family. More...
 
enum  lte_lc_pdn_auth { LTE_LC_PDN_AUTH_NONE = 0 , LTE_LC_PDN_AUTH_PAP = 1 , LTE_LC_PDN_AUTH_CHAP = 2 }
 Authentication method. More...
 
enum  lte_lc_uicc { LTE_LC_UICC_PHYSICAL = 0 , LTE_LC_UICC_SOFTSIM = 2 }
 UICC configuration type, used for cellular profile selection. More...
 
enum  lte_lc_act { LTE_LC_ACT_LTEM = BIT(0) , LTE_LC_ACT_NBIOT = BIT(1) , LTE_LC_ACT_NTN = BIT(2) }
 LTE access technology (AcT) bitmap. More...
 

Functions

void lte_lc_register_handler (lte_lc_evt_handler_t handler)
 Register handler for LTE events.
 
int lte_lc_deregister_handler (lte_lc_evt_handler_t handler)
 De-register handler for LTE events.
 
int lte_lc_connect (void)
 Connect to LTE network.
 
int lte_lc_connect_async (lte_lc_evt_handler_t handler)
 Connect to LTE network.
 
int lte_lc_offline (void)
 Set the modem to offline mode.
 
int lte_lc_power_off (void)
 Set the modem to power off mode.
 
int lte_lc_normal (void)
 Set the modem to normal mode.
 
int lte_lc_psm_param_set (const char *rptau, const char *rat)
 Set modem PSM parameters.
 
int lte_lc_psm_param_set_seconds (int rptau, int rat)
 Set modem PSM parameters.
 
int lte_lc_psm_req (bool enable)
 Request modem to enable or disable Power Saving Mode (PSM).
 
int lte_lc_psm_get (int *tau, int *active_time)
 Get the current PSM (Power Saving Mode) configuration.
 
int lte_lc_proprietary_psm_req (bool enable)
 Request modem to enable or disable proprietary Power Saving Mode.
 
int lte_lc_ptw_set (enum lte_lc_lte_mode mode, const char *ptw)
 Set the Paging Time Window (PTW) value to be used with eDRX.
 
int lte_lc_edrx_param_set (enum lte_lc_lte_mode mode, const char *edrx)
 Set the requested eDRX value.
 
int lte_lc_edrx_req (bool enable)
 Request modem to enable or disable use of eDRX.
 
int lte_lc_edrx_get (struct lte_lc_edrx_cfg *edrx_cfg)
 Get the eDRX parameters currently provided by the network.
 
int lte_lc_nw_reg_status_get (enum lte_lc_nw_reg_status *status)
 Get the current network registration status.
 
int lte_lc_system_mode_set (enum lte_lc_system_mode mode, enum lte_lc_system_mode_preference preference)
 Set the modem's system mode and LTE preference.
 
int lte_lc_system_mode_get (enum lte_lc_system_mode *mode, enum lte_lc_system_mode_preference *preference)
 Get the modem's system mode and LTE preference.
 
int lte_lc_func_mode_set (enum lte_lc_func_mode mode)
 Set the modem's functional mode.
 
int lte_lc_func_mode_get (enum lte_lc_func_mode *mode)
 Get the modem's functional mode.
 
int lte_lc_lte_mode_get (enum lte_lc_lte_mode *mode)
 Get the currently active LTE mode.
 
int lte_lc_neighbor_cell_measurement (struct lte_lc_ncellmeas_params *params)
 Initiate a neighbor cell measurement.
 
int lte_lc_neighbor_cell_measurement_cancel (void)
 Cancel an ongoing neighbor cell measurement.
 
int lte_lc_conn_eval_params_get (struct lte_lc_conn_eval_params *params)
 Get connection evaluation parameters.
 
int lte_lc_env_eval (struct lte_lc_env_eval_params *params)
 Start environment evaluation.
 
int lte_lc_env_eval_cancel (void)
 Cancel an ongoing environment evaluation.
 
int lte_lc_periodic_search_set (const struct lte_lc_periodic_search_cfg *const cfg)
 Configure periodic searches.
 
int lte_lc_periodic_search_get (struct lte_lc_periodic_search_cfg *const cfg)
 Get the configured periodic search parameters.
 
int lte_lc_periodic_search_clear (void)
 Clear the configured periodic search parameters.
 
int lte_lc_periodic_search_request (void)
 Request an extra search.
 
int lte_lc_pdn_ctx_create (uint8_t *cid)
 Create a PDP context.
 
int lte_lc_pdn_ctx_configure (uint8_t cid, const char *apn, enum lte_lc_pdn_family family, struct lte_lc_pdn_pdp_context_opts *opts)
 Configure a PDP context.
 
int lte_lc_pdn_ctx_auth_set (uint8_t cid, enum lte_lc_pdn_auth method, const char *user, const char *password)
 Set PDP context authentication parameters.
 
int lte_lc_pdn_ctx_destroy (uint8_t cid)
 Destroy a PDP context.
 
int lte_lc_pdn_activate (uint8_t cid, int *esm, enum lte_lc_pdn_family *family)
 Activate a PDN connection.
 
int lte_lc_pdn_deactivate (uint8_t cid)
 Deactivate a PDN connection.
 
int lte_lc_pdn_id_get (uint8_t cid)
 Retrieve the PDN ID for a given PDP context.
 
int lte_lc_pdn_dynamic_info_get (uint8_t cid, struct lte_lc_pdn_dynamic_info *info)
 Retrieve dynamic parameters of a given PDN connection.
 
int lte_lc_pdn_default_ctx_events_enable (void)
 Enable events for default PDP context, CID 0.
 
int lte_lc_pdn_default_ctx_events_disable (void)
 Disable events for default PDP context, CID 0.
 
int lte_lc_pdn_default_ctx_apn_get (char *buf, size_t len)
 Retrieve the default Access Point Name (APN).
 
int lte_lc_cellular_profile_configure (struct lte_lc_cellular_profile *profile)
 Configure a cellular profile.
 
int lte_lc_cellular_profile_remove (uint8_t id)
 Remove a cellular profile.