Skip to content

Commit 0b38cb8

Browse files
DeepikaCruz Monrreal II
authored andcommitted
Fix header files used in esp8266
"ns_types.h" results in build failure when networking feature is ignored with .mbedignored. ESP8266 component should be enabled only when NSAPI is present.
1 parent ea96ee9 commit 0b38cb8

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

components/wifi/esp8266-driver/ESP8266/ESP8266.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
#ifdef MBED_CONF_NSAPI_PRESENT
1718
#include <string.h>
1819
#include <stdint.h>
1920
#include <stdlib.h>
@@ -1097,3 +1098,4 @@ nsapi_connection_status_t ESP8266::connection_status() const
10971098
{
10981099
return _conn_status;
10991100
}
1101+
#endif

components/wifi/esp8266-driver/ESP8266/ESP8266.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#ifndef ESP8266_H
1818
#define ESP8266_H
1919

20+
#ifdef MBED_CONF_NSAPI_PRESENT
2021
#include <stdint.h>
2122

2223
#include "drivers/UARTSerial.h"
@@ -455,5 +456,5 @@ class ESP8266 {
455456
nsapi_connection_status_t _conn_status;
456457
mbed::Callback<void()> _conn_stat_cb; // ESP8266Interface registered
457458
};
458-
459+
#endif
459460
#endif

components/wifi/esp8266-driver/ESP8266Interface.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
#ifdef MBED_CONF_NSAPI_PRESENT
18+
1719
#include <string.h>
1820
#include <stdint.h>
1921

@@ -678,3 +680,4 @@ void ESP8266Interface::proc_oob_evnt()
678680
_esp.bg_process_oob(ESP8266_RECV_TIMEOUT, true);
679681
}
680682
}
683+
#endif

components/wifi/esp8266-driver/ESP8266Interface.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#ifndef ESP8266_INTERFACE_H
1818
#define ESP8266_INTERFACE_H
1919

20+
#ifdef MBED_CONF_NSAPI_PRESENT
2021
#include "ESP8266/ESP8266.h"
2122
#include "events/EventQueue.h"
2223
#include "events/mbed_shared_queues.h"
@@ -359,5 +360,5 @@ class ESP8266Interface : public NetworkStack, public WiFiInterface {
359360
void proc_oob_evnt();
360361
void _oob2global_event_queue();
361362
};
362-
363+
#endif
363364
#endif

0 commit comments

Comments
 (0)