drivers: modem: implement operator id and cell info

Implement numerical network operator id, location area code (LAC)
and cell id in modem context and modem shell.

Please note that the functionality to query these values must be
implemented in the modem driver.

Signed-off-by: Hans Wilmers <hans@wilmers.no>
This commit is contained in:
Hans Wilmers 2021-06-09 13:28:21 +02:00 committed by Carles Cufí
commit 120b2165ec
3 changed files with 22 additions and 1 deletions

View file

@ -132,6 +132,11 @@ config MODEM_SIM_NUMBERS
Query the SIM card for the IMSI and ICCID identifiers. This
can be disabled if the application does not use a SIM.
config MODEM_CELL_INFO
bool "Enable querying for operator and cell info"
depends on MODEM_SHELL
help
Query for numerical operator id, location area code and cell id.
source "drivers/modem/Kconfig.ublox-sara-r4"
source "drivers/modem/Kconfig.quectel-bg9x"

View file

@ -65,6 +65,11 @@ struct modem_context {
#if defined(CONFIG_MODEM_SIM_NUMBERS)
char *data_imsi;
char *data_iccid;
#endif
#if defined(CONFIG_MODEM_CELL_INFO)
int data_operator;
int data_lac;
int data_cellid;
#endif
int data_rssi;

View file

@ -67,7 +67,13 @@ static int cmd_modem_list(const struct shell *shell, size_t argc,
"\tIMSI: %s\n"
"\tICCID: %s\n"
#endif
"\tRSSI: %d\n", i,
#if defined(CONFIG_MODEM_CELL_INFO)
"\tOperator: %d\n"
"\tLAC: %d\n"
"\tCellId: %d\n"
#endif
"\tRSSI: %d\n",
i,
UART_DEV_NAME(mdm_ctx),
mdm_ctx->data_manufacturer,
mdm_ctx->data_model,
@ -76,6 +82,11 @@ static int cmd_modem_list(const struct shell *shell, size_t argc,
#if defined(CONFIG_MODEM_SIM_NUMBERS)
mdm_ctx->data_imsi,
mdm_ctx->data_iccid,
#endif
#if defined(CONFIG_MODEM_CELL_INFO)
mdm_ctx->data_operator,
mdm_ctx->data_lac,
mdm_ctx->data_cellid,
#endif
mdm_ctx->data_rssi);
}