7#include <zephyr/kernel.h>
8#include <zephyr/types.h>
12#include <zephyr/logging/log.h>
14#define AT_CFUN_READ "AT+CFUN?"
15#define AT_CEREG_5 "AT+CEREG=5"
16#define AT_CEREG_READ "AT+CEREG?"
17#define AT_CEREG_REG_STATUS_INDEX 1
18#define AT_CEREG_TAC_INDEX 2
19#define AT_CEREG_CELL_ID_INDEX 3
20#define AT_CEREG_ACT_INDEX 4
21#define AT_CEREG_CAUSE_TYPE_INDEX 5
22#define AT_CEREG_REJECT_CAUSE_INDEX 6
23#define AT_CEREG_ACTIVE_TIME_INDEX 7
24#define AT_CEREG_TAU_INDEX 8
25#define AT_XSYSTEMMODE_READ "AT%XSYSTEMMODE?"
28#define AT_XSYSTEMMODE_READ_LTEM_INDEX 1
29#define AT_XSYSTEMMODE_READ_NBIOT_INDEX 2
30#define AT_XSYSTEMMODE_READ_GPS_INDEX 3
31#define AT_XSYSTEMMODE_READ_PREFERENCE_INDEX 4
34#define AT_CEDRXS_MODE_INDEX
35#define AT_CEDRXS_ACTT_WB 4
36#define AT_CEDRXS_ACTT_NB 5
39#define AT_CEDRXP_ACTT_INDEX 1
40#define AT_CEDRXP_REQ_EDRX_INDEX 2
41#define AT_CEDRXP_NW_EDRX_INDEX 3
42#define AT_CEDRXP_NW_PTW_INDEX 4
45#define AT_CSCON_RRC_MODE_INDEX 1
46#define AT_CSCON_READ_RRC_MODE_INDEX 2
49#define AT_XT3412_SUB "AT%%XT3412=1,%d,%d"
50#define AT_XT3412_TIME_INDEX 1
51#define T3412_MAX 35712000000
54#define AT_NCELLMEAS_START "AT%%NCELLMEAS"
55#define AT_NCELLMEAS_STOP "AT%%NCELLMEASSTOP"
56#define AT_NCELLMEAS_STATUS_INDEX 1
57#define AT_NCELLMEAS_STATUS_VALUE_SUCCESS 0
58#define AT_NCELLMEAS_STATUS_VALUE_FAIL 1
59#define AT_NCELLMEAS_STATUS_VALUE_INCOMPLETE 2
60#define AT_NCELLMEAS_CELL_ID_INDEX 2
61#define AT_NCELLMEAS_PLMN_INDEX 3
62#define AT_NCELLMEAS_TAC_INDEX 4
63#define AT_NCELLMEAS_TIMING_ADV_INDEX 5
64#define AT_NCELLMEAS_EARFCN_INDEX 6
65#define AT_NCELLMEAS_PHYS_CELL_ID_INDEX 7
66#define AT_NCELLMEAS_RSRP_INDEX 8
67#define AT_NCELLMEAS_RSRQ_INDEX 9
68#define AT_NCELLMEAS_MEASUREMENT_TIME_INDEX 10
69#define AT_NCELLMEAS_PRE_NCELLS_PARAMS_COUNT 11
73#define AT_NCELLMEAS_N_EARFCN_INDEX 0
74#define AT_NCELLMEAS_N_PHYS_CELL_ID_INDEX 1
75#define AT_NCELLMEAS_N_RSRP_INDEX 2
76#define AT_NCELLMEAS_N_RSRQ_INDEX 3
77#define AT_NCELLMEAS_N_TIME_DIFF_INDEX 4
78#define AT_NCELLMEAS_N_PARAMS_COUNT 5
79#define AT_NCELLMEAS_N_MAX_ARRAY_SIZE CONFIG_LTE_NEIGHBOR_CELLS_MAX
81#define AT_NCELLMEAS_PARAMS_COUNT_MAX \
82 (AT_NCELLMEAS_PRE_NCELLS_PARAMS_COUNT + \
83 AT_NCELLMEAS_N_PARAMS_COUNT * CONFIG_LTE_NEIGHBOR_CELLS_MAX)
85#define AT_NCELLMEAS_GCI_CELL_PARAMS_COUNT 12
88#define AT_XMODEMSLEEP_SUB "AT%%XMODEMSLEEP=1,%d,%d"
89#define AT_XMODEMSLEEP_PARAMS_COUNT_MAX 4
90#define AT_XMODEMSLEEP_TYPE_INDEX 1
91#define AT_XMODEMSLEEP_TIME_INDEX 2
94#define AT_CONEVAL_READ "AT%CONEVAL"
95#define AT_CONEVAL_PARAMS_MAX 19
96#define AT_CONEVAL_RESULT_INDEX 1
97#define AT_CONEVAL_RRC_STATE_INDEX 2
98#define AT_CONEVAL_ENERGY_ESTIMATE_INDEX 3
99#define AT_CONEVAL_RSRP_INDEX 4
100#define AT_CONEVAL_RSRQ_INDEX 5
101#define AT_CONEVAL_SNR_INDEX 6
102#define AT_CONEVAL_CELL_ID_INDEX 7
103#define AT_CONEVAL_PLMN_INDEX 8
104#define AT_CONEVAL_PHYSICAL_CELL_ID_INDEX 9
105#define AT_CONEVAL_EARFCN_INDEX 10
106#define AT_CONEVAL_BAND_INDEX 11
107#define AT_CONEVAL_TAU_TRIGGERED_INDEX 12
108#define AT_CONEVAL_CE_LEVEL_INDEX 13
109#define AT_CONEVAL_TX_POWER_INDEX 14
110#define AT_CONEVAL_TX_REPETITIONS_INDEX 15
111#define AT_CONEVAL_RX_REPETITIONS_INDEX 16
112#define AT_CONEVAL_DL_PATHLOSS_INDEX 17
115#define AT_MDMEV_ENABLE_1 "AT%%MDMEV=1"
116#define AT_MDMEV_ENABLE_2 "AT%%MDMEV=2"
117#define AT_MDMEV_DISABLE "AT%%MDMEV=0"
118#define AT_MDMEV_RESPONSE_PREFIX "%MDMEV: "
119#define AT_MDMEV_OVERHEATED "ME OVERHEATED\r\n"
120#define AT_MDMEV_BATTERY_LOW "ME BATTERY LOW\r\n"
121#define AT_MDMEV_SEARCH_STATUS_1 "SEARCH STATUS 1\r\n"
122#define AT_MDMEV_SEARCH_STATUS_2 "SEARCH STATUS 2\r\n"
123#define AT_MDMEV_RESET_LOOP "RESET LOOP\r\n"
124#define AT_MDMEV_NO_IMEI "NO IMEI\r\n"
125#define AT_MDMEV_CE_LEVEL_0 "PRACH CE-LEVEL 0\r\n"
126#define AT_MDMEV_CE_LEVEL_1 "PRACH CE-LEVEL 1\r\n"
127#define AT_MDMEV_CE_LEVEL_2 "PRACH CE-LEVEL 2\r\n"
128#define AT_MDMEV_CE_LEVEL_3 "PRACH CE-LEVEL 3\r\n"
131#define AT_RAI_RESPONSE_PREFIX "%RAI"
132#define AT_RAI_PARAMS_COUNT_MAX 5
133#define AT_RAI_CELL_ID_INDEX 1
134#define AT_RAI_PLMN_INDEX 2
135#define AT_RAI_AS_INDEX 3
136#define AT_RAI_CP_INDEX 4
175int parse_psm(
const char *active_time_str,
const char *tau_ext_str,
188int encode_psm(
char *tau_ext_str,
char *active_time_str,
int rptau,
int rat);
static const struct event_proxy_config cfg
Definition: event_proxy_def.h:28
lte_lc_lte_mode
Definition: lte_lc.h:89
lte_lc_modem_evt
Definition: lte_lc.h:668
void(* lte_lc_evt_handler_t)(const struct lte_lc_evt *const evt)
Definition: lte_lc.h:1242
lte_lc_rrc_mode
Definition: lte_lc.h:332
lte_lc_nw_reg_status
Definition: lte_lc.h:33
int string_to_int(const char *str_buf, int base, int *output)
int parse_xt3412(const char *at_response, uint64_t *time)
int parse_coneval(const char *at_response, struct lte_lc_conn_eval_params *params)
bool event_handler_list_is_empty(void)
int parse_rrc_mode(const char *at_response, enum lte_lc_rrc_mode *mode, size_t mode_index)
int encode_psm(char *tau_ext_str, char *active_time_str, int rptau, int rat)
uint32_t neighborcell_count_get(const char *at_response)
int parse_cereg(const char *at_response, enum lte_lc_nw_reg_status *reg_status, struct lte_lc_cell *cell, enum lte_lc_lte_mode *lte_mode, struct lte_lc_psm_cfg *psm_cfg)
int parse_ncellmeas_gci(struct lte_lc_ncellmeas_params *params, const char *at_response, struct lte_lc_cells_info *cells)
int parse_mdmev(const char *at_response, enum lte_lc_modem_evt *modem_evt)
int parse_ncellmeas(const char *at_response, struct lte_lc_cells_info *cells)
int parse_rai(const char *at_response, struct lte_lc_rai_cfg *rai_cfg)
void event_handler_list_dispatch(const struct lte_lc_evt *const evt)
int parse_psm(const char *active_time_str, const char *tau_ext_str, const char *tau_legacy_str, struct lte_lc_psm_cfg *psm_cfg)
int parse_periodic_search_pattern(const char *const pattern_str, struct lte_lc_periodic_search_pattern *pattern)
char * periodic_search_pattern_get(char *const buf, size_t buf_size, const struct lte_lc_periodic_search_pattern *const pattern)
int parse_xmodemsleep(const char *at_response, struct lte_lc_modem_sleep *modem_sleep)
int parse_edrx(const char *at_response, struct lte_lc_edrx_cfg *cfg, char *edrx_str, char *ptw_str)
int event_handler_list_remove_handler(lte_lc_evt_handler_t handler)
int event_handler_list_append_handler(lte_lc_evt_handler_t handler)
Definition: lte_lc.h:1190
Definition: lte_lc.h:1117