Skip to content
Commit 422fdf46 authored by Van Petrosyan's avatar Van Petrosyan Committed by Chris Friedt
Browse files

samples: modem_cellular: add auto-APN detection and race-free DNS wait



This update makes the cellular-modem sample usable out-of-the-box on
SIMs that require different APNs, without rebuilding the firmware.

* Automatic APN selection
  * New Kconfig options
    * `CONFIG_SAMPLE_CELLULAR_MODEM_AUTO_APN` - enable logic
    * `CONFIG_SAMPLE_CELLULAR_APN_X` - APN for profile X
    * `CONFIG_SAMPLE_CELLULAR_IMSI_LIST_X` - IMSI list for profile X
  * The application now subscribes to the new
    `CELLULAR_EVENT_MODEM_INFO_CHANGED` event, waits for the IMSI, looks
    up the matching MCC+MNC and calls `cellular_set_apn()`.

* DNS-server detection
  * `NET_EVENT_DNS_SERVER_ADD` may fire together with
    `NET_EVENT_L4_CONNECTED`; the previous wait timed out.
  * Replaced the two consecutive waits with a single call that waits for
    both events (`DNS_SERVER_ADD | L4_CONNECTED`) in any order.

Signed-off-by: default avatarVan Petrosyan <van.petrosyan@sensirion.com>
parent 17b57957
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment