Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,12 @@ Modem libraries

* :ref:`lte_lc_readme` library:

* Added support for new PDN events :c:enumerator:`LTE_LC_EVT_PDN_SUSPENDED` and :c:enumerator:`LTE_LC_EVT_PDN_RESUMED`.
* Added:

* Support for new PDN events :c:enumerator:`LTE_LC_EVT_PDN_SUSPENDED` and :c:enumerator:`LTE_LC_EVT_PDN_RESUMED`.
* The :kconfig:option:`CONFIG_LTE_LOCK_BAND_LIST` Kconfig option to set bands for the LTE band lock using a comma-separated list of band numbers.

* Removed the default value for the :kconfig:option:`CONFIG_LTE_LOCK_BAND_MASK` Kconfig option.

Multiprotocol Service Layer libraries
-------------------------------------
Expand Down
22 changes: 17 additions & 5 deletions lib/lte_link_control/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,28 @@ config LTE_SHELL
config LTE_LOCK_BANDS
bool "LTE band lock"
help
Enable LTE band lock. Bands not enabled in LTE_LOCK_BAND_MASK
are not used when this setting is enabled.
Enable LTE band lock. Only configured bands are used when this setting is enabled.
The allowed bands can be configured using the CONFIG_LTE_LOCK_BAND_MASK and
CONFIG_LTE_LOCK_BAND_LIST options. If both are configured, the bands are combined
from both options.

if LTE_LOCK_BANDS

config LTE_LOCK_BAND_MASK
string "LTE band lock mask bit string"
default "10000001000000001100"
help
Bit string of enabled bands. LSB is band 1. Leading zeroes
can be omitted. The maximum length is 88 characters.
Bit string of enabled bands. LSB is band 1. Leading zeroes can be omitted.
The maximum length is 88 characters, meaning this can be used with band numbers up to 88.

config LTE_LOCK_BAND_LIST
string "LTE band list"
help
List of enabled bands. Comma-separated list of band numbers.
Can be used with all valid band numbers, including bands over 88.
This is only supported by the following modem firmware:
- mfw_nrf91x1 v2.0.3 or later
- mfw_nrf9151-ntn

endif # LTE_LOCK_BANDS

config LTE_PLMN_SELECTION_OPTIMIZATION
Expand Down
10 changes: 9 additions & 1 deletion lib/lte_link_control/lte_lc_modem_hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,22 @@
LOG_MODULE_DECLARE(lte_lc, CONFIG_LTE_LINK_CONTROL_LOG_LEVEL);

#if defined(CONFIG_LTE_LOCK_BANDS)
BUILD_ASSERT(sizeof(CONFIG_LTE_LOCK_BAND_MASK) > 1 || sizeof(CONFIG_LTE_LOCK_BAND_LIST) > 1,
"CONFIG_LTE_LOCK_BAND_MASK or CONFIG_LTE_LOCK_BAND_LIST must be set");
static void band_lock_set(void)
{
int err;

/* Set LTE band lock (volatile setting).
* Has to be done every time before activating the modem.
*/
err = nrf_modem_at_printf("AT%%XBANDLOCK=2,\""CONFIG_LTE_LOCK_BAND_MASK "\"");
if (sizeof(CONFIG_LTE_LOCK_BAND_LIST) > 1) {
err = nrf_modem_at_printf("AT%%XBANDLOCK=2,\"" CONFIG_LTE_LOCK_BAND_MASK "\",\""
CONFIG_LTE_LOCK_BAND_LIST "\"");
} else {
err = nrf_modem_at_printf("AT%%XBANDLOCK=2,\"" CONFIG_LTE_LOCK_BAND_MASK "\"");
}

if (err) {
LOG_ERR("Failed to lock LTE bands, err %d", err);
}
Expand Down