Skip to content

Commit 8e72e17

Browse files
committed
lib: lte_link_control: Add support for band list in LTE band lock
Added the CONFIG_LTE_LOCK_BAND_LIST Kconfig option for configuring LTE band lock using a list of band numbers. This can be used alone or combined with CONFIG_LTE_LOCK_BAND_MASK, which takes a bit string of enabled bands. Removed default value from the CONFIG_LTE_LOCK_BAND_MASK Kconfig option. When LTE band lock is enabled using CONFIG_LTE_LOCK_BANDS, also the bands need to be explicitly configured. It makes no sense to have a default list of bands which are enabled. Signed-off-by: Tommi Kangas <[email protected]>
1 parent 18ee80d commit 8e72e17

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed

doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,12 @@ Modem libraries
430430

431431
* :ref:`lte_lc_readme` library:
432432

433-
* Added support for new PDN events :c:enumerator:`LTE_LC_EVT_PDN_SUSPENDED` and :c:enumerator:`LTE_LC_EVT_PDN_RESUMED`.
433+
* Added:
434+
435+
* Support for new PDN events :c:enumerator:`LTE_LC_EVT_PDN_SUSPENDED` and :c:enumerator:`LTE_LC_EVT_PDN_RESUMED`.
436+
* 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.
437+
438+
* Removed the default value for the :kconfig:option:`CONFIG_LTE_LOCK_BAND_MASK` Kconfig option.
434439

435440
Multiprotocol Service Layer libraries
436441
-------------------------------------

lib/lte_link_control/Kconfig

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,28 @@ config LTE_SHELL
114114
config LTE_LOCK_BANDS
115115
bool "LTE band lock"
116116
help
117-
Enable LTE band lock. Bands not enabled in LTE_LOCK_BAND_MASK
118-
are not used when this setting is enabled.
117+
Enable LTE band lock. Only configured bands are used when this setting is enabled.
118+
The allowed bands can be configured using the CONFIG_LTE_LOCK_BAND_MASK and
119+
CONFIG_LTE_LOCK_BAND_LIST options. If both are configured, the bands are combined
120+
from both options.
119121

120122
if LTE_LOCK_BANDS
123+
121124
config LTE_LOCK_BAND_MASK
122125
string "LTE band lock mask bit string"
123-
default "10000001000000001100"
124126
help
125-
Bit string of enabled bands. LSB is band 1. Leading zeroes
126-
can be omitted. The maximum length is 88 characters.
127+
Bit string of enabled bands. LSB is band 1. Leading zeroes can be omitted.
128+
The maximum length is 88 characters, meaning this can be used with band numbers up to 88.
129+
130+
config LTE_LOCK_BAND_LIST
131+
string "LTE band list"
132+
help
133+
List of enabled bands. Comma-separated list of band numbers.
134+
Can be used with all valid band numbers, including bands over 88.
135+
This is only supported by the following modem firmware:
136+
- mfw_nrf91x1 v2.0.3 or later
137+
- mfw_nrf9151-ntn
138+
127139
endif # LTE_LOCK_BANDS
128140

129141
config LTE_PLMN_SELECTION_OPTIMIZATION

lib/lte_link_control/lte_lc_modem_hooks.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,22 @@
1717
LOG_MODULE_DECLARE(lte_lc, CONFIG_LTE_LINK_CONTROL_LOG_LEVEL);
1818

1919
#if defined(CONFIG_LTE_LOCK_BANDS)
20+
BUILD_ASSERT(sizeof(CONFIG_LTE_LOCK_BAND_MASK) > 1 || sizeof(CONFIG_LTE_LOCK_BAND_LIST) > 1,
21+
"CONFIG_LTE_LOCK_BAND_MASK or CONFIG_LTE_LOCK_BAND_LIST must be set");
2022
static void band_lock_set(void)
2123
{
2224
int err;
2325

2426
/* Set LTE band lock (volatile setting).
2527
* Has to be done every time before activating the modem.
2628
*/
27-
err = nrf_modem_at_printf("AT%%XBANDLOCK=2,\""CONFIG_LTE_LOCK_BAND_MASK "\"");
29+
if (sizeof(CONFIG_LTE_LOCK_BAND_LIST) > 1) {
30+
err = nrf_modem_at_printf("AT%%XBANDLOCK=2,\"" CONFIG_LTE_LOCK_BAND_MASK "\",\""
31+
CONFIG_LTE_LOCK_BAND_LIST "\"");
32+
} else {
33+
err = nrf_modem_at_printf("AT%%XBANDLOCK=2,\"" CONFIG_LTE_LOCK_BAND_MASK "\"");
34+
}
35+
2836
if (err) {
2937
LOG_ERR("Failed to lock LTE bands, err %d", err);
3038
}

0 commit comments

Comments
 (0)