Skip to content

Commit 17b5795

Browse files
petrosyan-vancfriedt
authored andcommitted
drivers: modem_cellular: make APN configurable at run-time
* Implement the new cellular_set_apn() driver hook. The API validates the string, stores it in the driver’s private data and raises an internal event so the state machine can resume. * Insert MODEM_CELLULAR_STATE_WAIT_FOR_APN between DLCI2 open and the APN-script step. – If CONFIG_MODEM_CELLULAR_APN is defined and non-empty the driver skips WAIT_FOR_APN (behaves exactly as before). – Otherwise the driver parks in WAIT_FOR_APN until the application calls cellular_set_apn(). * Add event-callback support (CELLULAR_EVENT_MODEM_INFO_CHANGED) so an app can subscribe to IMSI availability and kick its own APN selection logic. Signed-off-by: Van Petrosyan <[email protected]>
1 parent 0a444c6 commit 17b5795

File tree

2 files changed

+271
-47
lines changed

2 files changed

+271
-47
lines changed

drivers/modem/Kconfig.cellular

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ config MODEM_CELLULAR
4040
if MODEM_CELLULAR
4141

4242
config MODEM_CELLULAR_APN
43-
string "APN"
43+
string "Static APN"
4444
default "internet"
45+
help
46+
If left empty the driver will wait for the application to call
47+
cellular_set_apn() before it proceeds to the dial phase.
4548

4649
config MODEM_CELLULAR_PERIODIC_SCRIPT_MS
4750
int "Periodic script interval in milliseconds"

0 commit comments

Comments
 (0)