Fixing changes to make greentea test mbed-os-tests-netsocket-connectivity pass for target Realtek AMEBA

pull/5649/head
Prashant Ravi 2017-12-04 18:09:22 +08:00
parent 2e1c2a1cdf
commit 1fcfced203
2 changed files with 8 additions and 5 deletions

View File

@ -594,11 +594,13 @@ nsapi_error_t mbed_lwip_emac_init(emac_interface_t *emac)
// Backwards compatibility with people using DEVICE_EMAC
nsapi_error_t mbed_lwip_init(emac_interface_t *emac)
{
nsapi_error_t ret;
nsapi_error_t ret = NSAPI_ERROR_OK;
mbed_lwip_core_init();
ret = mbed_lwip_emac_init(emac);
if (ret == NSAPI_ERROR_OK) {
netif_inited = true;
if(netif_inited == false){
ret = mbed_lwip_emac_init(emac);
if (ret == NSAPI_ERROR_OK) {
netif_inited = true;
}
}
return ret;
}

View File

@ -228,8 +228,9 @@ nsapi_error_t RTWInterface::connect(const char *ssid, const char *pass,
nsapi_error_t RTWInterface::disconnect()
{
char essid[33];
wlan_emac_link_change(false);
mbed_lwip_bringdown();
if(wifi_is_connected_to_ap() != RTW_SUCCESS)
return NSAPI_ERROR_NO_CONNECTION;
if(wifi_disconnect()<0){