Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate at_params, deprecate modem_info_type_get, add enum modem_info_data_type and modem_info_data_type_get #20497

Merged
merged 3 commits into from
Feb 24, 2025
Merged
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
3 changes: 3 additions & 0 deletions doc/nrf/libraries/modem/at_params.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ AT parameters
:local:
:depth: 2

.. important::
The AT parameters module is deprecated.

The AT parameters module provides functionality to store lists of AT command or respond parameters.
These lists can be used by other modules to write and read parameter values.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,8 @@ Security libraries
Modem libraries
---------------

* Deprecated the :ref:`at_params_readme` library.

* :ref:`pdn_readme` library:

* Deprecated the :c:func:`pdn_dynamic_params_get` function.
Expand Down Expand Up @@ -669,6 +671,15 @@ Modem libraries

* Fixed a bug where AT responses would erroneously be written to the logging UART instead of being written to the chosen ``ncs,at-host-uart`` UART device when the :kconfig:option:`CONFIG_LOG_BACKEND_UART` Kconfig option was set.

* :ref:`modem_info_readme` library:

* Added:

* 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
92 changes: 61 additions & 31 deletions include/modem/at_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#define AT_PARAMS_H__

#include <zephyr/types.h>
#include <zephyr/toolchain.h>

#ifdef __cplusplus
extern "C" {
Expand All @@ -18,6 +19,7 @@ extern "C" {
*
* @brief Store a list of AT command/response parameters.
* @defgroup at_params AT command/response parameters
* @deprecated
* @{
*
* A parameter list contains an array of parameters defined by a type,
Expand All @@ -33,7 +35,10 @@ extern "C" {
* to read and write parameter values.
*/

/** @brief Parameter types that can be stored. */
/**
* @deprecated
* @brief Parameter types that can be stored.
*/
enum at_param_type {
/** Invalid parameter, typically a parameter that does not exist. */
AT_PARAM_TYPE_INVALID,
Expand All @@ -47,7 +52,10 @@ enum at_param_type {
AT_PARAM_TYPE_EMPTY,
};

/** @brief Parameter value. */
/**
* @deprecated
* @brief Parameter value.
*/
union at_param_value {
/** Integer value. */
int64_t int_val;
Expand All @@ -57,14 +65,18 @@ union at_param_value {
uint32_t *array_val;
};

/** @brief A parameter is defined with a type, length and value. */
/**
* @deprecated
* @brief A parameter is defined with a type, length and value.
*/
struct at_param {
enum at_param_type type;
size_t size;
union at_param_value value;
};

/**
* @deprecated
* @brief List of AT parameters that compose an AT command or response.
*
* Contains an array of opaque data. Setter and getter methods should be used
Expand All @@ -76,6 +88,7 @@ struct at_param_list {
};

/**
* @deprecated
* @brief Create a list of parameters.
*
* An array of @p max_params_count is allocated. Each parameter is
Expand All @@ -89,27 +102,30 @@ struct at_param_list {
* @retval 0 If the operation was successful.
* Otherwise, a (negative) error code is returned.
*/
int at_params_list_init(struct at_param_list *list, size_t max_params_count);
__deprecated int at_params_list_init(struct at_param_list *list, size_t max_params_count);

/**
* @deprecated
* @brief Clear/reset all parameter types and values.
*
* All parameter types and values are reset to default values.
*
* @param[in] list Parameter list to clear.
*/
void at_params_list_clear(struct at_param_list *list);
__deprecated void at_params_list_clear(struct at_param_list *list);

/**
* @deprecated
* @brief Free a list of parameters.
*
* First the list is cleared. Then the list and its elements are deleted.
*
* @param[in] list Parameter list to free.
*/
void at_params_list_free(struct at_param_list *list);
__deprecated void at_params_list_free(struct at_param_list *list);

/**
* @deprecated
* @brief Add a parameter in the list at the specified index and assign it an
* integer value.
*
Expand All @@ -122,9 +138,10 @@ void at_params_list_free(struct at_param_list *list);
* @retval 0 If the operation was successful.
* Otherwise, a (negative) error code is returned.
*/
int at_params_int_put(const struct at_param_list *list, size_t index, int64_t value);
__deprecated int at_params_int_put(const struct at_param_list *list, size_t index, int64_t value);

/**
* @deprecated
* @brief Add a parameter in the list at the specified index and assign it a
* string value.
*
Expand All @@ -139,10 +156,11 @@ int at_params_int_put(const struct at_param_list *list, size_t index, int64_t va
* @retval 0 If the operation was successful.
* Otherwise, a (negative) error code is returned.
*/
int at_params_string_put(const struct at_param_list *list, size_t index,
const char *str, size_t str_len);
__deprecated int at_params_string_put(const struct at_param_list *list, size_t index,
const char *str, size_t str_len);

/**
* @deprecated
* @brief Add a parameter in the list at the specified index and assign it an
* array type value.
*
Expand All @@ -161,10 +179,11 @@ int at_params_string_put(const struct at_param_list *list, size_t index,
* @retval 0 If the operation was successful.
* Otherwise, a (negative) error code is returned.
*/
int at_params_array_put(const struct at_param_list *list, size_t index,
const uint32_t *array, size_t array_len);
__deprecated int at_params_array_put(const struct at_param_list *list, size_t index,
const uint32_t *array, size_t array_len);

/**
* @deprecated
* @brief Add a parameter in the list at the specified index and assign it an
* empty status.
*
Expand All @@ -177,9 +196,10 @@ int at_params_array_put(const struct at_param_list *list, size_t index,
* @retval 0 If the operation was successful.
* Otherwise, a (negative) error code is returned.
*/
int at_params_empty_put(const struct at_param_list *list, size_t index);
__deprecated int at_params_empty_put(const struct at_param_list *list, size_t index);

/**
* @deprecated
* @brief Get the size of a given parameter (in bytes).
*
* A size of '0' is returned for invalid and empty parameters.
Expand All @@ -191,10 +211,10 @@ int at_params_empty_put(const struct at_param_list *list, size_t index);
* @retval 0 If the operation was successful.
* Otherwise, a (negative) error code is returned.
*/
int at_params_size_get(const struct at_param_list *list, size_t index,
size_t *len);
__deprecated int at_params_size_get(const struct at_param_list *list, size_t index, size_t *len);

/**
* @deprecated
* @brief Get a parameter value as a short number.
*
* @param[in] list Parameter list.
Expand All @@ -204,10 +224,11 @@ int at_params_size_get(const struct at_param_list *list, size_t index,
* @retval 0 If the operation was successful.
* Otherwise, a (negative) error code is returned.
*/
int at_params_short_get(const struct at_param_list *list, size_t index,
int16_t *value);
__deprecated int at_params_short_get(const struct at_param_list *list, size_t index,
int16_t *value);

/**
* @deprecated
* @brief Get a parameter value as an unsigned short number.
*
* @param[in] list Parameter list.
Expand All @@ -217,10 +238,11 @@ int at_params_short_get(const struct at_param_list *list, size_t index,
* @retval 0 If the operation was successful.
* Otherwise, a (negative) error code is returned.
*/
int at_params_unsigned_short_get(const struct at_param_list *list, size_t index,
uint16_t *value);
__deprecated int at_params_unsigned_short_get(const struct at_param_list *list, size_t index,
uint16_t *value);

/**
* @deprecated
* @brief Get a parameter value as an integer number.
*
* @param[in] list Parameter list.
Expand All @@ -230,10 +252,11 @@ int at_params_unsigned_short_get(const struct at_param_list *list, size_t index,
* @retval 0 If the operation was successful.
* Otherwise, a (negative) error code is returned.
*/
int at_params_int_get(const struct at_param_list *list, size_t index,
int32_t *value);
__deprecated int at_params_int_get(const struct at_param_list *list, size_t index,
int32_t *value);

/**
* @deprecated
* @brief Get a parameter value as an unsigned integer number.
*
* @param[in] list Parameter list.
Expand All @@ -243,9 +266,11 @@ int at_params_int_get(const struct at_param_list *list, size_t index,
* @retval 0 If the operation was successful.
* Otherwise, a (negative) error code is returned.
*/
int at_params_unsigned_int_get(const struct at_param_list *list, size_t index, uint32_t *value);
__deprecated int at_params_unsigned_int_get(const struct at_param_list *list, size_t index,
uint32_t *value);

/**
* @deprecated
* @brief Get a parameter value as a signed 64-bit integer number.
*
* @param[in] list Parameter list.
Expand All @@ -255,9 +280,11 @@ int at_params_unsigned_int_get(const struct at_param_list *list, size_t index, u
* @retval 0 If the operation was successful.
* Otherwise, a (negative) error code is returned.
*/
int at_params_int64_get(const struct at_param_list *list, size_t index, int64_t *value);
__deprecated int at_params_int64_get(const struct at_param_list *list, size_t index,
int64_t *value);

/**
* @deprecated
* @brief Get a parameter value as a string.
*
* The parameter type must be a string, or an error is returned.
Expand All @@ -274,10 +301,11 @@ int at_params_int64_get(const struct at_param_list *list, size_t index, int64_t
* @retval 0 If the operation was successful.
* Otherwise, a (negative) error code is returned.
*/
int at_params_string_get(const struct at_param_list *list, size_t index,
char *value, size_t *len);
__deprecated int at_params_string_get(const struct at_param_list *list, size_t index,
char *value, size_t *len);

/**
* @deprecated
* @brief Get a pointer to the string parameter value.
*
* The parameter type must be a string, or an error is returned.
Expand All @@ -292,10 +320,11 @@ int at_params_string_get(const struct at_param_list *list, size_t index,
* @retval 0 If the operation was successful.
* Otherwise, a (negative) error code is returned.
*/
int at_params_string_ptr_get(const struct at_param_list *list, size_t index, const char **at_param,
size_t *len);
__deprecated int at_params_string_ptr_get(const struct at_param_list *list, size_t index,
const char **at_param, size_t *len);

/**
* @deprecated
* @brief Get a parameter value as an array.
*
* The parameter type must be an array, or an error is returned.
Expand All @@ -312,28 +341,29 @@ int at_params_string_ptr_get(const struct at_param_list *list, size_t index, con
* @retval 0 If the operation was successful.
* Otherwise, a (negative) error code is returned.
*/
int at_params_array_get(const struct at_param_list *list, size_t index,
uint32_t *array, size_t *len);
__deprecated int at_params_array_get(const struct at_param_list *list, size_t index,
uint32_t *array, size_t *len);

/**
* @deprecated
* @brief Get the number of valid parameters in the list.
*
* @param[in] list Parameter list.
*
* @return The number of valid parameters until an empty parameter is found.
*/
uint32_t at_params_valid_count_get(const struct at_param_list *list);
__deprecated uint32_t at_params_valid_count_get(const struct at_param_list *list);

/**
* @deprecated
* @brief Get parameter type for parameter at index
*
* @param[in] list Parameter list.
* @param[in] index Parameter index in the list.
*
* @return Return parameter type of @ref at_param_type.
*/
enum at_param_type at_params_type_get(const struct at_param_list *list,
size_t index);
__deprecated enum at_param_type at_params_type_get(const struct at_param_list *list, size_t index);

/** @} */

Expand Down
28 changes: 26 additions & 2 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 @@ -151,6 +153,16 @@ enum modem_info {
MODEM_INFO_COUNT, /**< Number of legal elements in the enum. */
};

/** @brief LTE link information data types. */
enum modem_info_data_type {
/** Data of type invalid. */
MODEM_INFO_DATA_TYPE_INVALID,
/** Data of type integer. */
MODEM_INFO_DATA_TYPE_NUM_INT,
/** Data of type string. */
MODEM_INFO_DATA_TYPE_STRING,
};

/**@brief LTE parameter data. **/
struct lte_param {
uint16_t value; /**< The retrieved value. */
Expand Down Expand Up @@ -288,15 +300,27 @@ int modem_info_short_get(enum modem_info info, uint16_t *buf);
*/
int modem_info_name_get(enum modem_info info, char *name);

/**
* @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.
*/
__deprecated enum at_param_type modem_info_type_get(enum modem_info info);

/** @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);
enum modem_info_data_type modem_info_data_type_get(enum modem_info info);

/** @brief Obtain the modem parameters.
*
Expand Down
Loading