Skip to content

Commit

Permalink
lib: modem_info: deprecate modem_info_type_get
Browse files Browse the repository at this point in the history
Deprecates the `modem_info_type_get` function
in favor of the `modem_info_data_type_get` function.

Signed-off-by: Mirko Covizzi <[email protected]>
  • Loading branch information
MirkoCovizzi authored and nordicjm committed Feb 24, 2025
1 parent c4691cb commit 4c5b0f4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,8 @@ Modem libraries
* The :c:enum:`modem_info_data_type` type for representing LTE link information data types.
* The :c:func:`modem_info_data_type_get` function for requesting the data type of the current modem information type.

* Deprecated the :c:func:`modem_info_type_get` function in favor of the :c:func:`modem_info_data_type_get` function.

Multiprotocol Service Layer libraries
-------------------------------------

Expand Down
11 changes: 8 additions & 3 deletions include/modem/modem_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#endif

#include <modem/at_params.h>
/* Include to use the __deprecated attribute */
#include <zephyr/toolchain.h>

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -298,15 +300,18 @@ int modem_info_short_get(enum modem_info info, uint16_t *buf);
*/
int modem_info_name_get(enum modem_info info, char *name);

/** @brief Request the data type of the current modem information
* type.
/**
* @deprecated Use @ref modem_info_data_type_get instead.
*
* @brief Request the data type of the current modem information
* type.
*
* @param info The requested information type.
*
* @return The data type of the requested modem information data.
* Otherwise, a (negative) error code is returned.
*/
enum at_param_type modem_info_type_get(enum modem_info info);
__deprecated enum at_param_type modem_info_type_get(enum modem_info info);

/** @brief Request the data type of the current modem information
* type.
Expand Down
1 change: 1 addition & 0 deletions lib/modem_info/modem_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ static int map_nrf_modem_at_scanf_error(int err)
}
}

/* Deprecated in favor of `modem_info_data_type_get`. */
enum at_param_type modem_info_type_get(enum modem_info info_type)
{
if (info_type >= MODEM_INFO_COUNT) {
Expand Down
3 changes: 2 additions & 1 deletion tests/subsys/net/lib/nrf_provisioning/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/modem/lte_lc.h
WORD_EXCLUDE "__deprecated")
cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/modem/modem_key_mgmt.h)
cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/modem/modem_attest_token.h)
cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/modem/modem_info.h)
cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/modem/modem_info.h
WORD_EXCLUDE "__deprecated")
cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/modem/nrf_modem_lib.h)
cmock_handle(${ZEPHYR_BASE}/include/zephyr/settings/settings.h)
cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/subsys/net/lib/nrf_provisioning/include/nrf_provisioning_at.h)
Expand Down

0 comments on commit 4c5b0f4

Please sign in to comment.