Skip to content

Commit 150fd07

Browse files
authored
Merge pull request #2375 from geky/expose-nsapi
Expose the network-socket API through mbed.h
2 parents 8e24d68 + a7d6aa5 commit 150fd07

File tree

7 files changed

+13
-8
lines changed

7 files changed

+13
-8
lines changed

features/FEATURE_CLIENT/mbed-client-classic/source/m2mconnectionhandlerpimpl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "eventOS_scheduler.h"
2828

2929
#include "mbed-trace/mbed_trace.h"
30+
#include "mbed.h"
3031

3132
#define TRACE_GROUP "mClt"
3233

features/net/network-socket/Socket.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
#include "Socket.h"
18+
#include "mbed.h"
1819

1920
Socket::Socket()
2021
: _stack(0)

features/net/network-socket/Socket.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
#include "rtos/Mutex.h"
2323
#include "Callback.h"
2424

25-
#ifndef NSAPI_NO_INCLUDE_MBED
26-
#include "mbed.h" // needed for backwards compatability
27-
#endif
28-
2925

3026
/** Abstract socket class
3127
*/

features/net/network-socket/TCPServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#include "TCPServer.h"
18-
#include "Timer.h"
18+
#include "mbed.h"
1919

2020
TCPServer::TCPServer()
2121
: _pending(0), _accept_sem(0)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "nsapi",
3+
"config": {
4+
"present": 1
5+
}
6+
}

features/net/network-socket/nsapi.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
// entry point for nsapi types
2222
#include "nsapi_types.h"
2323

24-
// disable bug-compatible mbed inclusion
25-
#define NSAPI_NO_INCLUDE_MBED
26-
2724
#ifdef __cplusplus
2825

2926
// entry point for C++ api

hal/api/mbed.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
#include "rtos/rtos.h"
2323
#endif
2424

25+
#if MBED_CONF_NSAPI_PRESENT
26+
#include "network-socket/nsapi.h"
27+
#endif
28+
2529
#include "toolchain.h"
2630
#include "platform.h"
2731

0 commit comments

Comments
 (0)