From 11aacd2d3f468efea8a0095b5a06097d2475bba7 Mon Sep 17 00:00:00 2001 From: Markus Rekdal Date: Fri, 31 Oct 2025 14:17:46 +0100 Subject: [PATCH] lib: pdn: Remove deprecated function Remove the deprecated pdn_dynamic_params_get function Signed-off-by: Markus Rekdal --- .../releases/release-notes-changelog.rst | 3 ++ include/modem/pdn.h | 15 ------- lib/pdn/pdn.c | 45 ------------------- 3 files changed, 3 insertions(+), 60 deletions(-) diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst index 1606d8485f4c..e95672fd2f26 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -743,6 +743,9 @@ Modem libraries * An issue where wrong APN rate control event was sent. * An issue where a malformed +CGEV notification was not handled correctly. + * Removed the deprecated ``pdn_dynamic_params_get()`` function. + Use the :c:func:`pdn_dynamic_info_get` function instead. + Multiprotocol Service Layer libraries ------------------------------------- diff --git a/include/modem/pdn.h b/include/modem/pdn.h index eae7b875a38b..5d18ccb9555d 100644 --- a/include/modem/pdn.h +++ b/include/modem/pdn.h @@ -220,21 +220,6 @@ int pdn_deactivate(uint8_t cid); */ int pdn_id_get(uint8_t cid); -/** - * @brief Retrieve dynamic parameters of a given PDN connection. - * - * @deprecated Use #pdn_dynamic_info_get instead. - * - * @param cid The PDP context ID. - * @param[out] dns4_pri The address of the primary IPv4 DNS server. Optional, can be NULL. - * @param[out] dns4_sec The address of the secondary IPv4 DNS server. Optional, can be NULL. - * @param[out] ipv4_mtu The IPv4 MTU. Optional, can be NULL. - * - * @return Zero on success or an error code on failure. - */ -__deprecated int pdn_dynamic_params_get(uint8_t cid, struct in_addr *dns4_pri, - struct in_addr *dns4_sec, unsigned int *ipv4_mtu); - /** * @brief Retrieve dynamic parameters of a given PDN connection. * diff --git a/lib/pdn/pdn.c b/lib/pdn/pdn.c index c269dfbb5303..82dc32a15868 100644 --- a/lib/pdn/pdn.c +++ b/lib/pdn/pdn.c @@ -635,51 +635,6 @@ int pdn_id_get(uint8_t cid) return strtoul(p + 1, NULL, 10); } -int pdn_dynamic_params_get(uint8_t cid, struct in_addr *dns4_pri, - struct in_addr *dns4_sec, unsigned int *ipv4_mtu) -{ - int matched; - const char *fmt; - unsigned int mtu; - char dns4_pri_str[INET_ADDRSTRLEN]; - char dns4_sec_str[INET_ADDRSTRLEN]; - char at_cmd[sizeof("AT+CGCONTRDP=###")]; - - if (snprintf(at_cmd, sizeof(at_cmd), AT_CMD_PDN_CONTEXT_READ_INFO, cid) >= sizeof(at_cmd)) { - return -E2BIG; - } - - fmt = AT_CMD_PDN_CONTEXT_READ_INFO_PARSE_LINE1; - - /* If IPv4 is enabled, it will be the first response line. */ - matched = nrf_modem_at_scanf(at_cmd, fmt, &dns4_pri_str, &dns4_sec_str, &mtu); - /* Need to match at least the two IP addresses, or there is an error */ - if (matched < 2) { - return -EBADMSG; - } - - if (dns4_pri) { - if (zsock_inet_pton(AF_INET, dns4_pri_str, dns4_pri) != 1) { - return -EADDRNOTAVAIL; - } - } - if (dns4_sec) { - if (zsock_inet_pton(AF_INET, dns4_sec_str, dns4_sec) != 1) { - return -EADDRNOTAVAIL; - } - } - if (ipv4_mtu) { - /* If we matched the MTU, copy it here, otherwise report zero */ - if (matched == 3) { - *ipv4_mtu = mtu; - } else { - *ipv4_mtu = 0; - } - } - - return 0; -} - static int pdn_sa_family_from_ip_string(const char *src) { char buf[INET6_ADDRSTRLEN];