Skip to content

Commit fc24d80

Browse files
prashantraradbridge
authored andcommitted
Fixing changes to make greentea test mbed-os-tests-netsocket-connectivity pass for target Realtek AMEBA
1 parent 5b81d88 commit fc24d80

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

features/FEATURE_LWIP/lwip-interface/lwip_stack.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -594,11 +594,13 @@ nsapi_error_t mbed_lwip_emac_init(emac_interface_t *emac)
594594
// Backwards compatibility with people using DEVICE_EMAC
595595
nsapi_error_t mbed_lwip_init(emac_interface_t *emac)
596596
{
597-
nsapi_error_t ret;
597+
nsapi_error_t ret = NSAPI_ERROR_OK;
598598
mbed_lwip_core_init();
599-
ret = mbed_lwip_emac_init(emac);
600-
if (ret == NSAPI_ERROR_OK) {
601-
netif_inited = true;
599+
if(netif_inited == false){
600+
ret = mbed_lwip_emac_init(emac);
601+
if (ret == NSAPI_ERROR_OK) {
602+
netif_inited = true;
603+
}
602604
}
603605
return ret;
604606
}

targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,9 @@ nsapi_error_t RTWInterface::connect(const char *ssid, const char *pass,
247247
nsapi_error_t RTWInterface::disconnect()
248248
{
249249
char essid[33];
250-
250+
251251
wlan_emac_link_change(false);
252+
mbed_lwip_bringdown();
252253
if(wifi_is_connected_to_ap() != RTW_SUCCESS)
253254
return NSAPI_ERROR_NO_CONNECTION;
254255
if(wifi_disconnect()<0){

0 commit comments

Comments
 (0)