nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
lte_lc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef LTE_LC_H__
8#define LTE_LC_H__
9
10#include <stdbool.h>
11#include <stdint.h>
12#include <zephyr/kernel.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
36
39
45
48
51
54
57};
58
63
66
69
72
75
78
81};
82
92
95
98};
99
112
120
128
136
145
160
167
177
184
187
190
193
196
199
202
205};
206
216
224
232
240
249
262
274
282
294
302
311
319
329};
330
335
338};
339
343 int tau;
344
347};
348
357
359 float edrx;
360
362 float ptw;
363};
364
366#define LTE_LC_CELL_TIMING_ADVANCE_MAX 20512
368#define LTE_LC_CELL_TIMING_ADVANCE_INVALID 65535
370#define LTE_LC_CELL_EARFCN_MAX 262143
372#define LTE_LC_CELL_RSRP_INVALID 255
374#define LTE_LC_CELL_RSRQ_INVALID 255
376#define LTE_LC_CELL_EUTRAN_ID_INVALID UINT32_MAX
378#define LTE_LC_CELL_EUTRAN_ID_MAX 268435455
380#define LTE_LC_CELL_TAC_INVALID UINT32_MAX
382#define LTE_LC_CELL_TIME_DIFF_INVALID 0
383
387 uint32_t earfcn;
388
395
397 uint16_t phys_cell_id;
398
404 int16_t rsrp;
405
411 int16_t rsrq;
412};
413
417 int mcc;
418
420 int mnc;
421
423 uint32_t id;
424
426 uint32_t tac;
427
429 uint32_t earfcn;
430
442
455
462
464 uint16_t phys_cell_id;
465
484 int16_t rsrp;
485
508 int16_t rsrq;
509};
510
511
519
525
528
535
538};
539
544
547
550
553
560};
561
566
570 int64_t time;
571};
572
582
590
597
604
611};
612
621
628
630 LTE_LC_CELL_UNKNOWN = UINT8_MAX
632
637
640
643
646
649};
650
655
658
665};
666
681
691
702
705
708
711
718
725
732
739};
740
745
748};
749
753 uint32_t cell_id;
755 int mcc;
757 int mnc;
759 bool as_rai;
761 bool cp_rai;
762};
763
773
779
785
800
803
805 int16_t dl_pathloss;
806
825 int16_t rsrp;
826
849 int16_t rsrq;
850
862 int16_t tx_rep;
863
875 int16_t rx_rep;
876
878 int16_t phy_cid;
879
887 int16_t band;
888
901 int16_t snr;
902
914 int16_t tx_power;
915
917 int mcc;
918
920 int mnc;
921
923 uint32_t cell_id;
924};
925
943
954
963
970
980
989};
990
995
1004 uint8_t gci_count;
1005};
1006
1007
1012
1015};
1016
1025
1031 uint16_t final_sleep;
1032
1048
1059};
1060
1076
1083
1092
1101
1110};
1111
1120
1121 union {
1124
1127 };
1128};
1129
1138 bool loop;
1139
1150
1161
1164
1167};
1168
1171 void (*callback)(enum lte_lc_func_mode, void *ctx);
1172 void *context;
1173};
1174
1182#define LTE_LC_ON_CFUN(name, _callback, _context) \
1183 static void _callback(enum lte_lc_func_mode, void *ctx); \
1184 STRUCT_SECTION_ITERABLE(lte_lc_cfun_cb, lte_lc_cfun_cb_##name) = { \
1185 .callback = _callback, \
1186 .context = _context, \
1187 };
1188
1193
1194 union {
1197
1200
1203
1206
1209
1212
1218
1221
1227 uint64_t time;
1228
1231
1234 };
1235};
1236
1242typedef void(*lte_lc_evt_handler_t)(const struct lte_lc_evt *const evt);
1243
1250
1261
1276
1292
1300
1308
1316
1369int lte_lc_psm_param_set(const char *rptau, const char *rat);
1370
1413int lte_lc_psm_param_set_seconds(int rptau, int rat);
1414
1434int lte_lc_psm_req(bool enable);
1435
1449int lte_lc_psm_get(int *tau, int *active_time);
1450
1476
1495int lte_lc_ptw_set(enum lte_lc_lte_mode mode, const char *ptw);
1496
1512int lte_lc_edrx_param_set(enum lte_lc_lte_mode mode, const char *edrx);
1513
1535int lte_lc_edrx_req(bool enable);
1536
1548
1559
1571 enum lte_lc_system_mode_preference preference);
1572
1584 enum lte_lc_system_mode_preference *preference);
1585
1596
1607
1619
1640
1648
1675
1688
1696
1713
1727
1736
1747
1760
1772
1786
1789#ifdef __cplusplus
1790}
1791#endif
1792
1793#endif /* LTE_LC_H__ */
static const struct event_proxy_config cfg
Definition: event_proxy_def.h:28
int lte_lc_connect_async(lte_lc_evt_handler_t handler)
int lte_lc_psm_param_set_seconds(int rptau, int rat)
int lte_lc_periodic_search_set(const struct lte_lc_periodic_search_cfg *const cfg)
int lte_lc_periodic_search_clear(void)
lte_lc_ce_level
Definition: lte_lc.h:634
@ LTE_LC_CE_LEVEL_2
Definition: lte_lc.h:642
@ LTE_LC_CE_LEVEL_0
Definition: lte_lc.h:636
@ LTE_LC_CE_LEVEL_UNKNOWN
Definition: lte_lc.h:648
@ LTE_LC_CE_LEVEL_1
Definition: lte_lc.h:639
@ LTE_LC_CE_LEVEL_3
Definition: lte_lc.h:645
int lte_lc_ptw_set(enum lte_lc_lte_mode mode, const char *ptw)
lte_lc_modem_sleep_type
Definition: lte_lc.h:541
@ LTE_LC_MODEM_SLEEP_PROPRIETARY_PSM
Definition: lte_lc.h:559
@ LTE_LC_MODEM_SLEEP_RF_INACTIVITY
Definition: lte_lc.h:546
@ LTE_LC_MODEM_SLEEP_LIMITED_SERVICE
Definition: lte_lc.h:549
@ LTE_LC_MODEM_SLEEP_FLIGHT_MODE
Definition: lte_lc.h:552
@ LTE_LC_MODEM_SLEEP_PSM
Definition: lte_lc.h:543
int lte_lc_system_mode_set(enum lte_lc_system_mode mode, enum lte_lc_system_mode_preference preference)
int lte_lc_system_mode_get(enum lte_lc_system_mode *mode, enum lte_lc_system_mode_preference *preference)
lte_lc_factory_reset_type
Definition: lte_lc.h:742
@ LTE_LC_FACTORY_RESET_ALL
Definition: lte_lc.h:744
@ LTE_LC_FACTORY_RESET_USER
Definition: lte_lc.h:747
int lte_lc_psm_param_set(const char *rptau, const char *rat)
int lte_lc_edrx_get(struct lte_lc_edrx_cfg *edrx_cfg)
int lte_lc_psm_req(bool enable)
lte_lc_func_mode
Definition: lte_lc.h:153
@ LTE_LC_FUNC_MODE_RX_ONLY
Definition: lte_lc.h:176
@ LTE_LC_FUNC_MODE_OFFLINE_UICC_ON
Definition: lte_lc.h:204
@ LTE_LC_FUNC_MODE_OFFLINE
Definition: lte_lc.h:183
@ LTE_LC_FUNC_MODE_DEACTIVATE_UICC
Definition: lte_lc.h:198
@ LTE_LC_FUNC_MODE_ACTIVATE_GNSS
Definition: lte_lc.h:195
@ LTE_LC_FUNC_MODE_POWER_OFF
Definition: lte_lc.h:159
@ LTE_LC_FUNC_MODE_DEACTIVATE_LTE
Definition: lte_lc.h:186
@ LTE_LC_FUNC_MODE_NORMAL
Definition: lte_lc.h:166
@ LTE_LC_FUNC_MODE_ACTIVATE_UICC
Definition: lte_lc.h:201
@ LTE_LC_FUNC_MODE_DEACTIVATE_GNSS
Definition: lte_lc.h:192
@ LTE_LC_FUNC_MODE_ACTIVATE_LTE
Definition: lte_lc.h:189
int lte_lc_psm_get(int *tau, int *active_time)
lte_lc_tau_triggered
Definition: lte_lc.h:614
@ LTE_LC_CELL_IN_TAI_LIST
Definition: lte_lc.h:620
@ LTE_LC_CELL_NOT_IN_TAI_LIST
Definition: lte_lc.h:627
@ LTE_LC_CELL_UNKNOWN
Definition: lte_lc.h:630
lte_lc_evt_type
Definition: lte_lc.h:208
@ LTE_LC_EVT_NEIGHBOR_CELL_MEAS
Definition: lte_lc.h:281
@ LTE_LC_EVT_TAU_PRE_WARNING
Definition: lte_lc.h:273
@ LTE_LC_EVT_MODEM_EVENT
Definition: lte_lc.h:318
@ LTE_LC_EVT_PSM_UPDATE
Definition: lte_lc.h:223
@ LTE_LC_EVT_EDRX_UPDATE
Definition: lte_lc.h:231
@ LTE_LC_EVT_MODEM_SLEEP_EXIT_PRE_WARNING
Definition: lte_lc.h:293
@ LTE_LC_EVT_RAI_UPDATE
Definition: lte_lc.h:328
@ LTE_LC_EVT_MODEM_SLEEP_ENTER
Definition: lte_lc.h:310
@ LTE_LC_EVT_RRC_UPDATE
Definition: lte_lc.h:239
@ LTE_LC_EVT_CELL_UPDATE
Definition: lte_lc.h:248
@ LTE_LC_EVT_LTE_MODE_UPDATE
Definition: lte_lc.h:261
@ LTE_LC_EVT_NW_REG_STATUS
Definition: lte_lc.h:215
@ LTE_LC_EVT_MODEM_SLEEP_EXIT
Definition: lte_lc.h:301
lte_lc_neighbor_search_type
Definition: lte_lc.h:937
@ LTE_LC_NEIGHBOR_SEARCH_TYPE_GCI_EXTENDED_COMPLETE
Definition: lte_lc.h:988
@ LTE_LC_NEIGHBOR_SEARCH_TYPE_GCI_DEFAULT
Definition: lte_lc.h:969
@ LTE_LC_NEIGHBOR_SEARCH_TYPE_GCI_EXTENDED_LIGHT
Definition: lte_lc.h:979
@ LTE_LC_NEIGHBOR_SEARCH_TYPE_EXTENDED_COMPLETE
Definition: lte_lc.h:962
@ LTE_LC_NEIGHBOR_SEARCH_TYPE_DEFAULT
Definition: lte_lc.h:942
@ LTE_LC_NEIGHBOR_SEARCH_TYPE_EXTENDED_LIGHT
Definition: lte_lc.h:953
int lte_lc_connect(void)
int lte_lc_func_mode_get(enum lte_lc_func_mode *mode)
int lte_lc_conn_eval_params_get(struct lte_lc_conn_eval_params *params)
int lte_lc_neighbor_cell_measurement(struct lte_lc_ncellmeas_params *params)
lte_lc_energy_estimate
Definition: lte_lc.h:574
@ LTE_LC_ENERGY_CONSUMPTION_EFFICIENT
Definition: lte_lc.h:610
@ LTE_LC_ENERGY_CONSUMPTION_REDUCED
Definition: lte_lc.h:603
@ LTE_LC_ENERGY_CONSUMPTION_NORMAL
Definition: lte_lc.h:596
@ LTE_LC_ENERGY_CONSUMPTION_INCREASED
Definition: lte_lc.h:589
@ LTE_LC_ENERGY_CONSUMPTION_EXCESSIVE
Definition: lte_lc.h:581
lte_lc_lte_mode
Definition: lte_lc.h:89
@ LTE_LC_LTE_MODE_NBIOT
Definition: lte_lc.h:97
@ LTE_LC_LTE_MODE_NONE
Definition: lte_lc.h:91
@ LTE_LC_LTE_MODE_LTEM
Definition: lte_lc.h:94
int lte_lc_deregister_handler(lte_lc_evt_handler_t handler)
lte_lc_modem_evt
Definition: lte_lc.h:668
@ LTE_LC_MODEM_EVT_NO_IMEI
Definition: lte_lc.h:710
@ LTE_LC_MODEM_EVT_CE_LEVEL_3
Definition: lte_lc.h:738
@ LTE_LC_MODEM_EVT_LIGHT_SEARCH_DONE
Definition: lte_lc.h:680
@ LTE_LC_MODEM_EVT_SEARCH_DONE
Definition: lte_lc.h:690
@ LTE_LC_MODEM_EVT_CE_LEVEL_1
Definition: lte_lc.h:724
@ LTE_LC_MODEM_EVT_CE_LEVEL_2
Definition: lte_lc.h:731
@ LTE_LC_MODEM_EVT_RESET_LOOP
Definition: lte_lc.h:701
@ LTE_LC_MODEM_EVT_BATTERY_LOW
Definition: lte_lc.h:704
@ LTE_LC_MODEM_EVT_CE_LEVEL_0
Definition: lte_lc.h:717
@ LTE_LC_MODEM_EVT_OVERHEATED
Definition: lte_lc.h:707
void(* lte_lc_evt_handler_t)(const struct lte_lc_evt *const evt)
Definition: lte_lc.h:1242
int lte_lc_reduced_mobility_get(enum lte_lc_reduced_mobility_mode *mode)
lte_lc_rrc_mode
Definition: lte_lc.h:332
@ LTE_LC_RRC_MODE_IDLE
Definition: lte_lc.h:334
@ LTE_LC_RRC_MODE_CONNECTED
Definition: lte_lc.h:337
lte_lc_reduced_mobility_mode
Definition: lte_lc.h:652
@ LTE_LC_REDUCED_MOBILITY_DISABLED
Definition: lte_lc.h:664
@ LTE_LC_REDUCED_MOBILITY_NORDIC
Definition: lte_lc.h:657
@ LTE_LC_REDUCED_MOBILITY_DEFAULT
Definition: lte_lc.h:654
int lte_lc_nw_reg_status_get(enum lte_lc_nw_reg_status *status)
int lte_lc_edrx_req(bool enable)
void lte_lc_register_handler(lte_lc_evt_handler_t handler)
int lte_lc_lte_mode_get(enum lte_lc_lte_mode *mode)
int lte_lc_power_off(void)
int lte_lc_neighbor_cell_measurement_cancel(void)
lte_lc_periodic_search_pattern_type
Definition: lte_lc.h:1009
@ LTE_LC_PERIODIC_SEARCH_PATTERN_TABLE
Definition: lte_lc.h:1014
@ LTE_LC_PERIODIC_SEARCH_PATTERN_RANGE
Definition: lte_lc.h:1011
int lte_lc_proprietary_psm_req(bool enable)
int lte_lc_periodic_search_request(void)
int lte_lc_func_mode_set(enum lte_lc_func_mode mode)
int lte_lc_modem_events_disable(void)
int lte_lc_factory_reset(enum lte_lc_factory_reset_type type)
lte_lc_system_mode
Definition: lte_lc.h:60
@ LTE_LC_SYSTEM_MODE_NBIOT
Definition: lte_lc.h:65
@ LTE_LC_SYSTEM_MODE_LTEM_NBIOT
Definition: lte_lc.h:77
@ LTE_LC_SYSTEM_MODE_NBIOT_GPS
Definition: lte_lc.h:74
@ LTE_LC_SYSTEM_MODE_GPS
Definition: lte_lc.h:68
@ LTE_LC_SYSTEM_MODE_LTEM
Definition: lte_lc.h:62
@ LTE_LC_SYSTEM_MODE_LTEM_NBIOT_GPS
Definition: lte_lc.h:80
@ LTE_LC_SYSTEM_MODE_LTEM_GPS
Definition: lte_lc.h:71
int lte_lc_offline(void)
int lte_lc_edrx_param_set(enum lte_lc_lte_mode mode, const char *edrx)
lte_lc_nw_reg_status
Definition: lte_lc.h:33
@ LTE_LC_NW_REG_REGISTERED_HOME
Definition: lte_lc.h:38
@ LTE_LC_NW_REG_UICC_FAIL
Definition: lte_lc.h:56
@ LTE_LC_NW_REG_REGISTRATION_DENIED
Definition: lte_lc.h:47
@ LTE_LC_NW_REG_SEARCHING
Definition: lte_lc.h:44
@ LTE_LC_NW_REG_REGISTERED_ROAMING
Definition: lte_lc.h:53
@ LTE_LC_NW_REG_NOT_REGISTERED
Definition: lte_lc.h:35
@ LTE_LC_NW_REG_UNKNOWN
Definition: lte_lc.h:50
int lte_lc_reduced_mobility_set(enum lte_lc_reduced_mobility_mode mode)
int lte_lc_periodic_search_get(struct lte_lc_periodic_search_cfg *const cfg)
lte_lc_system_mode_preference
Definition: lte_lc.h:109
@ LTE_LC_SYSTEM_MODE_PREFER_NBIOT
Definition: lte_lc.h:127
@ LTE_LC_SYSTEM_MODE_PREFER_LTEM_PLMN_PRIO
Definition: lte_lc.h:135
@ LTE_LC_SYSTEM_MODE_PREFER_NBIOT_PLMN_PRIO
Definition: lte_lc.h:143
@ LTE_LC_SYSTEM_MODE_PREFER_LTEM
Definition: lte_lc.h:119
@ LTE_LC_SYSTEM_MODE_PREFER_AUTO
Definition: lte_lc.h:111
int lte_lc_modem_events_enable(void)
int lte_lc_normal(void)
uint64_t measurement_time
Definition: lte_lc.h:461
uint64_t timing_advance_meas_time
Definition: lte_lc.h:454
uint32_t tac
Definition: lte_lc.h:426
uint16_t timing_advance
Definition: lte_lc.h:441
uint32_t earfcn
Definition: lte_lc.h:429
int16_t rsrq
Definition: lte_lc.h:508
uint16_t phys_cell_id
Definition: lte_lc.h:464
int mnc
Definition: lte_lc.h:420
int16_t rsrp
Definition: lte_lc.h:484
uint32_t id
Definition: lte_lc.h:423
int mcc
Definition: lte_lc.h:417
Definition: lte_lc.h:415
uint8_t gci_cells_count
Definition: lte_lc.h:534
struct lte_lc_cell current_cell
Definition: lte_lc.h:518
uint8_t ncells_count
Definition: lte_lc.h:524
struct lte_lc_ncell * neighbor_cells
Definition: lte_lc.h:527
struct lte_lc_cell * gci_cells
Definition: lte_lc.h:537
Definition: lte_lc.h:513
void(* callback)(enum lte_lc_func_mode, void *ctx)
Definition: lte_lc.h:1171
void * context
Definition: lte_lc.h:1172
Definition: lte_lc.h:1170
int16_t rsrp
Definition: lte_lc.h:825
int16_t phy_cid
Definition: lte_lc.h:878
int16_t tx_rep
Definition: lte_lc.h:862
int16_t tx_power
Definition: lte_lc.h:914
int16_t dl_pathloss
Definition: lte_lc.h:805
uint32_t cell_id
Definition: lte_lc.h:923
enum lte_lc_rrc_mode rrc_state
Definition: lte_lc.h:772
int16_t band
Definition: lte_lc.h:887
int mcc
Definition: lte_lc.h:917
int16_t rx_rep
Definition: lte_lc.h:875
int earfcn
Definition: lte_lc.h:802
int16_t snr
Definition: lte_lc.h:901
enum lte_lc_energy_estimate energy_estimate
Definition: lte_lc.h:778
enum lte_lc_ce_level ce_level
Definition: lte_lc.h:799
int16_t rsrq
Definition: lte_lc.h:849
enum lte_lc_tau_triggered tau_trig
Definition: lte_lc.h:784
int mnc
Definition: lte_lc.h:920
Definition: lte_lc.h:770
enum lte_lc_lte_mode mode
Definition: lte_lc.h:356
float edrx
Definition: lte_lc.h:359
float ptw
Definition: lte_lc.h:362
Definition: lte_lc.h:350
struct lte_lc_cells_info cells_info
Definition: lte_lc.h:1230
uint64_t time
Definition: lte_lc.h:1227
struct lte_lc_modem_sleep modem_sleep
Definition: lte_lc.h:1217
struct lte_lc_edrx_cfg edrx_cfg
Definition: lte_lc.h:1205
enum lte_lc_rrc_mode rrc_mode
Definition: lte_lc.h:1199
enum lte_lc_modem_evt modem_evt
Definition: lte_lc.h:1220
struct lte_lc_cell cell
Definition: lte_lc.h:1208
enum lte_lc_lte_mode lte_mode
Definition: lte_lc.h:1211
enum lte_lc_evt_type type
Definition: lte_lc.h:1192
struct lte_lc_psm_cfg psm_cfg
Definition: lte_lc.h:1202
enum lte_lc_nw_reg_status nw_reg_status
Definition: lte_lc.h:1196
struct lte_lc_rai_cfg rai_cfg
Definition: lte_lc.h:1233
Definition: lte_lc.h:1190
enum lte_lc_modem_sleep_type type
Definition: lte_lc.h:565
int64_t time
Definition: lte_lc.h:570
Definition: lte_lc.h:563
uint16_t phys_cell_id
Definition: lte_lc.h:397
int16_t rsrp
Definition: lte_lc.h:404
int time_diff
Definition: lte_lc.h:394
uint32_t earfcn
Definition: lte_lc.h:387
int16_t rsrq
Definition: lte_lc.h:411
Definition: lte_lc.h:385
enum lte_lc_neighbor_search_type search_type
Definition: lte_lc.h:994
uint8_t gci_count
Definition: lte_lc.h:1004
Definition: lte_lc.h:992
struct lte_lc_periodic_search_pattern patterns[4]
Definition: lte_lc.h:1166
uint16_t return_to_pattern
Definition: lte_lc.h:1149
size_t pattern_count
Definition: lte_lc.h:1163
uint16_t band_optimization
Definition: lte_lc.h:1160
bool loop
Definition: lte_lc.h:1138
Definition: lte_lc.h:1131
struct lte_lc_periodic_search_table_cfg table
Definition: lte_lc.h:1126
struct lte_lc_periodic_search_range_cfg range
Definition: lte_lc.h:1123
enum lte_lc_periodic_search_pattern_type type
Definition: lte_lc.h:1119
Definition: lte_lc.h:1117
int16_t time_to_final_sleep
Definition: lte_lc.h:1047
uint16_t final_sleep
Definition: lte_lc.h:1031
int16_t pattern_end_point
Definition: lte_lc.h:1058
uint16_t initial_sleep
Definition: lte_lc.h:1024
Definition: lte_lc.h:1018
int val_4
Definition: lte_lc.h:1100
int val_2
Definition: lte_lc.h:1082
int val_1
Definition: lte_lc.h:1075
int val_5
Definition: lte_lc.h:1109
int val_3
Definition: lte_lc.h:1091
Definition: lte_lc.h:1073
int active_time
Definition: lte_lc.h:346
int tau
Definition: lte_lc.h:343
Definition: lte_lc.h:341
int mcc
Definition: lte_lc.h:755
bool cp_rai
Definition: lte_lc.h:761
uint32_t cell_id
Definition: lte_lc.h:753
int mnc
Definition: lte_lc.h:757
bool as_rai
Definition: lte_lc.h:759
Definition: lte_lc.h:751