7#ifndef ZEPHYR_INCLUDE_MODEM_INFO_H_
8#define ZEPHYR_INCLUDE_MODEM_INFO_H_
10#ifdef CONFIG_CJSON_LIB
29#define MODEM_INFO_MAX_RESPONSE_SIZE 100
32#define MODEM_INFO_JSON_STRING_SIZE 512
35#define RSRP_OFFSET_VAL 140
38#define RSRQ_OFFSET_VAL 19.5f
41#define RSRQ_SCALE_VAL 0.5f
44#define MODEM_INFO_FWVER_SIZE 41
47#define BAND_UNAVAILABLE 0
52#define MODEM_INFO_SHORT_OP_NAME_SIZE 65
55#define SNR_UNAVAILABLE 127
58#define SNR_OFFSET_VAL 24
64#define RSRP_IDX_TO_DBM(rsrp) ((rsrp) - RSRP_OFFSET_VAL)
66#define RSRQ_IDX_TO_DB(rsrq) ((((float)(rsrq)) * RSRQ_SCALE_VAL) - \
211 const size_t buf_size);
Store a list of AT command/response parameters.
at_param_type
Parameter types that can be stored.
Definition: at_params.h:37
#define MODEM_INFO_MAX_RESPONSE_SIZE
Definition: modem_info.h:29
int modem_info_get_fw_version(char *buf, size_t buf_size)
Obtain the short software identification.
int modem_info_get_current_band(uint8_t *val)
Obtain the current band.
int modem_info_name_get(enum modem_info info, char *name)
Request the name of a modem information data type.
int modem_info_get_fw_uuid(char *buf, size_t buf_size)
Obtain the UUID of the modem firmware build.
int modem_info_get_hw_version(char *buf, uint8_t buf_size)
Obtain the hardware version string.
int modem_info_params_get(struct modem_param_info *modem_param)
Obtain the modem parameters.
int modem_info_rsrp_register(rsrp_cb_t cb)
Initialize the subscription of RSRP values.
int modem_info_params_init(struct modem_param_info *modem_param)
Initialize the structure that stores modem information.
int modem_info_get_rsrp(int *val)
Obtain the RSRP.
int modem_info_init(void)
Initialize the modem information module.
int modem_info_short_get(enum modem_info info, uint16_t *buf)
Request the current modem status of any predefined information value as a short.
modem_info
LTE link information data.
Definition: modem_info.h:73
@ MODEM_INFO_IMSI
Definition: modem_info.h:92
@ MODEM_INFO_AREA_CODE
Definition: modem_info.h:77
@ MODEM_INFO_GPS_MODE
Definition: modem_info.h:91
@ MODEM_INFO_MCC
Definition: modem_info.h:80
@ MODEM_INFO_CUR_BAND
Definition: modem_info.h:75
@ MODEM_INFO_DATE_TIME
Definition: modem_info.h:94
@ MODEM_INFO_UE_MODE
Definition: modem_info.h:78
@ MODEM_INFO_NBIOT_MODE
Definition: modem_info.h:90
@ MODEM_INFO_IMEI
Definition: modem_info.h:93
@ MODEM_INFO_BATTERY
Definition: modem_info.h:85
@ MODEM_INFO_FW_VERSION
Definition: modem_info.h:87
@ MODEM_INFO_RSRP
Definition: modem_info.h:74
@ MODEM_INFO_COUNT
Definition: modem_info.h:96
@ MODEM_INFO_IP_ADDRESS
Definition: modem_info.h:83
@ MODEM_INFO_SUP_BAND
Definition: modem_info.h:76
@ MODEM_INFO_CELLID
Definition: modem_info.h:82
@ MODEM_INFO_APN
Definition: modem_info.h:95
@ MODEM_INFO_UICC
Definition: modem_info.h:84
@ MODEM_INFO_ICCID
Definition: modem_info.h:88
@ MODEM_INFO_TEMP
Definition: modem_info.h:86
@ MODEM_INFO_OPERATOR
Definition: modem_info.h:79
@ MODEM_INFO_LTE_MODE
Definition: modem_info.h:89
@ MODEM_INFO_MNC
Definition: modem_info.h:81
int modem_info_get_batt_voltage(int *val)
Obtain the battery voltage.
int modem_info_get_svn(char *buf, size_t buf_size)
Obtain the modem Software Version Number (SVN).
int modem_info_connectivity_stats_init(void)
Initialize collection of connectivity statistics.
int modem_info_connectivity_stats_disable(void)
Disable collection of connectivity statistics.
int modem_info_get_operator(char *buf, size_t buf_size)
Obtain the operator name.
void(* rsrp_cb_t)(char rsrp_value)
RSRP event handler function prototype.
Definition: modem_info.h:70
int modem_info_get_connectivity_stats(int *tx_kbytes, int *rx_kbytes)
Obtain the connectivity statistics.
int modem_info_get_temperature(int *val)
Obtain the internal temperature.
int modem_info_get_snr(int *val)
Obtain the signal-to-noise ratio.
int modem_info_string_get(enum modem_info info, char *buf, const size_t buf_size)
Request the current modem status of any predefined information value as a string.
enum at_param_type modem_info_type_get(enum modem_info info)
Request the data type of the current modem information type.
const char * app_version
Definition: modem_info.h:141
const char * app_name
Definition: modem_info.h:142
struct lte_param battery
Definition: modem_info.h:138
struct lte_param modem_fw
Definition: modem_info.h:137
struct lte_param imei
Definition: modem_info.h:139
const char * board
Definition: modem_info.h:140
Device parameters.
Definition: modem_info.h:136
uint16_t value
Definition: modem_info.h:101
char value_string[100]
Definition: modem_info.h:102
enum modem_info type
Definition: modem_info.h:104
char * data_name
Definition: modem_info.h:103
LTE parameter data.
Definition: modem_info.h:100
struct device_param device
Definition: modem_info.h:149
struct network_param network
Definition: modem_info.h:147
struct sim_param sim
Definition: modem_info.h:148
Modem parameters.
Definition: modem_info.h:146
struct lte_param current_band
Definition: modem_info.h:109
struct lte_param date_time
Definition: modem_info.h:121
struct lte_param lte_mode
Definition: modem_info.h:118
struct lte_param area_code
Definition: modem_info.h:111
struct lte_param ue_mode
Definition: modem_info.h:117
struct lte_param nbiot_mode
Definition: modem_info.h:119
struct lte_param mcc
Definition: modem_info.h:113
struct lte_param apn
Definition: modem_info.h:122
struct lte_param ip_address
Definition: modem_info.h:116
struct lte_param mnc
Definition: modem_info.h:114
struct lte_param cellid_hex
Definition: modem_info.h:115
struct lte_param current_operator
Definition: modem_info.h:112
struct lte_param rsrp
Definition: modem_info.h:123
double cellid_dec
Definition: modem_info.h:125
struct lte_param gps_mode
Definition: modem_info.h:120
struct lte_param sup_band
Definition: modem_info.h:110
Network parameters.
Definition: modem_info.h:108
struct lte_param imsi
Definition: modem_info.h:132
struct lte_param uicc
Definition: modem_info.h:130
struct lte_param iccid
Definition: modem_info.h:131
SIM card parameters.
Definition: modem_info.h:129