Skip to content

Commit

Permalink
modules: memfault: Report unkown operator if modem doesn't give one
Browse files Browse the repository at this point in the history
Set the Memfault metric `ncs_lte_operator` to "Not reported" when
the modem does not provide an operator name to the application.

Signed-off-by: Jan Tore Guggedal <[email protected]>
  • Loading branch information
jtguggedal authored and cvinayak committed Feb 7, 2024
1 parent b5fc73f commit 85fef3c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/memfault-firmware-sdk/memfault_lte_metrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,12 @@ void memfault_lte_metrics_update(void)

err = modem_info_get_operator(operator_name, sizeof(operator_name));
if (err != 0) {
LOG_WRN("Network operator collection failed, error: %d", err);
LOG_DBG("Network operator name was not reported by the modem");

err = MEMFAULT_METRIC_SET_STRING(ncs_lte_operator, "Not available");
if (err) {
LOG_ERR("Failed to set ncs_lte_operator");
}
} else {
err = MEMFAULT_METRIC_SET_STRING(ncs_lte_operator, operator_name);
if (err) {
Expand Down

0 comments on commit 85fef3c

Please sign in to comment.