Skip to content

Commit 5e81225

Browse files
committed
app: Remove CONFIG_SM_AT_MAX_PARAM
CONFIG_SM_AT_MAX_PARAM (or CONFIG_SLM_AT_MAX_PARAM) is not useful anymore after AT command parser and AT params libraries were replaced by new AT parser library. This Kconfig was passed to at_params_list_init(). It was also used by some commands (#XNRFCLOUDPOS) for maximum number of parameters but now those are only restricted by CONFIG_SM_AT_BUF_SIZE. Signed-off-by: Tommi Rantanen <tommi.rantanen@nordicsemi.no>
1 parent 3c00d12 commit 5e81225

5 files changed

Lines changed: 12 additions & 16 deletions

File tree

app/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ config SM_CUSTOMER_VERSION
1313
help
1414
This version is reported together with baseline versions by AT command "#XSMVER".
1515

16-
config SM_AT_MAX_PARAM
17-
int "Maximum number of parameters in AT command"
18-
default 42
19-
2016
config SM_AT_BUF_SIZE
2117
int "AT command buffer size"
2218
range 128 8192

app/src/sm_at_nrfcloud.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,14 @@ static struct k_work nrfcloud_loc_req;
5555
* [,<n_earfcn>2, <n_phys_cell_id>2, <n_rsrp>2, <n_rsrq>2,<time_diff>2] ...
5656
* [,<n_earfcn>17, <n_phys_cell_id>17, <n_rsrp>17, <n_rsrq>17,<time_diff>17
5757
*
58-
* Max 17 ncell, but align with CONFIG_SM_AT_MAX_PARAM
58+
* Max 17 ncell
5959
* 11 number of parameters for current cell (including "%NCELLMEAS")
6060
* 5 number of parameters for one neighboring cell
6161
*/
6262
#define MAX_PARAM_CELL 11
6363
#define MAX_PARAM_NCELL 5
64-
/* Must support at least all params for current cell plus one ncell */
65-
#define NCELL_CNT ((CONFIG_SM_AT_MAX_PARAM - MAX_PARAM_CELL) / MAX_PARAM_NCELL)
66-
BUILD_ASSERT(NCELL_CNT > 0, "CONFIG_SM_AT_MAX_PARAM too small");
64+
/* Neighbor cells are not very useful for positioning so we don't need to support 10 or 17 */
65+
#define NCELL_CNT 5
6766

6867
/* Neighboring cell measurements. */
6968
static struct lte_lc_ncell nrfcloud_ncells[NCELL_CNT];
@@ -76,8 +75,6 @@ static struct lte_lc_cells_info nrfcloud_cell_data = {
7675
static bool nrfcloud_ncellmeas_done;
7776

7877
#define WIFI_APS_BEGIN_IDX 3
79-
BUILD_ASSERT(WIFI_APS_BEGIN_IDX + NRF_CLOUD_LOCATION_WIFI_AP_CNT_MIN
80-
< CONFIG_SM_AT_MAX_PARAM, "CONFIG_SM_AT_MAX_PARAM too small");
8178

8279
/* nRF Cloud location request Wi-Fi data. */
8380
static struct wifi_scan_info nrfcloud_wifi_data;
@@ -202,6 +199,12 @@ static void ncell_meas_mon(const char *notify)
202199
for (unsigned int i = 0; i != ncells_count; ++i) {
203200
const unsigned int offset = MAX_PARAM_CELL + i * MAX_PARAM_NCELL;
204201

202+
if (i >= NCELL_CNT) {
203+
LOG_INF("Too many neighboring cells (%d) for allocated buffer (%d)",
204+
i, NCELL_CNT);
205+
break;
206+
}
207+
205208
/* parse n_earfcn */
206209
err = at_parser_num_get(&parser, offset, &nrfcloud_ncells[i].earfcn);
207210
if (err < 0) {

doc/app/at_nrfcloud.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ The ``<wifi_pos>`` parameter can have the following integer values:
222222
* ``0`` - Do not include Wi-Fi access point information in the location request.
223223
* ``1`` - Use Wi-Fi access point information.
224224
The access points must be given as additional parameters to the command.
225-
The minimum number of access points to provide is two (``NRF_CLOUD_LOCATION_WIFI_AP_CNT_MIN``), and the maximum is limited by the AT command parameter count limit (:ref:`CONFIG_SM_AT_MAX_PARAM <CONFIG_SM_AT_MAX_PARAM>`).
225+
The minimum number of access points to provide is two (``NRF_CLOUD_LOCATION_WIFI_AP_CNT_MIN``), and the maximum is limited by the AT command buffer size (:ref:`CONFIG_SM_AT_BUF_SIZE <CONFIG_SM_AT_BUF_SIZE>`).
226226

227227
The ``<MAC x>`` parameter is a string.
228228
It indicates the MAC address of a Wi-Fi access point and must be formatted as ``%02x:%02x:%02x:%02x:%02x:%02x`` (``WIFI_MAC_ADDR_TEMPLATE``).

doc/app/sm_configuration.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ CONFIG_SM_CUSTOMER_VERSION - Customer version string
2020
Version string defined by the customer after customizing the application.
2121
When defined, this version is reported with the baseline versions by the ``AT#XSMVER`` AT command.
2222

23-
.. _CONFIG_SM_AT_MAX_PARAM:
24-
25-
CONFIG_SM_AT_MAX_PARAM - AT command parameter count limit
26-
This defines the maximum number of parameters allowed in an AT command, including the command name.
27-
2823
.. _CONFIG_SM_AT_BUF_SIZE:
2924

3025
CONFIG_SM_AT_BUF_SIZE - AT command buffer size

doc/migration_notes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,3 +417,5 @@ If you need any of those features with this |SM|, please contact customer suppor
417417
Use the ``CONFIG_SM_AUTO_CONNECT*`` Kconfig options to configure automatic network attach.
418418
* The ``CONFIG_SM_SKIP_READY_MSG`` Kconfig option.
419419
The ``Ready\r\n`` message is always sent when the |SM| application is ready to accept AT commands.
420+
* The ``CONFIG_SM_AT_MAX_PARAM`` Kconfig option.
421+
This Kconfig option has not been relevant in the latest versions of |NCS| SLM, as the AT parser library is now used.

0 commit comments

Comments
 (0)