Skip to the content.

Network module

The Network module manages the cellular connectivity for applications running on nRF91 Series devices. It handles network connection states, system mode configuration, power saving configurations, and network quality monitoring. It utilizes the Zephyr network management APIs and the LTE Link Control library from nRF Connect SDK to control the modem and monitor network events. Internally, the module implements a state machine that uses Zephyr’s State Machine Framework.

The module is designed to by default search for a suitable network automatically on startup and then maintain the connection for the lifetime of the application. The library can also be configured to be fully controlled by the application instead, giving closer control over the LTE link and current consumption. See the Configurations section for more information.

Messages

The network module communicates via the zbus channel NETWORK_CHAN. The messages are defined in network.h. A message consists of a type and optional data. Each message is either an input message or an output message. All input messages are requests from the application to the network module. The output messages may be responses to input messages or notifications from the network module to the application.

The following messages are supported:

Input Messages

Output Messages

Message Structure

The network module uses the struct network_msg structure for communication:

struct network_msg {
    enum network_msg_type type;
    union {
        enum lte_lc_system_mode system_mode;
        struct lte_lc_psm_cfg psm_cfg;
        struct lte_lc_edrx_cfg edrx_cfg;
        struct lte_lc_conn_eval_params conn_eval_params;
    };
};

Configurations

Configurations

The Network module can be configured using the following Kconfig options:

State Diagram

The Network module implements a state machine with the following states and transitions:

stateDiagram-v2
    [*] --> STATE_RUNNING

    state STATE_RUNNING {
        [*] --> STATE_DISCONNECTED

        STATE_DISCONNECTED --> STATE_CONNECTED : NETWORK_CONNECTED
        STATE_CONNECTED --> STATE_DISCONNECTING : NETWORK_DISCONNECT
        STATE_DISCONNECTING --> STATE_DISCONNECTED_IDLE : NETWORK_DISCONNECTED

        state STATE_DISCONNECTED {
            [*] --> STATE_DISCONNECTED_SEARCHING

            STATE_DISCONNECTED_SEARCHING --> STATE_DISCONNECTED_IDLE : NETWORK_SEARCH_STOP/NETWORK_DISCONNECT
            STATE_DISCONNECTED_IDLE --> STATE_DISCONNECTED_SEARCHING : NETWORK_CONNECT
        }
    }