mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			Correct NetworkStackWrapper::get_ip_address
Previous change that removed string-based APIs missed `NetworkStackWrapper::get_ip_address`. Remove string-based method (which is not overriding anything in `NetworkStack`) and add missing binary form to implement `NetworkStack::get_ip_address`.pull/12487/head
							parent
							
								
									8f1bf967d3
								
							
						
					
					
						commit
						695e872202
					
				| 
						 | 
					@ -235,17 +235,15 @@ private:
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
    using NetworkStack::get_ip_address;
 | 
					    virtual nsapi_error_t get_ip_address(SocketAddress *address)
 | 
				
			||||||
    using NetworkStack::gethostbyname;
 | 
					 | 
				
			||||||
    virtual const char *get_ip_address()
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (!_stack_api()->get_ip_address) {
 | 
					        if (!_stack_api()->get_ip_address) {
 | 
				
			||||||
            return 0;
 | 
					            return NSAPI_ERROR_UNSUPPORTED;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        static uint8_t buffer[sizeof(SocketAddress)];
 | 
					        *address = SocketAddress(_stack_api()->get_ip_address(_stack()));
 | 
				
			||||||
        SocketAddress *address = new (buffer) SocketAddress(_stack_api()->get_ip_address(_stack()));
 | 
					
 | 
				
			||||||
        return address->get_ip_address();
 | 
					        return *address ? NSAPI_ERROR_OK : NSAPI_ERROR_NO_ADDRESS;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    virtual nsapi_error_t gethostbyname(const char *name, SocketAddress *address, nsapi_version_t version, const char *interface_name)
 | 
					    virtual nsapi_error_t gethostbyname(const char *name, SocketAddress *address, nsapi_version_t version, const char *interface_name)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue