diff --git a/UNITTESTS/features/netsocket/PPPInterface/test_PPPInterface.cpp b/UNITTESTS/features/netsocket/PPPInterface/test_PPPInterface.cpp index 003ff846b4..ef493ae35f 100644 --- a/UNITTESTS/features/netsocket/PPPInterface/test_PPPInterface.cpp +++ b/UNITTESTS/features/netsocket/PPPInterface/test_PPPInterface.cpp @@ -178,17 +178,21 @@ TEST_F(TestPPPInterface, disconnect) TEST_F(TestPPPInterface, set_network) { - char ipAddress[NSAPI_IPv4_SIZE] = "127.0.0.1"; - char netmask[NSAPI_IPv4_SIZE] = "255.255.0.0"; - char gateway[NSAPI_IPv4_SIZE] = "127.0.0.2"; + SocketAddress ipAddress("127.0.0.1"); + SocketAddress netmask("255.255.0.0"); + SocketAddress gateway("127.0.0.2"); const char *ipAddressArg; const char *netmaskArg; const char *gatewayArg; - EXPECT_EQ(0, iface->get_ip_address()); - EXPECT_EQ(0, iface->get_netmask()); - EXPECT_EQ(0, iface->get_gateway()); + SocketAddress ipAddr; + SocketAddress netmaskAddr; + SocketAddress gatewayAddr; + + EXPECT_EQ(NSAPI_ERROR_NO_CONNECTION, iface->get_ip_address(&ipAddr)); + EXPECT_EQ(NSAPI_ERROR_NO_CONNECTION, iface->get_netmask(&netmaskAddr)); + EXPECT_EQ(NSAPI_ERROR_NO_CONNECTION, iface->get_gateway(&gatewayAddr)); EXPECT_CALL(*pppMock, set_stream(_)); EXPECT_CALL(*pppMock, set_ip_stack(_)); @@ -213,25 +217,28 @@ TEST_F(TestPPPInterface, set_network) Return(NSAPI_ERROR_OK))); EXPECT_EQ(NSAPI_ERROR_OK, iface->connect()); // Check the contents of the stored pointer arguments. - EXPECT_TRUE(0 == strcmp(ipAddress, ipAddressArg)); - EXPECT_TRUE(0 == strcmp(netmask, netmaskArg)); - EXPECT_TRUE(0 == strcmp(gateway, gatewayArg)); + EXPECT_TRUE(0 == strcmp(ipAddress.get_ip_address(), ipAddressArg)); + EXPECT_TRUE(0 == strcmp(netmask.get_ip_address(), netmaskArg)); + EXPECT_TRUE(0 == strcmp(gateway.get_ip_address(), gatewayArg)); // Testing the getters makes sense now. - EXPECT_CALL(*netStackIface, get_ip_address(_, _)) + EXPECT_CALL(*netStackIface, get_ip_address(_)) .Times(1) - .WillOnce(DoAll(SetArgPointee<0>(*ipAddress), Return(ipAddress))); - EXPECT_EQ(std::string(ipAddress), std::string(iface->get_ip_address())); + .WillOnce(DoAll(SetArgPointee<0>(ipAddress), Return(NSAPI_ERROR_OK))); + EXPECT_EQ(NSAPI_ERROR_OK, iface->get_ip_address(&ipAddr)); + EXPECT_EQ(ipAddress, ipAddr); - EXPECT_CALL(*netStackIface, get_netmask(_, _)) + EXPECT_CALL(*netStackIface, get_netmask(_)) .Times(1) - .WillOnce(DoAll(SetArgPointee<0>(*netmask), Return(netmask))); - EXPECT_EQ(std::string(netmask), std::string(iface->get_netmask())); + .WillOnce(DoAll(SetArgPointee<0>(netmask), Return(NSAPI_ERROR_OK))); + EXPECT_EQ(NSAPI_ERROR_OK, iface->get_netmask(&netmaskAddr)); + EXPECT_EQ(netmask, netmaskAddr); - EXPECT_CALL(*netStackIface, get_gateway(_, _)) + EXPECT_CALL(*netStackIface, get_gateway(_)) .Times(1) - .WillOnce(DoAll(SetArgPointee<0>(*gateway), Return(gateway))); - EXPECT_EQ(std::string(gateway), std::string(iface->get_gateway())); + .WillOnce(DoAll(SetArgPointee<0>(gateway), Return(NSAPI_ERROR_OK))); + EXPECT_EQ(NSAPI_ERROR_OK, iface->get_gateway(&gatewayAddr)); + EXPECT_EQ(gateway, gatewayAddr); } TEST_F(TestPPPInterface, get_connection_status) diff --git a/UNITTESTS/features/netsocket/PPPInterface/unittest.cmake b/UNITTESTS/features/netsocket/PPPInterface/unittest.cmake index e2480c22d7..956803dfe3 100644 --- a/UNITTESTS/features/netsocket/PPPInterface/unittest.cmake +++ b/UNITTESTS/features/netsocket/PPPInterface/unittest.cmake @@ -32,8 +32,6 @@ set(unittest-test-sources stubs/mbed_shared_queues_stub.cpp stubs/nsapi_dns_stub.cpp stubs/EventFlags_stub.cpp - stubs/stoip4_stub.c - stubs/ip4tos_stub.c stubs/NetworkStack_stub.cpp stubs/NetworkInterfaceDefaults_stub.cpp stubs/SocketStats_Stub.cpp diff --git a/UNITTESTS/stubs/AT_CellularContext_stub.cpp b/UNITTESTS/stubs/AT_CellularContext_stub.cpp index 11badaae9a..0d7a72cc14 100644 --- a/UNITTESTS/stubs/AT_CellularContext_stub.cpp +++ b/UNITTESTS/stubs/AT_CellularContext_stub.cpp @@ -114,11 +114,6 @@ nsapi_error_t AT_CellularContext::get_ip_address(SocketAddress *address) return NSAPI_ERROR_UNSUPPORTED; } -const char *AT_CellularContext::get_ip_address() -{ - return NULL; -} - void AT_CellularContext::attach(Callback status_cb) { } diff --git a/UNITTESTS/stubs/AT_CellularStack_stub.cpp b/UNITTESTS/stubs/AT_CellularStack_stub.cpp index 06843c49bd..f6187bd8d6 100644 --- a/UNITTESTS/stubs/AT_CellularStack_stub.cpp +++ b/UNITTESTS/stubs/AT_CellularStack_stub.cpp @@ -36,11 +36,6 @@ nsapi_error_t AT_CellularStack::get_ip_address(SocketAddress* address) return NSAPI_ERROR_UNSUPPORTED; } -const char *AT_CellularStack::get_ip_address() -{ - return NULL; -} - nsapi_error_t AT_CellularStack::socket_open(nsapi_socket_t *handle, nsapi_protocol_t proto) { return NSAPI_ERROR_OK; diff --git a/UNITTESTS/stubs/NetworkInterface_stub.cpp b/UNITTESTS/stubs/NetworkInterface_stub.cpp index 0a849d2497..a038c39d52 100644 --- a/UNITTESTS/stubs/NetworkInterface_stub.cpp +++ b/UNITTESTS/stubs/NetworkInterface_stub.cpp @@ -31,10 +31,6 @@ nsapi_error_t NetworkInterface::get_ip_address(SocketAddress *) return NSAPI_ERROR_UNSUPPORTED; } -const char *NetworkInterface::get_ip_address() -{ - return nullptr; -} nsapi_error_t NetworkInterface::get_ipv6_link_local_address(SocketAddress *address) { return NSAPI_ERROR_UNSUPPORTED; @@ -45,31 +41,16 @@ nsapi_error_t NetworkInterface::get_netmask(SocketAddress *) return NSAPI_ERROR_UNSUPPORTED; } -const char *NetworkInterface::get_netmask() -{ - return nullptr; -} - nsapi_error_t NetworkInterface::get_gateway(SocketAddress *) { return NSAPI_ERROR_UNSUPPORTED; } -const char *NetworkInterface::get_gateway() -{ - return nullptr; -} - nsapi_error_t NetworkInterface::set_network(const SocketAddress &ip_address, const SocketAddress &netmask, const SocketAddress &gateway) { return NSAPI_ERROR_UNSUPPORTED; } -nsapi_error_t NetworkInterface::set_network(const char *ip_address, const char *netmask, const char *gateway) -{ - return NSAPI_ERROR_UNSUPPORTED; -} - nsapi_error_t NetworkInterface::set_dhcp(bool dhcp) { return NSAPI_ERROR_UNSUPPORTED; diff --git a/UNITTESTS/stubs/NetworkStack_stub.cpp b/UNITTESTS/stubs/NetworkStack_stub.cpp index e6b7a431c7..664a8a60dd 100644 --- a/UNITTESTS/stubs/NetworkStack_stub.cpp +++ b/UNITTESTS/stubs/NetworkStack_stub.cpp @@ -104,11 +104,6 @@ nsapi_error_t NetworkStack::get_ip_address(SocketAddress* address) return NSAPI_ERROR_UNSUPPORTED; } -const char *NetworkStack::get_ip_address() -{ - return NULL; -} - nsapi_error_t NetworkStack::get_ipv6_link_local_address(SocketAddress *address) { return NSAPI_ERROR_UNSUPPORTED; @@ -118,8 +113,3 @@ nsapi_error_t NetworkStack::get_ip_address_if(SocketAddress* address, const char { return NSAPI_ERROR_UNSUPPORTED; } - -const char *NetworkStack::get_ip_address_if(const char *interface_name) -{ - return NULL; -} diff --git a/UNITTESTS/stubs/NetworkStack_stub.h b/UNITTESTS/stubs/NetworkStack_stub.h index 2c5ffac236..916937e645 100644 --- a/UNITTESTS/stubs/NetworkStack_stub.h +++ b/UNITTESTS/stubs/NetworkStack_stub.h @@ -40,10 +40,6 @@ public: { } - virtual const char *get_ip_address() - { - return "127.0.0.1"; - } virtual nsapi_error_t get_ip_address(SocketAddress* address) { address->set_ip_address("127.0.0.1"); diff --git a/UNITTESTS/stubs/OnboardNetworkStack_mock.h b/UNITTESTS/stubs/OnboardNetworkStack_mock.h index 57d5b506f3..24d15f5942 100644 --- a/UNITTESTS/stubs/OnboardNetworkStack_mock.h +++ b/UNITTESTS/stubs/OnboardNetworkStack_mock.h @@ -82,7 +82,6 @@ public: MOCK_CONST_METHOD0(get_connection_status, nsapi_connection_status_t()); MOCK_METHOD1(get_interface_name, char *(char *buf)); MOCK_METHOD2(get_mac_address, char *(char *buf, nsapi_size_t buflen)); - MOCK_METHOD2(get_ip_address, char *(char *buf, nsapi_size_t buflen)); MOCK_METHOD1(get_ip_address, nsapi_error_t (SocketAddress *address)); MOCK_METHOD1(get_ipv6_link_local_address, nsapi_error_t(SocketAddress *address)); MOCK_METHOD2(get_netmask, char *(char *buf, nsapi_size_t buflen)); diff --git a/components/wifi/esp8266-driver/ESP8266Interface.cpp b/components/wifi/esp8266-driver/ESP8266Interface.cpp index ce31c41a39..b9be381f93 100644 --- a/components/wifi/esp8266-driver/ESP8266Interface.cpp +++ b/components/wifi/esp8266-driver/ESP8266Interface.cpp @@ -507,22 +507,6 @@ int ESP8266Interface::disconnect() } } -const char *ESP8266Interface::get_ip_address() -{ - if (_software_conn_stat == IFACE_STATUS_DISCONNECTED) { - _esp.uart_enable_input(true); - } - - const char *ip_buff = _esp.ip_addr(); - if (!ip_buff || strcmp(ip_buff, "0.0.0.0") == 0) { - ip_buff = NULL; - } - if (_software_conn_stat == IFACE_STATUS_DISCONNECTED) { - _esp.uart_enable_input(false); - } - return ip_buff; -} - nsapi_error_t ESP8266Interface::get_ip_address(SocketAddress *address) { if (_software_conn_stat == IFACE_STATUS_DISCONNECTED) { diff --git a/components/wifi/esp8266-driver/ESP8266Interface.h b/components/wifi/esp8266-driver/ESP8266Interface.h index 0d20ed704e..764081da05 100644 --- a/components/wifi/esp8266-driver/ESP8266Interface.h +++ b/components/wifi/esp8266-driver/ESP8266Interface.h @@ -141,9 +141,6 @@ public: */ virtual nsapi_error_t get_ip_address(SocketAddress *address); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual const char *get_ip_address(); - /** Get the internally stored MAC address * @return MAC address of the interface */ diff --git a/features/cellular/framework/API/CellularContext.h b/features/cellular/framework/API/CellularContext.h index e3f4a73385..8519abaa93 100644 --- a/features/cellular/framework/API/CellularContext.h +++ b/features/cellular/framework/API/CellularContext.h @@ -122,8 +122,6 @@ public: // from NetworkInterface virtual nsapi_error_t set_blocking(bool blocking) = 0; virtual NetworkStack *get_stack() = 0; virtual nsapi_error_t get_ip_address(SocketAddress *address) = 0; - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual const char *get_ip_address() = 0; /** Register callback for status reporting. * diff --git a/features/cellular/framework/AT/AT_CellularContext.cpp b/features/cellular/framework/AT/AT_CellularContext.cpp index 4c15fcae6b..4b48037ff1 100644 --- a/features/cellular/framework/AT/AT_CellularContext.cpp +++ b/features/cellular/framework/AT/AT_CellularContext.cpp @@ -224,21 +224,6 @@ nsapi_error_t AT_CellularContext::get_ip_address(SocketAddress *address) #endif } -const char *AT_CellularContext::get_ip_address() -{ -#if NSAPI_PPP_AVAILABLE - return nsapi_ppp_get_ip_addr(_at.get_file_handle()); -#else - if (!_stack) { - _stack = get_stack(); - } - if (_stack) { - return _stack->get_ip_address(); - } - return NULL; -#endif -} - char *AT_CellularContext::get_interface_name(char *interface_name) { if (_cid < 0) { diff --git a/features/cellular/framework/AT/AT_CellularContext.h b/features/cellular/framework/AT/AT_CellularContext.h index eb40c64026..5a2b6c9bb4 100644 --- a/features/cellular/framework/AT/AT_CellularContext.h +++ b/features/cellular/framework/AT/AT_CellularContext.h @@ -35,7 +35,6 @@ public: virtual nsapi_error_t set_blocking(bool blocking); virtual NetworkStack *get_stack(); virtual nsapi_error_t get_ip_address(SocketAddress *address); - virtual const char *get_ip_address(); virtual char *get_interface_name(char *interface_name); virtual void attach(mbed::Callback status_cb); virtual nsapi_error_t connect(); diff --git a/features/cellular/framework/AT/AT_CellularStack.cpp b/features/cellular/framework/AT/AT_CellularStack.cpp index 0cd3ac4c7f..f8a30db817 100644 --- a/features/cellular/framework/AT/AT_CellularStack.cpp +++ b/features/cellular/framework/AT/AT_CellularStack.cpp @@ -104,49 +104,6 @@ nsapi_error_t AT_CellularStack::get_ip_address(SocketAddress *address) return (ipv4 || ipv6) ? NSAPI_ERROR_OK : NSAPI_ERROR_NO_ADDRESS; } -const char *AT_CellularStack::get_ip_address() -{ - _at.lock(); - - bool ipv4 = false, ipv6 = false; - - _at.cmd_start_stop("+CGPADDR", "=", "%d", _cid); - _at.resp_start("+CGPADDR:"); - - if (_at.info_resp()) { - _at.skip_param(); - - if (_at.read_string(_ip, PDP_IPV6_SIZE) != -1) { - convert_ipv6(_ip); - SocketAddress address; - address.set_ip_address(_ip); - - ipv4 = (address.get_ip_version() == NSAPI_IPv4); - ipv6 = (address.get_ip_version() == NSAPI_IPv6); - - // Try to look for second address ONLY if modem has support for dual stack(can handle both IPv4 and IPv6 simultaneously). - // Otherwise assumption is that second address is not reliable, even if network provides one. - if ((_device.get_property(AT_CellularDevice::PROPERTY_IPV4V6_PDP_TYPE) && (_at.read_string(_ip, PDP_IPV6_SIZE) != -1))) { - convert_ipv6(_ip); - address.set_ip_address(_ip); - ipv6 = (address.get_ip_version() == NSAPI_IPv6); - } - } - } - _at.resp_stop(); - _at.unlock(); - - if (ipv4 && ipv6) { - _stack_type = IPV4V6_STACK; - } else if (ipv4) { - _stack_type = IPV4_STACK; - } else if (ipv6) { - _stack_type = IPV6_STACK; - } - - return (ipv4 || ipv6) ? _ip : NULL; -} - void AT_CellularStack::set_cid(int cid) { _cid = cid; diff --git a/features/cellular/framework/AT/AT_CellularStack.h b/features/cellular/framework/AT/AT_CellularStack.h index 2a7d08aba1..f0befb7b93 100644 --- a/features/cellular/framework/AT/AT_CellularStack.h +++ b/features/cellular/framework/AT/AT_CellularStack.h @@ -46,9 +46,6 @@ public: // NetworkStack virtual nsapi_error_t get_ip_address(SocketAddress *address); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual const char *get_ip_address(); - /** * Set PDP context ID for this stack * diff --git a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularContext.cpp b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularContext.cpp index 309589d22e..77c1cb7d10 100644 --- a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularContext.cpp +++ b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularContext.cpp @@ -299,11 +299,6 @@ void UBLOX_AT_CellularContext::get_next_credentials(char **config) } } -const char *UBLOX_AT_CellularContext::get_gateway() -{ - return get_ip_address(); -} - nsapi_error_t UBLOX_AT_CellularContext::get_gateway(SocketAddress *addr) { return get_ip_address(addr); diff --git a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularContext.h b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularContext.h index 10198a26e5..4e2272d42f 100644 --- a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularContext.h +++ b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularContext.h @@ -28,7 +28,6 @@ public: virtual ~UBLOX_AT_CellularContext(); virtual void do_connect(); - virtual const char *get_gateway(); virtual nsapi_error_t get_gateway(SocketAddress *addr); const char *get_apn(void); diff --git a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.cpp b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.cpp index 587a6c6120..fb505f2b1d 100644 --- a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.cpp +++ b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.cpp @@ -398,15 +398,6 @@ void UBLOX_AT_CellularStack::clear_socket(CellularSocket *socket) } #ifndef UBX_MDM_SARA_R41XM -const char *UBLOX_AT_CellularStack::get_ip_address() -{ - SocketAddress address; - - get_ip_address(&address); - - return (address.get_ip_version()) ? (address.get_ip_address()) : NULL; -} - nsapi_error_t UBLOX_AT_CellularStack::get_ip_address(SocketAddress *address) { if (!address) { diff --git a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.h b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.h index fef9e11d2b..ad426a8ccd 100644 --- a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.h +++ b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.h @@ -31,8 +31,6 @@ public: virtual ~UBLOX_AT_CellularStack(); #ifndef UBX_MDM_SARA_R41XM - virtual const char *get_ip_address(); - virtual nsapi_error_t get_ip_address(SocketAddress *address); #endif diff --git a/features/lwipstack/LWIPInterface.cpp b/features/lwipstack/LWIPInterface.cpp index 0a10d82cb4..59ddbef72c 100644 --- a/features/lwipstack/LWIPInterface.cpp +++ b/features/lwipstack/LWIPInterface.cpp @@ -328,27 +328,6 @@ nsapi_error_t LWIP::Interface::get_ip_address(SocketAddress *address) return NSAPI_ERROR_UNSUPPORTED; } -char *LWIP::Interface::get_ip_address(char *buf, nsapi_size_t buflen) -{ - const ip_addr_t *addr = LWIP::get_ip_addr(true, &netif); - if (!addr) { - return NULL; - } -#if LWIP_IPV6 - if (IP_IS_V6(addr)) { - return ip6addr_ntoa_r(ip_2_ip6(addr), buf, buflen); - } -#endif -#if LWIP_IPV4 - if (IP_IS_V4(addr)) { - return ip4addr_ntoa_r(ip_2_ip4(addr), buf, buflen); - } -#endif -#if LWIP_IPV6 && LWIP_IPV4 - return NULL; -#endif -} - nsapi_error_t LWIP::Interface::get_netmask(SocketAddress *address) { if (!address) { @@ -368,20 +347,6 @@ nsapi_error_t LWIP::Interface::get_netmask(SocketAddress *address) #endif } -char *LWIP::Interface::get_netmask(char *buf, nsapi_size_t buflen) -{ -#if LWIP_IPV4 - const ip4_addr_t *addr = netif_ip4_netmask(&netif); - if (!ip4_addr_isany(addr)) { - return ip4addr_ntoa_r(addr, buf, buflen); - } else { - return NULL; - } -#else - return NULL; -#endif -} - nsapi_error_t LWIP::Interface::get_gateway(SocketAddress *address) { if (!address) { @@ -401,20 +366,6 @@ nsapi_error_t LWIP::Interface::get_gateway(SocketAddress *address) #endif } -char *LWIP::Interface::get_gateway(char *buf, nsapi_size_t buflen) -{ -#if LWIP_IPV4 - const ip4_addr_t *addr = netif_ip4_gw(&netif); - if (!ip4_addr_isany(addr)) { - return ip4addr_ntoa_r(addr, buf, buflen); - } else { - return NULL; - } -#else - return NULL; -#endif -} - LWIP::Interface::Interface() : hw(NULL), has_addr_state(0), connected(NSAPI_STATUS_DISCONNECTED), diff --git a/features/lwipstack/LWIPStack.h b/features/lwipstack/LWIPStack.h index 8c4df25f23..b0fe021729 100644 --- a/features/lwipstack/LWIPStack.h +++ b/features/lwipstack/LWIPStack.h @@ -96,9 +96,6 @@ public: /** @copydoc NetworkStack::get_ip_address */ virtual nsapi_error_t get_ip_address(SocketAddress *address); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual char *get_ip_address(char *buf, nsapi_size_t buflen); - /** Get the IPv6 link local address in SocketAddress representation * * @address SocketAddress representation of the link local IPv6 address @@ -114,9 +111,6 @@ public: */ virtual nsapi_error_t get_netmask(SocketAddress *address); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual char *get_netmask(char *buf, nsapi_size_t buflen); - /** Copies gateway address of the network interface to user supplied buffer * * @param buf buffer to which gateway address will be copied as "W:X:Y:Z" @@ -125,9 +119,6 @@ public: */ virtual nsapi_error_t get_gateway(SocketAddress *address); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual char *get_gateway(char *buf, nsapi_size_t buflen); - private: friend class LWIP; diff --git a/features/nanostack/mbed-mesh-api/mbed-mesh-api/MeshInterfaceNanostack.h b/features/nanostack/mbed-mesh-api/mbed-mesh-api/MeshInterfaceNanostack.h index 9a782bff89..d57a914d6e 100644 --- a/features/nanostack/mbed-mesh-api/mbed-mesh-api/MeshInterfaceNanostack.h +++ b/features/nanostack/mbed-mesh-api/mbed-mesh-api/MeshInterfaceNanostack.h @@ -26,15 +26,9 @@ class Nanostack::Interface : public OnboardNetworkStack::Interface, private mbed::NonCopyable { public: virtual nsapi_error_t get_ip_address(SocketAddress *address); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual char *get_ip_address(char *buf, nsapi_size_t buflen); virtual char *get_mac_address(char *buf, nsapi_size_t buflen); virtual nsapi_error_t get_netmask(SocketAddress *address); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual char *get_netmask(char *buf, nsapi_size_t buflen); virtual nsapi_error_t get_gateway(SocketAddress *address); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual char *get_gateway(char *buf, nsapi_size_t buflen); virtual void attach(mbed::Callback status_cb); virtual nsapi_connection_status_t get_connection_status() const; @@ -108,9 +102,6 @@ public: /** @copydoc NetworkInterface::get_ip_address */ virtual nsapi_error_t get_ip_address(SocketAddress *address); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual const char *get_ip_address(); - /** Get the internally stored MAC address /return MAC address of the interface */ diff --git a/features/nanostack/mbed-mesh-api/source/LoWPANNDInterface.cpp b/features/nanostack/mbed-mesh-api/source/LoWPANNDInterface.cpp index a90c822a51..1314550451 100644 --- a/features/nanostack/mbed-mesh-api/source/LoWPANNDInterface.cpp +++ b/features/nanostack/mbed-mesh-api/source/LoWPANNDInterface.cpp @@ -31,7 +31,7 @@ public: nsapi_ip_stack_t stack = IPV6_STACK, bool blocking = true); virtual nsapi_error_t bringdown(); - virtual char *get_gateway(char *buf, nsapi_size_t buflen); + virtual nsapi_error_t get_gateway(SocketAddress *sockAddr); friend class Nanostack; friend class ::LoWPANNDInterface; @@ -156,13 +156,15 @@ mesh_error_t Nanostack::LoWPANNDInterface::mesh_disconnect() return MESH_ERROR_UNKNOWN; } -char *Nanostack::LoWPANNDInterface::get_gateway(char *buf, nsapi_size_t buflen) +nsapi_error_t Nanostack::LoWPANNDInterface::get_gateway(SocketAddress *sockAddr) { NanostackLockGuard lock; - if (nd_tasklet_get_router_ip_address(buf, buflen) == 0) { - return buf; + char buf[NSAPI_IPv6_SIZE]; + if (nd_tasklet_get_router_ip_address(buf, NSAPI_IPv6_SIZE) == 0) { + sockAddr->set_ip_address(buf); + return NSAPI_ERROR_OK; } - return NULL; + return NSAPI_ERROR_NO_ADDRESS; } bool LoWPANNDInterface::getRouterIpAddress(char *address, int8_t len) diff --git a/features/nanostack/mbed-mesh-api/source/MeshInterfaceNanostack.cpp b/features/nanostack/mbed-mesh-api/source/MeshInterfaceNanostack.cpp index af919a39e3..595e7d076b 100644 --- a/features/nanostack/mbed-mesh-api/source/MeshInterfaceNanostack.cpp +++ b/features/nanostack/mbed-mesh-api/source/MeshInterfaceNanostack.cpp @@ -36,19 +36,6 @@ nsapi_error_t Nanostack::Interface::get_ip_address(SocketAddress *address) } } -char *Nanostack::Interface::get_ip_address(char *buf, nsapi_size_t buflen) -{ - NanostackLockGuard lock; - uint8_t binary_ipv6[16]; - - if (buflen >= 40 && arm_net_address_get(interface_id, ADDR_IPV6_GP, binary_ipv6) == 0) { - ip6tos(binary_ipv6, buf); - return buf; - } else { - return NULL; - } -} - char *Nanostack::Interface::get_mac_address(char *buf, nsapi_size_t buflen) { NanostackLockGuard lock; @@ -71,16 +58,6 @@ nsapi_error_t Nanostack::Interface::get_gateway(SocketAddress *address) return NSAPI_ERROR_UNSUPPORTED; } -char *Nanostack::Interface::get_netmask(char *, nsapi_size_t) -{ - return NULL; -} - -char *Nanostack::Interface::get_gateway(char *, nsapi_size_t) -{ - return NULL; -} - nsapi_connection_status_t Nanostack::Interface::get_connection_status() const { return _connect_status; @@ -210,14 +187,6 @@ nsapi_error_t InterfaceNanostack::get_ip_address(SocketAddress *address) return NSAPI_ERROR_NO_ADDRESS; } -const char *InterfaceNanostack::get_ip_address() -{ - if (_interface->get_ip_address(&ip_addr) == NSAPI_ERROR_OK) { - return ip_addr.get_ip_address(); - } - return NULL; -} - const char *InterfaceNanostack::get_mac_address() { if (_interface->get_mac_address(mac_addr_str, sizeof(mac_addr_str))) { diff --git a/features/nanostack/mbed-mesh-api/source/WisunInterface.cpp b/features/nanostack/mbed-mesh-api/source/WisunInterface.cpp index b363c7d578..f40c6f8aa2 100644 --- a/features/nanostack/mbed-mesh-api/source/WisunInterface.cpp +++ b/features/nanostack/mbed-mesh-api/source/WisunInterface.cpp @@ -32,7 +32,7 @@ public: nsapi_ip_stack_t stack = IPV6_STACK, bool blocking = true); virtual nsapi_error_t bringdown(); - virtual char *get_gateway(char *buf, nsapi_size_t buflen); + virtual nsapi_error_t get_gateway(SocketAddress *address); friend class Nanostack; friend class ::WisunInterface; @@ -157,13 +157,15 @@ mesh_error_t Nanostack::WisunInterface::mesh_disconnect() return MESH_ERROR_UNKNOWN; } -char *Nanostack::WisunInterface::get_gateway(char *buf, nsapi_size_t buflen) +nsapi_error_t Nanostack::WisunInterface::get_gateway(SocketAddress *addr) { NanostackLockGuard lock; - if (wisun_tasklet_get_router_ip_address(buf, buflen) == 0) { - return buf; + char buf[NSAPI_IPv6_SIZE]; + if (wisun_tasklet_get_router_ip_address(buf, NSAPI_IPv6_SIZE) == 0) { + addr->set_ip_address(buf); + return NSAPI_ERROR_OK; } - return NULL; + return NSAPI_ERROR_NO_ADDRESS; } bool WisunInterface::getRouterIpAddress(char *address, int8_t len) diff --git a/features/nanostack/nanostack-interface/Nanostack.cpp b/features/nanostack/nanostack-interface/Nanostack.cpp index 961fda6095..f5b715bdb0 100644 --- a/features/nanostack/nanostack-interface/Nanostack.cpp +++ b/features/nanostack/nanostack-interface/Nanostack.cpp @@ -516,21 +516,20 @@ Nanostack::call_in_callback_cb_t Nanostack::get_call_in_callback() return cb; } -const char *Nanostack::get_ip_address() +nsapi_error_t Nanostack::get_ip_address(SocketAddress *sockAddr) { NanostackLockGuard lock; for (int if_id = 1; if_id <= 127; if_id++) { - uint8_t address[16]; + uint8_t address[NSAPI_IP_BYTES]; int ret = arm_net_address_get(if_id, ADDR_IPV6_GP, address); if (ret == 0) { + sockAddr->set_ip_bytes(address, NSAPI_IPv6); ip6tos(address, text_ip_address); - return text_ip_address; + return NSAPI_ERROR_OK; } } - // Must result a valid IPv6 address - // For gethostbyname() to detect IP version. - return "::"; + return NSAPI_ERROR_NO_ADDRESS; } nsapi_error_t Nanostack::socket_open(void **handle, nsapi_protocol_t protocol) diff --git a/features/nanostack/nanostack-interface/Nanostack.h b/features/nanostack/nanostack-interface/Nanostack.h index aea1fb0b68..32e549cd0c 100644 --- a/features/nanostack/nanostack-interface/Nanostack.h +++ b/features/nanostack/nanostack-interface/Nanostack.h @@ -56,12 +56,8 @@ protected: Nanostack(); - /** Get the local IP address - * - * @return Null-terminated representation of the local IP address - * or null if not yet connected - */ - virtual const char *get_ip_address(); + /** @copydoc NetworkStack::get_ip_address */ + virtual nsapi_error_t get_ip_address(SocketAddress *sockAddr); /** Opens a socket * diff --git a/features/netsocket/CellularInterface.h b/features/netsocket/CellularInterface.h index d77c532bc7..647a523b84 100644 --- a/features/netsocket/CellularInterface.h +++ b/features/netsocket/CellularInterface.h @@ -98,9 +98,6 @@ public: /** @copydoc NetworkInterface::get_ip_address */ virtual nsapi_error_t get_ip_address(SocketAddress *address) = 0; - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual const char *get_ip_address() = 0; - /** @copydoc NetworkInterface::cellularInterface */ virtual CellularInterface *cellularInterface() diff --git a/features/netsocket/DTLSSocket.cpp b/features/netsocket/DTLSSocket.cpp index 5bb2f3d811..eaf6dc559f 100644 --- a/features/netsocket/DTLSSocket.cpp +++ b/features/netsocket/DTLSSocket.cpp @@ -23,31 +23,6 @@ // This class requires Mbed TLS SSL/TLS client code #if defined(MBEDTLS_SSL_CLI_C) -nsapi_error_t DTLSSocket::connect(const char *host, uint16_t port) -{ - SocketAddress addr; - nsapi_error_t ret; - - ret = _udp_socket.getpeername(&addr); - if (ret != NSAPI_ERROR_NO_CONNECTION) { - return ret; - } - - if (!addr || ret == NSAPI_ERROR_NO_CONNECTION) { - nsapi_error_t err = _udp_socket._stack->gethostbyname(host, &addr); - if (err) { - return NSAPI_ERROR_DNS_FAILURE; - } - - addr.set_port(port); - - set_hostname(host); - _udp_socket.connect(addr); // UDPSocket::connect() cannot fail - } - - return connect(addr); -} - DTLSSocket::~DTLSSocket() { // Make sure that DTLSSocketWrapper::close() is called before the transport is diff --git a/features/netsocket/DTLSSocket.h b/features/netsocket/DTLSSocket.h index 66252a6cff..45de541ae4 100644 --- a/features/netsocket/DTLSSocket.h +++ b/features/netsocket/DTLSSocket.h @@ -87,19 +87,6 @@ public: using DTLSSocketWrapper::connect; - /** Connects TCP socket to a remote host. - * - * Initiates a connection to a remote server specified by either - * a domain name or an IP address and a port. - * - * @param host Hostname of the remote host. - * @param port Port of the remote host. - * @return NSAPI_ERROR_OK on success, negative error code on failure. - * See @ref TLSSocketWrapper::connect. - */ - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - nsapi_error_t connect(const char *host, uint16_t port); - private: UDPSocket _udp_socket; }; diff --git a/features/netsocket/EMACInterface.cpp b/features/netsocket/EMACInterface.cpp index 275ac601bf..555d156412 100644 --- a/features/netsocket/EMACInterface.cpp +++ b/features/netsocket/EMACInterface.cpp @@ -31,20 +31,6 @@ EMACInterface::EMACInterface(EMAC &emac, OnboardNetworkStack &stack) : { } -nsapi_error_t EMACInterface::set_network(const char *ip_address, const char *netmask, const char *gateway) -{ - _dhcp = false; - - strncpy(_ip_address, ip_address ? ip_address : "", sizeof(_ip_address)); - _ip_address[sizeof(_ip_address) - 1] = '\0'; - strncpy(_netmask, netmask ? netmask : "", sizeof(_netmask)); - _netmask[sizeof(_netmask) - 1] = '\0'; - strncpy(_gateway, gateway ? gateway : "", sizeof(_gateway)); - _gateway[sizeof(_gateway) - 1] = '\0'; - - return NSAPI_ERROR_OK; -} - nsapi_error_t EMACInterface::set_network(const SocketAddress &ip_address, const SocketAddress &netmask, const SocketAddress &gateway) { _dhcp = false; @@ -110,14 +96,6 @@ nsapi_error_t EMACInterface::get_ip_address(SocketAddress *address) return NSAPI_ERROR_NO_CONNECTION; } -const char *EMACInterface::get_ip_address() -{ - if (_interface && _interface->get_ip_address(_ip_address, sizeof(_ip_address))) { - return _ip_address; - } - return nullptr; -} - nsapi_error_t EMACInterface::get_ipv6_link_local_address(SocketAddress *address) { if (_interface) { @@ -137,33 +115,16 @@ nsapi_error_t EMACInterface::get_netmask(SocketAddress *address) return NSAPI_ERROR_NO_CONNECTION; } -const char *EMACInterface::get_netmask() -{ - if (_interface && _interface->get_netmask(_netmask, sizeof(_netmask))) { - return _netmask; - } - return nullptr; -} - nsapi_error_t EMACInterface::get_gateway(SocketAddress *address) { if (_interface && _interface->get_gateway(address) == NSAPI_ERROR_OK) { strncpy(_gateway, address->get_ip_address(), sizeof(_gateway)); - address->set_ip_address(_gateway); return NSAPI_ERROR_OK; } return NSAPI_ERROR_NO_CONNECTION; } -const char *EMACInterface::get_gateway() -{ - if (_interface && _interface->get_gateway(_gateway, sizeof(_gateway))) { - return _gateway; - } - return nullptr; -} - char *EMACInterface::get_interface_name(char *interface_name) { if (_interface) { diff --git a/features/netsocket/EMACInterface.h b/features/netsocket/EMACInterface.h index 70e6aef12a..de1ef46c8a 100644 --- a/features/netsocket/EMACInterface.h +++ b/features/netsocket/EMACInterface.h @@ -59,16 +59,13 @@ public: * Implicitly disables DHCP, which can be enabled in set_dhcp. * Requires that the network is disconnected. * - * @param ip_address Null-terminated representation of the local IP address - * @param netmask Null-terminated representation of the local network mask - * @param gateway Null-terminated representation of the local gateway + * @param ip_address SocketAddress representation of the local IP address + * @param netmask SocketAddress representation of the local network mask + * @param gateway SocketAddress representation of the local gateway * @return 0 on success, negative error code on failure */ virtual nsapi_error_t set_network(const SocketAddress &ip_address, const SocketAddress &netmask, const SocketAddress &gateway); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual nsapi_error_t set_network(const char *ip_address, const char *netmask, const char *gateway); - /** Enable or disable DHCP on the network * * Requires that the network is disconnected @@ -91,25 +88,15 @@ public: /** @copydoc NetworkInterface::get_ip_address */ virtual nsapi_error_t get_ip_address(SocketAddress *address); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual const char *get_ip_address(); - /** @copydoc NetworkInterface::get_ipv6_link_local_address */ virtual nsapi_error_t get_ipv6_link_local_address(SocketAddress *address); /** @copydoc NetworkInterface::get_netmask */ virtual nsapi_error_t get_netmask(SocketAddress *address); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual const char *get_netmask(); - /** @copydoc NetworkInterface::get_gateway */ virtual nsapi_error_t get_gateway(SocketAddress *address); - /** @copydoc NetworkInterface::get_gateway */ - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual const char *get_gateway(); - /** @copydoc NetworkInterface::get_interface_name */ virtual char *get_interface_name(char *interface_name); diff --git a/features/netsocket/InternetDatagramSocket.cpp b/features/netsocket/InternetDatagramSocket.cpp index 7526a5e86c..3a6685d860 100644 --- a/features/netsocket/InternetDatagramSocket.cpp +++ b/features/netsocket/InternetDatagramSocket.cpp @@ -26,27 +26,6 @@ nsapi_error_t InternetDatagramSocket::connect(const SocketAddress &address) return NSAPI_ERROR_OK; } -nsapi_size_or_error_t InternetDatagramSocket::sendto(const char *host, uint16_t port, const void *data, nsapi_size_t size) -{ - SocketAddress address; - nsapi_size_or_error_t err; - - if (!strcmp(_interface_name, "")) { - err = _stack->gethostbyname(host, &address); - } else { - err = _stack->gethostbyname(host, &address, NSAPI_UNSPEC, _interface_name); - } - - if (err) { - return NSAPI_ERROR_DNS_FAILURE; - } - - address.set_port(port); - - // sendto is thread safe - return sendto(address, data, size); -} - nsapi_size_or_error_t InternetDatagramSocket::sendto(const SocketAddress &address, const void *data, nsapi_size_t size) { _lock.lock(); diff --git a/features/netsocket/InternetDatagramSocket.h b/features/netsocket/InternetDatagramSocket.h index cc9e40197f..3f8d3a5104 100644 --- a/features/netsocket/InternetDatagramSocket.h +++ b/features/netsocket/InternetDatagramSocket.h @@ -29,29 +29,6 @@ */ class InternetDatagramSocket : public InternetSocket { public: - - /** Send data to the specified host and port. - * - * By default, sendto blocks until data is sent. If socket is set to - * nonblocking or times out, NSAPI_ERROR_WOULD_BLOCK is returned - * immediately. - * - * @param host Domain name of the remote host or a dotted notation IP address. - * @param port Port of the remote host. - * @param data Buffer of data to send to the host. - * @param size Size of the buffer in bytes. - * @retval int Number of sent bytes on success. - * @retval NSAPI_ERROR_NO_SOCKET in case socket was not created correctly. - * @retval NSAPI_ERROR_DNS_FAILURE if the DNS address of host could not be resolved - * @retval NSAPI_ERROR_WOULD_BLOCK in case non-blocking mode is enabled - * and send cannot be performed immediately. - * @retval int Other negative error codes for stack-related failures. - * See @ref NetworkStack::socket_send. - */ - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual nsapi_size_or_error_t sendto(const char *host, uint16_t port, - const void *data, nsapi_size_t size); - /** Send data to the specified address. * * By default, sendto blocks until data is sent. If socket is set to diff --git a/features/netsocket/InternetSocket.cpp b/features/netsocket/InternetSocket.cpp index 926ba8b335..2d3f06f7a3 100644 --- a/features/netsocket/InternetSocket.cpp +++ b/features/netsocket/InternetSocket.cpp @@ -127,13 +127,6 @@ nsapi_error_t InternetSocket::bind(uint16_t port) return bind(addr); } -nsapi_error_t InternetSocket::bind(const char *address, uint16_t port) -{ - // Underlying bind is thread safe - SocketAddress addr(address, port); - return bind(addr); -} - nsapi_error_t InternetSocket::bind(const SocketAddress &address) { _lock.lock(); diff --git a/features/netsocket/InternetSocket.h b/features/netsocket/InternetSocket.h index 3d803ef0f6..cc5e335f8a 100644 --- a/features/netsocket/InternetSocket.h +++ b/features/netsocket/InternetSocket.h @@ -96,19 +96,6 @@ public: */ nsapi_error_t bind(uint16_t port); - /** Bind the socket to a specific address and port on which to receive - * data. If the IP address is zeroed, only the port is bound. - * - * @param address Null-terminated local address to bind. - * @param port Local port to bind. - * @retval NSAPI_ERROR_OK on success. - * @retval NSAPI_ERROR_NO_SOCKET if socket is not open. - * @retval int negative error codes for stack-related failures. - * See @ref NetworkStack::socket_bind. - */ - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - nsapi_error_t bind(const char *address, uint16_t port); - /** @copydoc Socket::bind */ virtual nsapi_error_t bind(const SocketAddress &address); diff --git a/features/netsocket/L3IPInterface.cpp b/features/netsocket/L3IPInterface.cpp index ff0bf6fed3..28740f07dd 100644 --- a/features/netsocket/L3IPInterface.cpp +++ b/features/netsocket/L3IPInterface.cpp @@ -88,31 +88,35 @@ nsapi_error_t L3IPInterface::disconnect() return NSAPI_ERROR_NO_CONNECTION; } -const char *L3IPInterface::get_ip_address() +nsapi_error_t L3IPInterface::get_ip_address(SocketAddress *address) { - if (_interface && _interface->get_ip_address(_ip_address, sizeof(_ip_address))) { - return _ip_address; + if (_interface && _interface->get_ip_address(address) == NSAPI_ERROR_OK) { + strncpy(_ip_address, address->get_ip_address(), sizeof(_ip_address)); + return NSAPI_ERROR_OK; } - return NULL; + return NSAPI_ERROR_NO_CONNECTION; } -const char *L3IPInterface::get_netmask() +nsapi_error_t L3IPInterface::get_netmask(SocketAddress *address) { - if (_interface && _interface->get_netmask(_netmask, sizeof(_netmask))) { - return _netmask; + if (_interface && _interface->get_netmask(address) == NSAPI_ERROR_OK) { + strncpy(_netmask, address->get_ip_address(), sizeof(_netmask)); + return NSAPI_ERROR_OK; } - return 0; + return NSAPI_ERROR_NO_ADDRESS; } -const char *L3IPInterface::get_gateway() +nsapi_error_t L3IPInterface::get_gateway(SocketAddress *address) { - if (_interface && _interface->get_gateway(_gateway, sizeof(_gateway))) { - return _gateway; + return NSAPI_ERROR_NO_CONNECTION; + if (_interface && _interface->get_gateway(address) == NSAPI_ERROR_OK) { + strncpy(_gateway, address->get_ip_address(), sizeof(_gateway)); + return NSAPI_ERROR_OK; } - return 0; + return NSAPI_ERROR_NO_ADDRESS; } char *L3IPInterface::get_interface_name(char *interface_name) diff --git a/features/netsocket/L3IPInterface.h b/features/netsocket/L3IPInterface.h index 99d56e7a4f..ce020a7c3e 100644 --- a/features/netsocket/L3IPInterface.h +++ b/features/netsocket/L3IPInterface.h @@ -56,12 +56,12 @@ public: * Implicitly disables DHCP, which can be enabled in set_dhcp. * Requires that the network is disconnected. * - * @param ip_address Null-terminated representation of the local IP address - * @param netmask Null-terminated representation of the local network mask - * @param gateway Null-terminated representation of the local gateway + * @param ip_address SocketAddress representation of the local IP address + * @param netmask SocketAddress representation of the local network mask + * @param gateway SocketAddress representation of the local gateway * @return 0 on success, negative error code on failure */ - virtual nsapi_error_t set_network(const char *ip_address, const char *netmask, const char *gateway); + virtual nsapi_error_t set_network(const SocketAddress &ip_address, const SocketAddress &netmask, const SocketAddress &gateway); /** Enable or disable DHCP on the network * @@ -82,26 +82,14 @@ public: */ virtual nsapi_error_t disconnect(); - /** Get the local IP address - * - * @return Null-terminated representation of the local IP address - * or null if no IP address has been received - */ - virtual const char *get_ip_address(); + /** @copydoc NetworkInterface::get_ip_address */ + virtual nsapi_error_t get_ip_address(SocketAddress *address); - /** Get the local network mask - * - * @return Null-terminated representation of the local network mask - * or null if no network mask has been received - */ - virtual const char *get_netmask(); + /** @copydoc NetworkInterface::get_netmask */ + virtual nsapi_error_t get_netmask(SocketAddress *address); - /** Get the local gateways - * - * @return Null-terminated representation of the local gateway - * or null if no network mask has been received - */ - virtual const char *get_gateway(); + /** @copydoc NetworkInterface::get_gateway */ + virtual nsapi_error_t get_gateway(SocketAddress *address); /** Get the network interface name * diff --git a/features/netsocket/NetworkInterface.cpp b/features/netsocket/NetworkInterface.cpp index 276a24fdc0..9a682904bb 100644 --- a/features/netsocket/NetworkInterface.cpp +++ b/features/netsocket/NetworkInterface.cpp @@ -37,11 +37,6 @@ nsapi_error_t NetworkInterface::get_ip_address(SocketAddress *) return NSAPI_ERROR_UNSUPPORTED; } -const char *NetworkInterface::get_ip_address() -{ - return nullptr; -} - nsapi_error_t NetworkInterface::get_ipv6_link_local_address(SocketAddress *address) { return NSAPI_ERROR_UNSUPPORTED; @@ -52,31 +47,16 @@ nsapi_error_t NetworkInterface::get_netmask(SocketAddress *) return NSAPI_ERROR_UNSUPPORTED; } -const char *NetworkInterface::get_netmask() -{ - return nullptr; -} - nsapi_error_t NetworkInterface::get_gateway(SocketAddress *) { return NSAPI_ERROR_UNSUPPORTED; } -const char *NetworkInterface::get_gateway() -{ - return nullptr; -} - char *NetworkInterface::get_interface_name(char *interface_name) { return 0; } -nsapi_error_t NetworkInterface::set_network(const char *ip_address, const char *netmask, const char *gateway) -{ - return NSAPI_ERROR_UNSUPPORTED; -} - nsapi_error_t NetworkInterface::set_network(const SocketAddress &ip_address, const SocketAddress &netmask, const SocketAddress &gateway) { return NSAPI_ERROR_UNSUPPORTED; diff --git a/features/netsocket/NetworkInterface.h b/features/netsocket/NetworkInterface.h index a31f3ca65e..3ba5d46eac 100644 --- a/features/netsocket/NetworkInterface.h +++ b/features/netsocket/NetworkInterface.h @@ -110,9 +110,6 @@ public: */ virtual nsapi_error_t get_ip_address(SocketAddress *address); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual const char *get_ip_address(); - /** Get the IPv6 link local address * * @param address SocketAddress representation of the link local IPv6 address @@ -132,9 +129,6 @@ public: */ virtual nsapi_error_t get_netmask(SocketAddress *address); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual const char *get_netmask(); - /** Get the local gateway. * * @param address SocketAddress representation of gateway address @@ -145,9 +139,6 @@ public: */ virtual nsapi_error_t get_gateway(SocketAddress *address); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual const char *get_gateway(); - /** Get the network interface name * * @return Null-terminated representation of the network interface name @@ -167,9 +158,6 @@ public: */ virtual nsapi_error_t set_network(const SocketAddress &ip_address, const SocketAddress &netmask, const SocketAddress &gateway); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual nsapi_error_t set_network(const char *ip_address, const char *netmask, const char *gateway); - /** Enable or disable DHCP on connecting the network. * * Enabled by default unless a static IP address has been assigned. Requires diff --git a/features/netsocket/NetworkStack.cpp b/features/netsocket/NetworkStack.cpp index 3c115e5060..761fd9300c 100644 --- a/features/netsocket/NetworkStack.cpp +++ b/features/netsocket/NetworkStack.cpp @@ -29,11 +29,6 @@ nsapi_error_t NetworkStack::get_ip_address(SocketAddress *address) return NSAPI_ERROR_UNSUPPORTED; } -const char *NetworkStack::get_ip_address() -{ - return nullptr; -} - nsapi_error_t NetworkStack::get_ipv6_link_local_address(SocketAddress *address) { return NSAPI_ERROR_UNSUPPORTED; @@ -44,11 +39,6 @@ nsapi_error_t NetworkStack::get_ip_address_if(SocketAddress *address, const char return NSAPI_ERROR_UNSUPPORTED; } -const char *NetworkStack::get_ip_address_if(const char *interface_name) -{ - return nullptr; -} - nsapi_error_t NetworkStack::gethostbyname(const char *name, SocketAddress *address, nsapi_version_t version, const char *interface_name) { if (name[0] == '\0') { @@ -87,7 +77,7 @@ nsapi_value_or_error_t NetworkStack::getaddrinfo(const char *hostname, SocketAdd // ip address of the underlying stack if (version == NSAPI_UNSPEC) { SocketAddress testaddress; - if (testaddress.set_ip_address(this->get_ip_address())) { + if (this->get_ip_address(&testaddress) == NSAPI_ERROR_OK) { version = testaddress.get_ip_version(); } } @@ -154,7 +144,7 @@ nsapi_value_or_error_t NetworkStack::getaddrinfo_async(const char *hostname, Soc // ip address of the underlying stack if (version == NSAPI_UNSPEC) { SocketAddress testaddress; - if (testaddress.set_ip_address(this->get_ip_address())) { + if (this->get_ip_address(&testaddress) == NSAPI_ERROR_OK) { version = testaddress.get_ip_version(); } } diff --git a/features/netsocket/NetworkStack.h b/features/netsocket/NetworkStack.h index 0184cd83be..b0d50a7013 100644 --- a/features/netsocket/NetworkStack.h +++ b/features/netsocket/NetworkStack.h @@ -51,9 +51,6 @@ public: */ virtual nsapi_error_t get_ip_address(SocketAddress *address); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual const char *get_ip_address(); - /** Get the IPv6 link local address * * @param address SocketAddress representation of the link local IPv6 address @@ -74,9 +71,6 @@ public: */ virtual nsapi_error_t get_ip_address_if(SocketAddress *address, const char *interface_name); - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual const char *get_ip_address_if(const char *interface_name); - /** Translates a hostname to an IP address with specific version * * The hostname may be either a domain name or an IP address. If the diff --git a/features/netsocket/OnboardNetworkStack.h b/features/netsocket/OnboardNetworkStack.h index cf1c7aa47f..78a5484084 100644 --- a/features/netsocket/OnboardNetworkStack.h +++ b/features/netsocket/OnboardNetworkStack.h @@ -112,9 +112,6 @@ public: /** @copydoc NetworkStack::get_ip_address */ virtual nsapi_error_t get_ip_address(SocketAddress *address) = 0; - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual char *get_ip_address(char *buf, nsapi_size_t buflen) = 0; - /** @copydoc NetworkStack::get_ipv6_link_local_address */ virtual nsapi_error_t get_ipv6_link_local_address(SocketAddress *address) { @@ -124,14 +121,8 @@ public: /** @copydoc NetworkStack::get_netmask */ virtual nsapi_error_t get_netmask(SocketAddress *address) = 0; - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual char *get_netmask(char *buf, nsapi_size_t buflen) = 0; - /** @copydoc NetworkStack::get_gateway */ virtual nsapi_error_t get_gateway(SocketAddress *address) = 0; - - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - virtual char *get_gateway(char *buf, nsapi_size_t buflen) = 0; }; /** Register a network interface with the IP stack diff --git a/features/netsocket/PPPInterface.cpp b/features/netsocket/PPPInterface.cpp index e66321d780..69325fb859 100644 --- a/features/netsocket/PPPInterface.cpp +++ b/features/netsocket/PPPInterface.cpp @@ -40,13 +40,13 @@ PPPInterface::~PPPInterface() _stack.remove_ppp_interface(&_interface); } -nsapi_error_t PPPInterface::set_network(const char *ip_address, const char *netmask, const char *gateway) +nsapi_error_t PPPInterface::set_network(const SocketAddress &ip_address, const SocketAddress &netmask, const SocketAddress &gateway) { - strncpy(_ip_address, ip_address ? ip_address : "", sizeof(_ip_address)); + strncpy(_ip_address, ip_address.get_ip_address() ? ip_address.get_ip_address() : "", sizeof(_ip_address)); _ip_address[sizeof(_ip_address) - 1] = '\0'; - strncpy(_netmask, netmask ? netmask : "", sizeof(_netmask)); + strncpy(_netmask, netmask.get_ip_address() ? netmask.get_ip_address() : "", sizeof(_netmask)); _netmask[sizeof(_netmask) - 1] = '\0'; - strncpy(_gateway, gateway ? gateway : "", sizeof(_gateway)); + strncpy(_gateway, gateway.get_ip_address() ? gateway.get_ip_address() : "", sizeof(_gateway)); _gateway[sizeof(_gateway) - 1] = '\0'; return NSAPI_ERROR_OK; @@ -83,15 +83,6 @@ nsapi_error_t PPPInterface::disconnect() return NSAPI_ERROR_NO_CONNECTION; } -const char *PPPInterface::get_ip_address() -{ - if (_interface && _interface->get_ip_address(_ip_address, sizeof(_ip_address))) { - return _ip_address; - } - - return NULL; -} - nsapi_error_t PPPInterface::get_ip_address(SocketAddress *address) { if (_interface && _interface->get_ip_address(address) == NSAPI_ERROR_OK) { @@ -123,24 +114,6 @@ nsapi_error_t PPPInterface::get_gateway(SocketAddress *address) return NSAPI_ERROR_NO_CONNECTION; } -const char *PPPInterface::get_netmask() -{ - if (_interface && _interface->get_netmask(_netmask, sizeof(_netmask))) { - return _netmask; - } - - return 0; -} - -const char *PPPInterface::get_gateway() -{ - if (_interface && _interface->get_gateway(_gateway, sizeof(_gateway))) { - return _gateway; - } - - return 0; -} - char *PPPInterface::get_interface_name(char *interface_name) { if (_interface) { diff --git a/features/netsocket/PPPInterface.h b/features/netsocket/PPPInterface.h index a98c409d93..292d9eb572 100644 --- a/features/netsocket/PPPInterface.h +++ b/features/netsocket/PPPInterface.h @@ -51,7 +51,7 @@ public: virtual ~PPPInterface(); /** @copydoc NetworkInterface::set_network */ - virtual nsapi_error_t set_network(const char *ip_address, const char *netmask, const char *gateway); + virtual nsapi_error_t set_network(const SocketAddress &ip_address, const SocketAddress &netmask, const SocketAddress &gateway); /** @copydoc NetworkInterface::connect */ virtual nsapi_error_t connect(); @@ -59,9 +59,6 @@ public: /** @copydoc NetworkInterface::disconnect */ virtual nsapi_error_t disconnect(); - /** @copydoc NetworkInterface::get_ip_address */ - virtual const char *get_ip_address(); - /** @copydoc NetworkInterface::get_ip_address */ virtual nsapi_error_t get_ip_address(SocketAddress *address); @@ -71,12 +68,6 @@ public: /** @copydoc NetworkInterface::get_gateway */ virtual nsapi_error_t get_gateway(SocketAddress *address); - /** @copydoc NetworkInterface::get_netmask */ - virtual const char *get_netmask(); - - /** @copydoc NetworkInterface::get_gateway */ - virtual const char *get_gateway(); - /** @copydoc NetworkInterface::get_interface_name */ virtual char *get_interface_name(char *interface_name); diff --git a/features/netsocket/TCPSocket.cpp b/features/netsocket/TCPSocket.cpp index 02c29095f8..662021104d 100644 --- a/features/netsocket/TCPSocket.cpp +++ b/features/netsocket/TCPSocket.cpp @@ -104,28 +104,6 @@ nsapi_error_t TCPSocket::connect(const SocketAddress &address) return ret; } -nsapi_error_t TCPSocket::connect(const char *host, uint16_t port) -{ - SocketAddress address; - if (!_socket) { - return NSAPI_ERROR_NO_SOCKET; - } - nsapi_error_t err; - if (!strcmp(_interface_name, "")) { - err = _stack->gethostbyname(host, &address); - } else { - err = _stack->gethostbyname(host, &address, NSAPI_UNSPEC, _interface_name); - } - if (err) { - return NSAPI_ERROR_DNS_FAILURE; - } - - address.set_port(port); - - // connect is thread safe - return connect(address); -} - nsapi_size_or_error_t TCPSocket::send(const void *data, nsapi_size_t size) { _lock.lock(); diff --git a/features/netsocket/TCPSocket.h b/features/netsocket/TCPSocket.h index 113581190c..87df0d960f 100644 --- a/features/netsocket/TCPSocket.h +++ b/features/netsocket/TCPSocket.h @@ -70,24 +70,6 @@ public: return NSAPI_ERROR_UNSUPPORTED; } - /** Connects TCP socket to a remote host - * - * Initiates a connection to a remote server specified by either - * a domain name or an IP address and a port. - * - * @param host Hostname of the remote host - * @param port Port of the remote host - * @retval NSAPI_ERROR_OK on success - * @retval NSAPI_ERROR_IN_PROGRESS if the operation is ongoing - * @retval NSAPI_ERROR_NO_SOCKET if the socket has not been allocated - * @retval NSAPI_ERROR_DNS_FAILURE if the DNS address of host could not be resolved - * @retval NSAPI_ERROR_IS_CONNECTED if the connection is already established - * @retval int Other negative error codes for stack-related failures. - * See NetworkStack::socket_connect(). - */ - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - nsapi_error_t connect(const char *host, uint16_t port); - /** Connects TCP socket to a remote host * * Initiates a connection to a remote server specified by the diff --git a/features/netsocket/TLSSocket.cpp b/features/netsocket/TLSSocket.cpp index 359613a98b..87ee46fa55 100644 --- a/features/netsocket/TLSSocket.cpp +++ b/features/netsocket/TLSSocket.cpp @@ -25,21 +25,6 @@ // This class requires Mbed TLS SSL/TLS client code #if defined(MBEDTLS_SSL_CLI_C) -nsapi_error_t TLSSocket::connect(const char *host, uint16_t port) -{ - nsapi_error_t ret = NSAPI_ERROR_OK; - if (!is_handshake_started()) { - ret = tcp_socket.connect(host, port); - if (ret == NSAPI_ERROR_OK || ret == NSAPI_ERROR_IN_PROGRESS) { - set_hostname(host); - } - if (ret != NSAPI_ERROR_OK && ret != NSAPI_ERROR_IS_CONNECTED) { - return ret; - } - } - return TLSSocketWrapper::start_handshake(ret == NSAPI_ERROR_OK); -} - TLSSocket::~TLSSocket() { /* Transport is a member of TLSSocket which is derived from TLSSocketWrapper. @@ -91,15 +76,6 @@ nsapi_error_t TLSSocket::set_client_cert_key(const char *client_cert_pem, const return set_client_cert_key(client_cert_pem, strlen(client_cert_pem), client_private_key_pem, strlen(client_private_key_pem)); } -nsapi_error_t TLSSocket::connect(const char *host, uint16_t port) -{ - nsapi_error_t ret = enable_tlssocket(); - if (ret == NSAPI_ERROR_OK) { - ret = TCPSocket::connect(host, port); - } - return ret; -} - nsapi_error_t TLSSocket::connect(const SocketAddress &address) { nsapi_error_t ret = enable_tlssocket(); diff --git a/features/netsocket/TLSSocket.h b/features/netsocket/TLSSocket.h index 4fde00379a..c40cb34100 100644 --- a/features/netsocket/TLSSocket.h +++ b/features/netsocket/TLSSocket.h @@ -80,22 +80,6 @@ public: using TLSSocketWrapper::connect; - /** Connects TCP socket to a remote host. - * - * Initiates a connection to a remote server specified by either - * a domain name or an IP address and port. - * - * @note: In case connect() returns NSAPI_ERROR_AUTH_FAILURE, - * the socket must be freed either by calling close() or destroying it. - * - * @param host Hostname of the remote host. - * @param port Port of the remote host. - * @return NSAPI_ERROR_OK on success, negative error code on failure. - * See @ref TLSSocketWrapper::connect. - */ - MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated") - nsapi_error_t connect(const char *host, uint16_t port); - private: TCPSocket tcp_socket; }; diff --git a/features/netsocket/emac-drivers/TARGET_Cypress/COMPONENT_WHD/interface/CyDhcpServer.cpp b/features/netsocket/emac-drivers/TARGET_Cypress/COMPONENT_WHD/interface/CyDhcpServer.cpp index 89464bd0d2..ca84423ff9 100644 --- a/features/netsocket/emac-drivers/TARGET_Cypress/COMPONENT_WHD/interface/CyDhcpServer.cpp +++ b/features/netsocket/emac-drivers/TARGET_Cypress/COMPONENT_WHD/interface/CyDhcpServer.cpp @@ -168,8 +168,9 @@ static void sendPacket(UDPSocket *socket, dhcp_packet_t *dhcp, uint32_t size) uint32_t broadcast_ip = 0xFFFFFFFF; char string_addr[16]; ipv4_to_string(string_addr, htonl(broadcast_ip)); + SocketAddress sock_addr(string_addr, IP_PORT_DHCP_CLIENT); - err = socket->sendto(string_addr, IP_PORT_DHCP_CLIENT, reinterpret_cast(dhcp), size); + err = socket->sendto(sock_addr, reinterpret_cast(dhcp), size); if (err < 0) { printf("DHCP ERROR: Packet send failure with error %d.", err); } else if (err != (int)size) { @@ -352,8 +353,11 @@ void CyDhcpServer::runServer(void) _socket.bind((uint16_t)IP_PORT_DHCP_SERVER); /* Save the current netmask to be sent in DHCP packets as the 'subnet mask option' */ - _server_addr.addrv4.addr = string_to_ipv4(_niface->get_ip_address()); - _netmask.addrv4.addr = string_to_ipv4(_niface->get_netmask()); + SocketAddress sock_addr; + _niface->get_ip_address(&sock_addr); + _server_addr.addrv4.addr = string_to_ipv4(sock_addr.get_ip_address()); + _niface->get_netmask(&sock_addr); + _netmask.addrv4.addr = string_to_ipv4(sock_addr.get_ip_address()); #ifdef DHCP_EXTENSIVE_DEBUG printf("DHCP Server started.\n"); diff --git a/features/netsocket/ppp/ppp_nsapi.cpp b/features/netsocket/ppp/ppp_nsapi.cpp index e02617da55..d7ad910d32 100644 --- a/features/netsocket/ppp/ppp_nsapi.cpp +++ b/features/netsocket/ppp/ppp_nsapi.cpp @@ -133,7 +133,9 @@ const char *nsapi_ppp_get_ip_addr(FileHandle *stream) static char ip_addr[IPADDR_STRLEN_MAX]; if (stream == my_stream) { - if (my_interface->get_ip_address(ip_addr, IPADDR_STRLEN_MAX)) { + SocketAddress addr; + if (my_interface->get_ip_address(&addr) == NSAPI_ERROR_OK) { + strncpy(ip_addr, addr.get_ip_address(), IPADDR_STRLEN_MAX); return ip_addr; } } @@ -148,7 +150,9 @@ const char *nsapi_ppp_get_netmask(FileHandle *stream) static char netmask[IPADDR_STRLEN_MAX]; if (stream == my_stream) { - if (my_interface->get_netmask(netmask, IPADDR_STRLEN_MAX)) { + SocketAddress addr; + if (my_interface->get_netmask(&addr)) { + strncpy(netmask, addr.get_ip_address(), IPADDR_STRLEN_MAX); return netmask; } } @@ -163,7 +167,9 @@ const char *nsapi_ppp_get_gw_addr(FileHandle *stream) static char gwaddr[IPADDR_STRLEN_MAX]; if (stream == my_stream) { - if (my_interface->get_gateway(gwaddr, IPADDR_STRLEN_MAX)) { + SocketAddress addr; + if (my_interface->get_gateway(&addr)) { + strncpy(gwaddr, addr.get_ip_address(), IPADDR_STRLEN_MAX); return gwaddr; } } diff --git a/targets/TARGET_WICED/TOOLCHAIN_ARMC6/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.ar b/targets/TARGET_WICED/TOOLCHAIN_ARMC6/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.ar index e759cb2147..182b811d58 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_ARMC6/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.ar and b/targets/TARGET_WICED/TOOLCHAIN_ARMC6/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.ar differ diff --git a/targets/TARGET_WICED/TOOLCHAIN_ARMC6/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.ar b/targets/TARGET_WICED/TOOLCHAIN_ARMC6/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.ar index 90ccf06ace..97061d8319 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_ARMC6/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.ar and b/targets/TARGET_WICED/TOOLCHAIN_ARMC6/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.ar differ diff --git a/targets/TARGET_WICED/TOOLCHAIN_ARMC6/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.ar b/targets/TARGET_WICED/TOOLCHAIN_ARMC6/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.ar index ef943012e0..35351a0a7c 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_ARMC6/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.ar and b/targets/TARGET_WICED/TOOLCHAIN_ARMC6/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.ar differ diff --git a/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.a b/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.a index 4d702a530b..5831bbd35e 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.a and b/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.a differ diff --git a/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.a b/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.a index 130b763b68..7c5c0ad53f 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.a and b/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.a differ diff --git a/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.a b/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.a index db5281d7dd..2946ffa988 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.a and b/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.a differ diff --git a/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.a b/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.a index c7efff2034..99ffb9698f 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.a and b/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.a differ diff --git a/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.a b/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.a index 9a33c5aa9f..16b99e8064 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.a and b/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.a differ diff --git a/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.a b/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.a index ceb262419d..f0ff1040ba 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.a and b/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.a differ