Skip to content

Commit dacc54e

Browse files
committed
modules: network: Add option to start module in disconnected idle
Add the option to start the module without searching for network immediately. Signed-off-by: Jan Tore Guggedal <jantore.guggedal@nordicsemi.no>
1 parent 57d0e6d commit dacc54e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

app/src/modules/network/Kconfig.network

+7
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ config APP_NETWORK_EXEC_TIME_SECONDS_MAX
2121
help
2222
Maximum time allowed for a single execution of the module's thread loop.
2323

24+
config APP_NETWORK_SEARCH_NETWORK_ON_STARTUP
25+
bool "Search for network on startup"
26+
default y
27+
help
28+
If enabled, the module will search for a network on startup.
29+
If disabled, network search must be triggered by a NETWORK_CONNECT message.
30+
2431
module = APP_NETWORK
2532
module-str = Network
2633
source "subsys/logging/Kconfig.template.log_config"

app/src/modules/network/network.c

+4
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ static const struct smf_state states[] = {
112112
[STATE_DISCONNECTED] =
113113
SMF_CREATE_STATE(state_disconnected_entry, state_disconnected_run, NULL,
114114
&states[STATE_RUNNING],
115+
#if defined(CONFIG_APP_NETWORK_SEARCH_NETWORK_ON_STARTUP)
115116
&states[STATE_DISCONNECTED_SEARCHING]),
117+
#else
118+
&states[STATE_DISCONNECTED_IDLE]),
119+
#endif /* CONFIG_APP_NETWORK_SEARCH_NETWORK_ON_STARTUP */
116120
[STATE_DISCONNECTED_IDLE] =
117121
SMF_CREATE_STATE(NULL, state_disconnected_idle_run, NULL,
118122
&states[STATE_DISCONNECTED],

0 commit comments

Comments
 (0)