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:
Van Petrosyan <van.petrosyan@sensirion.com>
Loading
Please sign in to comment