Networking¶
This guide covers the interfaces that are available on the Librem 5 (USB, Wi-Fi, Bluetooth, cellular) and discusses how each of them are used for network communication. In addition, it describes various tasks that applications may need to perform, such as checking for network availability.
Contents
Network Interfaces¶
The Librem 5 has a number of different interfaces that enable data communication with external networks and devices. These all allow network protocols to be used for communication and are managed using standard tools and frameworks (NetworkManager and ModemManager). As a result, application developers do not need to know about the precise mechanisms used to manage them, but may need to know how to request access to each type of network interface.
The use of an Ethernet port, available only on the Librem 5 developer board, is covered in the Ethernet Connection section of the Librem 5 Development Kit documentation.
Wireless (Wi-Fi)¶
Wireless networking is configured and enabled using the GNOME Control Center application.
When wireless networking is enabled, applications will be able to access it without any further configuration as long as they have requested permission to access the network in general. For applications distributed as flatpaks, this is achieved by specifying the --share=network
permission in the manifest file. See the Application Permissions guide for details.
Lower level information about configuring wireless networking is given in the Wireless Networking section of the Librem 5 Development Kit documentation.
USB¶
Note
It is expected that USB networking will be configured by a system component that exposes a general networking interface to applications. This section will be revised and updated with more details later.
Lower level information about configuring USB networking is given in the Ethernet over USB section of the Librem 5 Development Kit documentation.
Common Tasks¶
There are a number of common tasks that network-aware applications may need to perform.
Checking Network State¶
Since the network interfaces are managed by a common framework, it is possible to obtain information about network availability and any limitations on network usage.
The Network State example shows how to access these kinds of information, showing the level of access to the network, availability of the network, and whether the connection is metered.
This information is obtained using methods of the Gio.NetworkMonitor class.
Although the application may request full network access, the system may limit the connectivity in some way depending on the user’s preferences.