21#ifndef __INCLUDE_NUTTX_WIRELESS_LTE_LTE_H
22#define __INCLUDE_NUTTX_WIRELESS_LTE_LTE_H
43#define LTE_RESULT_OK (0)
44#define LTE_RESULT_ERROR (1)
45#define LTE_RESULT_CANCEL (2)
47#define LTE_VALID (true)
48#define LTE_INVALID (false)
50#define LTE_ENABLE (true)
51#define LTE_DISABLE (false)
53#define LTE_ERR_WAITENTERPIN (1)
54#define LTE_ERR_REJECT (2)
55#define LTE_ERR_MAXRETRY (3)
56#define LTE_ERR_BARRING (4)
57#define LTE_ERR_DETACHED (5)
58#define LTE_ERR_UNEXPECTED (255)
60#define LTE_SESSION_ID_MIN (1)
61#define LTE_SESSION_ID_MAX (5)
66#define LTE_NETSTAT_NOT_REG_NOT_SEARCHING (0)
70#define LTE_NETSTAT_REG_HOME (1)
75#define LTE_NETSTAT_NOT_REG_SEARCHING (2)
79#define LTE_NETSTAT_REG_DENIED (3)
83#define LTE_NETSTAT_UNKNOWN (4)
87#define LTE_NETSTAT_REG_ROAMING (5)
91#define LTE_NETSTAT_REG_SMS_ONLY_HOME (6)
95#define LTE_NETSTAT_REG_SMS_ONLY_ROAMING (7)
99#define LTE_NETSTAT_NOT_REG_EMERGENCY (8)
103#define LTE_NETSTAT_REG_CSFB_NOT_PREF_HOME (9)
107#define LTE_NETSTAT_REG_CSFB_NOT_PREF_ROAMING (10)
111#define LTE_APN_LEN (101)
115#define LTE_APN_USER_NAME_LEN (64)
119#define LTE_APN_PASSWD_LEN (32)
121#define LTE_IPTYPE_V4 (0)
122#define LTE_IPTYPE_V6 (1)
123#define LTE_IPTYPE_V4V6 (2)
124#define LTE_IPTYPE_NON (3)
128#define LTE_APN_AUTHTYPE_NONE (0)
129#define LTE_APN_AUTHTYPE_PAP (1)
130#define LTE_APN_AUTHTYPE_CHAP (2)
134#define LTE_APN_TYPE_UNKNOWN (0x01)
138#define LTE_APN_TYPE_DEFAULT (0x02)
142#define LTE_APN_TYPE_MMS (0x04)
146#define LTE_APN_TYPE_SUPL (0x08)
150#define LTE_APN_TYPE_DUN (0x10)
154#define LTE_APN_TYPE_HIPRI (0x20)
158#define LTE_APN_TYPE_FOTA (0x40)
162#define LTE_APN_TYPE_IMS (0x80)
166#define LTE_APN_TYPE_CBS (0x100)
170#define LTE_APN_TYPE_IA (0x200)
174#define LTE_APN_TYPE_EMERGENCY (0x400)
178#define LTE_NETERR_MAXRETRY (0)
182#define LTE_NETERR_REJECT (1)
186#define LTE_NETERR_NWDTCH (2)
190#define LTE_REJECT_CATEGORY_EMM (0)
194#define LTE_REJECT_CATEGORY_ESM (1)
198#define LTE_VER_BB_PRODUCT_LEN (32)
202#define LTE_VER_NP_PACKAGE_LEN (32)
206#define LTE_VER_FIRMWARE_LEN (32)
210#define LTE_PINSTAT_READY (0)
214#define LTE_PINSTAT_SIM_PIN (1)
218#define LTE_PINSTAT_SIM_PUK (2)
222#define LTE_PINSTAT_PH_SIM_PIN (3)
226#define LTE_PINSTAT_PH_FSIM_PIN (4)
231#define LTE_PINSTAT_PH_FSIM_PUK (5)
235#define LTE_PINSTAT_SIM_PIN2 (6)
239#define LTE_PINSTAT_SIM_PUK2 (7)
243#define LTE_PINSTAT_PH_NET_PIN (8)
248#define LTE_PINSTAT_PH_NET_PUK (9)
252#define LTE_PINSTAT_PH_NETSUB_PIN (10)
257#define LTE_PINSTAT_PH_NETSUB_PUK (11)
262#define LTE_PINSTAT_PH_SP_PIN (12)
267#define LTE_PINSTAT_PH_SP_PUK (13)
271#define LTE_PINSTAT_PH_CORP_PIN (14)
276#define LTE_PINSTAT_PH_CORP_PUK (15)
278#define LTE_TARGET_PIN (0)
279#define LTE_TARGET_PIN2 (1)
283#define LTE_SIMSTAT_REMOVAL (0)
287#define LTE_SIMSTAT_INSERTION (1)
291#define LTE_SIMSTAT_WAIT_PIN_UNLOCK (2)
295#define LTE_SIMSTAT_PERSONAL_FAILED (3)
300#define LTE_SIMSTAT_ACTIVATE (4)
304#define LTE_SIMSTAT_DEACTIVATE (5)
306#define LTE_MCC_DIGIT (3)
307#define LTE_MNC_DIGIT_MAX (3)
309#define LTE_EDRX_ACTTYPE_WBS1 (0)
310#define LTE_EDRX_ACTTYPE_NBS1 (1)
311#define LTE_EDRX_ACTTYPE_ECGSMIOT (2)
312#define LTE_EDRX_ACTTYPE_GSM (3)
313#define LTE_EDRX_ACTTYPE_IU (4)
314#define LTE_EDRX_ACTTYPE_NOTUSE (5)
316#define LTE_EDRX_CYC_512 (0)
317#define LTE_EDRX_CYC_1024 (1)
318#define LTE_EDRX_CYC_2048 (2)
319#define LTE_EDRX_CYC_4096 (3)
320#define LTE_EDRX_CYC_6144 (4)
321#define LTE_EDRX_CYC_8192 (5)
322#define LTE_EDRX_CYC_10240 (6)
323#define LTE_EDRX_CYC_12288 (7)
324#define LTE_EDRX_CYC_14336 (8)
325#define LTE_EDRX_CYC_16384 (9)
326#define LTE_EDRX_CYC_32768 (10)
327#define LTE_EDRX_CYC_65536 (11)
328#define LTE_EDRX_CYC_131072 (12)
329#define LTE_EDRX_CYC_262144 (13)
330#define LTE_EDRX_CYC_524288 (14)
331#define LTE_EDRX_CYC_1048576 (15)
332#define LTE_EDRX_PTW_128 (0)
333#define LTE_EDRX_PTW_256 (1)
334#define LTE_EDRX_PTW_384 (2)
335#define LTE_EDRX_PTW_512 (3)
336#define LTE_EDRX_PTW_640 (4)
337#define LTE_EDRX_PTW_768 (5)
338#define LTE_EDRX_PTW_896 (6)
339#define LTE_EDRX_PTW_1024 (7)
340#define LTE_EDRX_PTW_1152 (8)
341#define LTE_EDRX_PTW_1280 (9)
342#define LTE_EDRX_PTW_1408 (10)
343#define LTE_EDRX_PTW_1536 (11)
344#define LTE_EDRX_PTW_1664 (12)
345#define LTE_EDRX_PTW_1792 (13)
346#define LTE_EDRX_PTW_1920 (14)
347#define LTE_EDRX_PTW_2048 (15)
348#define LTE_EDRX_PTW_2304 (16)
349#define LTE_EDRX_PTW_2560 (17)
350#define LTE_EDRX_PTW_2816 (18)
351#define LTE_EDRX_PTW_3072 (19)
352#define LTE_EDRX_PTW_3328 (20)
353#define LTE_EDRX_PTW_3584 (21)
354#define LTE_EDRX_PTW_3840 (22)
355#define LTE_EDRX_PTW_4096 (23)
359#define LTE_PSM_T3324_UNIT_2SEC (0)
363#define LTE_PSM_T3324_UNIT_1MIN (1)
367#define LTE_PSM_T3324_UNIT_6MIN (2)
372#define LTE_PSM_T3324_UNIT_DEACT (3)
376#define LTE_PSM_T3412_UNIT_2SEC (0)
380#define LTE_PSM_T3412_UNIT_30SEC (1)
384#define LTE_PSM_T3412_UNIT_1MIN (2)
388#define LTE_PSM_T3412_UNIT_10MIN (3)
392#define LTE_PSM_T3412_UNIT_1HOUR (4)
396#define LTE_PSM_T3412_UNIT_10HOUR (5)
400#define LTE_PSM_T3412_UNIT_320HOUR (6)
405#define LTE_PSM_T3412_UNIT_DEACT (7)
409#define LTE_PSM_TIMEVAL_MIN (0)
413#define LTE_PSM_TIMEVAL_MAX (31)
415#define LTE_IPADDR_MAX_LEN (40)
419#define LTE_PDN_SESSIONID_INVALID_ID (0)
423#define LTE_PDN_SESSIONID_MIN (LTE_PDN_SESSIONID_INVALID_ID)
427#define LTE_PDN_SESSIONID_MAX (255)
429#define LTE_PDN_DEACTIVE (0)
430#define LTE_PDN_ACTIVE (1)
432#define LTE_PDN_IPADDR_MAX_COUNT (2)
434#define LTE_IMS_NOT_REGISTERED (0)
435#define LTE_IMS_REGISTERED (1)
436#define LTE_DATA_DISALLOW (0)
437#define LTE_DATA_ALLOW (1)
441#define LTE_RESTART_USER_INITIATED (0)
445#define LTE_RESTART_MODEM_INITIATED (1)
449#define LTE_RESTART_VERSION_ERROR (2)
453#define LTE_ERR_INDICATOR_ERRCODE (0x01)
457#define LTE_ERR_INDICATOR_ERRNO (0x02)
461#define LTE_ERR_INDICATOR_ERRSTR (0x04)
465#define LTE_ERROR_STRING_MAX_LEN (64)
469#define LTE_SIMINFO_GETOPT_MCCMNC (1 << 0)
473#define LTE_SIMINFO_GETOPT_SPN (1 << 1)
477#define LTE_SIMINFO_GETOPT_ICCID (1 << 2)
481#define LTE_SIMINFO_GETOPT_IMSI (1 << 3)
485#define LTE_SIMINFO_GETOPT_GID1 (1 << 4)
489#define LTE_SIMINFO_GETOPT_GID2 (1 << 5)
491#define LTE_SIMINFO_SPN_LEN (16)
492#define LTE_SIMINFO_ICCID_LEN (10)
493#define LTE_SIMINFO_IMSI_LEN (15)
494#define LTE_SIMINFO_GID_LEN (128)
499#define LTE_PHONENO_LEN (41)
504#define LTE_IMEI_LEN (16)
509#define LTE_OPERATOR_LEN (17)
514#define LTE_IMSI_LEN (LTE_SIMINFO_IMSI_LEN + 1)
518#define LTE_CELLINFO_OPT_GCID (1 << 0)
522#define LTE_CELLINFO_OPT_AREACODE (1 << 1)
526#define LTE_CELLINFO_OPT_SFN (1 << 2)
530#define LTE_CELLINFO_OPT_RSRP (1 << 3)
534#define LTE_CELLINFO_OPT_RSRQ (1 << 4)
538#define LTE_CELLINFO_OPT_TIMEDIFFIDX (1 << 5)
542#define LTE_CELLINFO_OPT_TA (1 << 6)
546#define LTE_CELLINFO_OPT_NEIGHBOR (1 << 7)
548#define LTE_NEIGHBOR_CELL_MAX (32)
550#define LTE_RAT_CATM (2)
551#define LTE_RAT_NBIOT (3)
553#define LTE_RAT_MODE_SINGLE (0)
554#define LTE_RAT_MODE_MULTIPLE (1)
558#define LTE_RAT_SOURCE_DEFAULT (0)
562#define LTE_RAT_SOURCE_HOST (1)
566#define LTE_RAT_SOURCE_LWM2M (2)
570#define LTE_AT_COMMAND_MAX_LEN (2048)
574#define LTEFW_INJECTION_MODE_NEW (0)
578#define LTEFW_INJECTION_MODE_APPEND (1)
584#define LTEFW_RESULT_OK (0x0000)
588#define LTEFW_RESULT_NOT_ENOUGH_INJECTSTORAGE (-1)
592#define LTEFW_RESULT_DELTAIMAGE_HDR_CRC_ERROR (-2)
596#define LTEFW_RESULT_DELTAIMAGE_HDR_UNSUPPORTED (-3)
600#define LTEFW_RESULT_PRECHK_SET_DELTAIMAGE_FAILED (-4)
604#define LTEFW_RESULT_DELTAUPDATE_FAILED (-5)
608#define LTEFW_RESULT_PRECHK_DELTAIMAGE_MISSING (-6)
612#define LTEFW_RESULT_PRECHK_OOM (-7)
616#define LTEFW_RESULT_PRECHK_SIZE_ERROR (-8)
620#define LTEFW_RESULT_PRECHK_PKG_ERROR (-9)
624#define LTEFW_RESULT_PRECHK_CRC_ERROR (-10)
628#define LTEFW_RESULT_DELTAUPDATE_NORESULT (-11)
632#define LTE_LOG_NAME_LEN 32
636#define LTE_LOG_LIST_SIZE 3
1697 uint8_t attemptsleft);
struct lte_ce_setting lte_ce_setting_t
void(* get_ver_cb_t)(uint32_t result, lte_version_t *version)
Definition: lte.h:1551
void(* get_ce_cb_t)(uint32_t result, lte_ce_setting_t *settings)
Definition: lte.h:1801
void(* set_pinenable_cb_t)(uint32_t result, uint8_t attemptsleft)
Definition: lte.h:1642
#define LTE_PDN_IPADDR_MAX_COUNT
Definition: lte.h:432
void(* get_imei_cb_t)(uint32_t result, char *imei)
Definition: lte.h:1610
struct lte_neighbor_cell lte_neighbor_cell_t
struct lte_psm_timeval lte_psm_timeval_t
#define LTE_IPADDR_MAX_LEN
Definition: lte.h:415
void(* get_operator_cb_t)(uint32_t result, char *oper)
Definition: lte.h:1730
void(* radio_on_cb_t)(uint32_t result)
Definition: lte.h:1874
void(* get_dynamic_edrx_param_cb_t)(uint32_t result, lte_edrx_setting_t *param)
Definition: lte.h:2017
void(* localtime_report_cb_t)(lte_localtime_t *localtime)
Definition: lte.h:1841
void(* get_imsi_cb_t)(uint32_t result, uint8_t errcause, char *imsi)
Definition: lte.h:1593
struct lte_apn_setting lte_apn_setting_t
void(* data_allow_cb_t)(uint32_t result)
Definition: lte.h:1963
void(* quality_report_cb_t)(lte_quality_t *quality)
Definition: lte.h:1851
void(* get_imscap_cb_t)(uint32_t result, bool imscap)
Definition: lte.h:1921
struct lte_siminfo lte_siminfo_t
void(* activate_pdn_cb_t)(uint32_t result, lte_pdn_t *pdn)
Definition: lte.h:1937
#define LTE_VER_BB_PRODUCT_LEN
Definition: lte.h:198
#define LTE_SIMINFO_ICCID_LEN
Definition: lte.h:492
#define LTE_ERROR_STRING_MAX_LEN
Definition: lte.h:465
#define LTE_VER_FIRMWARE_LEN
Definition: lte.h:206
struct lte_cellinfo lte_cellinfo_t
void(* simstat_report_cb_t)(uint32_t simstat)
Definition: lte.h:1831
#define LTE_MCC_DIGIT
Definition: lte.h:306
#define LTE_SIMINFO_GID_LEN
Definition: lte.h:494
#define LTE_MNC_DIGIT_MAX
Definition: lte.h:307
struct lte_netinfo lte_netinfo_t
void(* get_localtime_cb_t)(uint32_t result, lte_localtime_t *localtime)
Definition: lte.h:1712
void(* set_edrx_cb_t)(uint32_t result)
Definition: lte.h:1758
void(* get_quality_cb_t)(uint32_t result, lte_quality_t *quality)
Definition: lte.h:2081
void(* get_edrx_cb_t)(uint32_t result, lte_edrx_setting_t *settings)
Definition: lte.h:1745
struct lte_psm_setting lte_psm_setting_t
struct lte_version lte_version_t
struct lte_ratinfo lte_ratinfo_t
struct lte_nw_err_info lte_nw_err_info_t
struct lte_quality lte_quality_t
void(* netinfo_report_cb_t)(lte_netinfo_t *info)
Definition: lte.h:1987
void(* restart_report_cb_t)(uint32_t reason)
Definition: lte.h:1976
struct lte_ipaddr lte_ipaddr_t
void(* get_phoneno_cb_t)(uint32_t result, uint8_t errcause, char *phoneno)
Definition: lte.h:1572
void(* radio_off_cb_t)(uint32_t result)
Definition: lte.h:1887
struct lte_localtime lte_localtime_t
void(* deactivate_pdn_cb_t)(uint32_t result)
Definition: lte.h:1950
#define LTE_SIMINFO_IMSI_LEN
Definition: lte.h:493
void(* set_ce_cb_t)(uint32_t result)
Definition: lte.h:1814
struct lte_edrx_setting lte_edrx_setting_t
void(* get_current_edrx_cb_t)(uint32_t result, lte_edrx_setting_t *settings)
Definition: lte.h:2049
#define LTE_SIMINFO_SPN_LEN
Definition: lte.h:491
void(* set_psm_cb_t)(uint32_t result)
Definition: lte.h:1786
struct lte_reject_cause lte_reject_cause_t
void(* get_netinfo_cb_t)(uint32_t result, lte_netinfo_t *info)
Definition: lte.h:1903
void(* get_siminfo_cb_t)(uint32_t result, lte_siminfo_t *siminfo)
Definition: lte.h:2002
struct lte_error_info lte_errinfo_t
void(* context_save_cb_t)(uint8_t *data, int size)
Definition: lte.h:2094
void(* change_pin_cb_t)(uint32_t result, uint8_t attemptsleft)
Definition: lte.h:1658
void(* get_dynamic_psm_param_cb_t)(uint32_t result, lte_psm_setting_t *param)
Definition: lte.h:2033
#define LTE_VER_NP_PACKAGE_LEN
Definition: lte.h:202
void(* get_psm_cb_t)(uint32_t result, lte_psm_setting_t *settings)
Definition: lte.h:1773
void(* get_pinset_cb_t)(uint32_t result, lte_getpin_t *pinset)
Definition: lte.h:1626
struct lte_getpin lte_getpin_t
void(* get_current_psm_cb_t)(uint32_t result, lte_psm_setting_t *settings)
Definition: lte.h:2065
void(* cellinfo_report_cb_t)(lte_cellinfo_t *cellinfo)
Definition: lte.h:1861
void(* enter_pin_cb_t)(uint32_t result, uint8_t simstat, uint8_t attemptsleft)
Definition: lte.h:1695
char * password
Definition: lte.h:1128
char * apn
Definition: lte.h:1087
uint32_t apn_type
Definition: lte.h:1118
uint8_t ip_type
Definition: lte.h:1096
uint8_t auth_type
Definition: lte.h:1103
char * user_name
Definition: lte.h:1123
bool mode_b_enable
Definition: lte.h:1380
bool mode_a_enable
Definition: lte.h:1374
uint8_t mcc[LTE_MCC_DIGIT]
Definition: lte.h:849
int16_t rsrq
Definition: lte.h:901
lte_neighbor_cell_t * neighbors
Definition: lte.h:933
uint8_t option
Definition: lte.h:871
bool valid
Definition: lte.h:837
uint16_t area_code
Definition: lte.h:883
uint8_t nr_neighbor
Definition: lte.h:924
uint16_t time_diffidx
Definition: lte.h:907
uint16_t sfn
Definition: lte.h:889
uint32_t gcid
Definition: lte.h:877
uint8_t mnc[LTE_MNC_DIGIT_MAX]
Definition: lte.h:857
uint32_t phycell_id
Definition: lte.h:841
int16_t rsrp
Definition: lte.h:895
uint8_t mnc_digit
Definition: lte.h:853
uint16_t ta
Definition: lte.h:913
uint32_t earfcn
Definition: lte.h:845
uint32_t ptw_val
Definition: lte.h:1006
uint32_t edrx_cycle
Definition: lte.h:983
bool enable
Definition: lte.h:962
uint8_t act_type
Definition: lte.h:956
int32_t err_result_code
Definition: lte.h:1346
char err_string[LTE_ERROR_STRING_MAX_LEN]
Definition: lte.h:1354
uint8_t err_indicator
Definition: lte.h:1342
int32_t err_no
Definition: lte.h:1350
uint8_t enable
Definition: lte.h:683
uint8_t pin_attemptsleft
Definition: lte.h:692
uint8_t puk_attemptsleft
Definition: lte.h:696
uint8_t puk2_attemptsleft
Definition: lte.h:704
uint8_t status
Definition: lte.h:688
uint8_t pin2_attemptsleft
Definition: lte.h:700
char address[LTE_IPADDR_MAX_LEN]
Definition: lte.h:1151
uint8_t ip_type
Definition: lte.h:1146
int32_t min
Definition: lte.h:723
int32_t tz_sec
Definition: lte.h:725
int32_t year
Definition: lte.h:719
int32_t mday
Definition: lte.h:721
int32_t sec
Definition: lte.h:724
int32_t mon
Definition: lte.h:720
int32_t hour
Definition: lte.h:722
int16_t rsrq
Definition: lte.h:813
uint8_t option
Definition: lte.h:787
uint16_t sfn
Definition: lte.h:801
uint32_t phycell_id
Definition: lte.h:791
int16_t rsrp
Definition: lte.h:807
uint32_t earfcn
Definition: lte.h:795
uint8_t nw_stat
Definition: lte.h:1302
lte_nw_err_info_t nw_err
Definition: lte.h:1310
uint8_t pdn_num
Definition: lte.h:1315
lte_pdn_t * pdn_stat
Definition: lte.h:1323
uint8_t err_type
Definition: lte.h:1267
lte_reject_cause_t reject_cause
Definition: lte.h:1275
uint8_t data_allow
Definition: lte.h:1211
uint8_t active
Definition: lte.h:1174
uint8_t data_roaming_allow
Definition: lte.h:1218
uint8_t ipaddr_num
Definition: lte.h:1193
uint8_t session_id
Definition: lte.h:1168
uint8_t ims_register
Definition: lte.h:1205
uint32_t apn_type
Definition: lte.h:1189
lte_ipaddr_t address[LTE_PDN_IPADDR_MAX_COUNT]
Definition: lte.h:1197
lte_psm_timeval_t ext_periodic_tau_time
Definition: lte.h:1068
lte_psm_timeval_t req_active_time
Definition: lte.h:1064
bool enable
Definition: lte.h:1060
uint8_t unit
Definition: lte.h:1037
uint8_t time_val
Definition: lte.h:1041
int16_t rsrq
Definition: lte.h:757
bool valid
Definition: lte.h:749
int16_t sinr
Definition: lte.h:761
int16_t rsrp
Definition: lte.h:753
int16_t rssi
Definition: lte.h:765
uint8_t source
Definition: lte.h:1508
bool multi_rat_support
Definition: lte.h:1499
uint8_t rat
Definition: lte.h:1491
uint8_t value
Definition: lte.h:1246
uint8_t category
Definition: lte.h:1239
char gid2[LTE_SIMINFO_GID_LEN]
Definition: lte.h:1471
char gid1[LTE_SIMINFO_GID_LEN]
Definition: lte.h:1461
char mcc[LTE_MCC_DIGIT]
Definition: lte.h:1410
uint8_t iccid[LTE_SIMINFO_ICCID_LEN]
Definition: lte.h:1441
char spn[LTE_SIMINFO_SPN_LEN]
Definition: lte.h:1430
uint32_t option
Definition: lte.h:1405
uint8_t imsi_len
Definition: lte.h:1446
char mnc[LTE_MNC_DIGIT_MAX]
Definition: lte.h:1420
uint8_t mnc_digit
Definition: lte.h:1415
uint8_t spn_len
Definition: lte.h:1425
char imsi[LTE_SIMINFO_IMSI_LEN]
Definition: lte.h:1451
uint8_t iccid_len
Definition: lte.h:1435
uint8_t gid2_len
Definition: lte.h:1466
uint8_t gid1_len
Definition: lte.h:1456
char bb_product[LTE_VER_BB_PRODUCT_LEN]
Definition: lte.h:656
char np_package[LTE_VER_NP_PACKAGE_LEN]
Definition: lte.h:660
uint32_t data_len
Definition: lte.h:1527
uint8_t inject_mode
Definition: lte.h:1534
uint8_t * data
Definition: lte.h:1523