Skip to content

Commit a47c6b8

Browse files
author
Deepika
committed
Nanostack: Add required header file and namespace element instead add all
1 parent 1fe6337 commit a47c6b8

File tree

7 files changed

+14
-11
lines changed

7 files changed

+14
-11
lines changed

features/nanostack/mbed-mesh-api/source/LoWPANNDInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Nanostack::LoWPANNDInterface *LoWPANNDInterface::get_interface() const
3535
nsapi_error_t LoWPANNDInterface::do_initialize()
3636
{
3737
if (!_interface) {
38-
_interface = new (nothrow) Nanostack::LoWPANNDInterface(*_phy);
38+
_interface = new (std::nothrow) Nanostack::LoWPANNDInterface(*_phy);
3939
if (!_interface) {
4040
return NSAPI_ERROR_NO_MEMORY;
4141
}

features/nanostack/mbed-mesh-api/source/NanostackEMACInterface.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ int8_t EMACPhy::phy_register()
138138
phy.phy_tx_done_cb = NULL;
139139

140140
emac.set_memory_manager(memory_manager);
141-
emac.set_link_input_cb(callback(this, &EMACPhy::emac_phy_rx));
141+
emac.set_link_input_cb(mbed::callback(this, &EMACPhy::emac_phy_rx));
142142

143143
if (!emac.power_up()) {
144144
return -1;
@@ -183,7 +183,7 @@ nsapi_error_t Nanostack::add_ethernet_interface(EMAC &emac, bool default_if, Nan
183183
return NSAPI_ERROR_DEVICE_ERROR;
184184
}
185185

186-
single_phy = new (nothrow) EMACPhy(this->memory_manager, emac);
186+
single_phy = new (std::nothrow) EMACPhy(this->memory_manager, emac);
187187
if (!single_phy) {
188188
return NSAPI_ERROR_NO_MEMORY;
189189
}
@@ -194,7 +194,7 @@ nsapi_error_t Nanostack::add_ethernet_interface(EMAC &emac, bool default_if, Nan
194194

195195
Nanostack::EthernetInterface *interface;
196196

197-
interface = new (nothrow) Nanostack::EthernetInterface(*single_phy);
197+
interface = new (std::nothrow) Nanostack::EthernetInterface(*single_phy);
198198
if (!interface) {
199199
return NSAPI_ERROR_NO_MEMORY;
200200
}

features/nanostack/mbed-mesh-api/source/NanostackEthernetInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ nsapi_error_t NanostackEthernetInterface::initialize(NanostackEthernetPhy *phy)
3838
return NSAPI_ERROR_PARAMETER;
3939
}
4040

41-
_interface = new (nothrow) Nanostack::EthernetInterface(*phy);
41+
_interface = new (std::nothrow) Nanostack::EthernetInterface(*phy);
4242
if (!_interface) {
4343
return NSAPI_ERROR_NO_MEMORY;
4444
}

features/nanostack/mbed-mesh-api/source/ThreadInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Nanostack::ThreadInterface *ThreadInterface::get_interface() const
7979
nsapi_error_t ThreadInterface::do_initialize()
8080
{
8181
if (!_interface) {
82-
_interface = new (nothrow) Nanostack::ThreadInterface(*_phy);
82+
_interface = new (std::nothrow) Nanostack::ThreadInterface(*_phy);
8383
if (!_interface) {
8484
return NSAPI_ERROR_NO_MEMORY;
8585
}

features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_timer.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@
1717
// Include before mbed.h to properly get UINT*_C()
1818
#include "ns_types.h"
1919

20-
#include "mbed.h"
2120
#include "platform/SingletonPtr.h"
2221
#include "platform/arm_hal_timer.h"
2322
#include "platform/arm_hal_interrupt.h"
24-
#include <mbed_assert.h>
23+
#include "platform/mbed_assert.h"
24+
#include "Timeout.h"
25+
#include "Timer.h"
26+
#include "events/Event.h"
27+
#include "events/mbed_shared_queues.h"
28+
29+
using namespace mbed;
30+
using namespace events;
2531

2632
static SingletonPtr<Timer> timer;
2733
static SingletonPtr<Timeout> timeout;

features/nanostack/nanostack-interface/Nanostack.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
/* Nanostack implementation of NetworkSocketAPI */
1919

20-
#include "mbed.h"
21-
#include "rtos.h"
2220
#include "Nanostack.h"
2321
#include "NanostackLockGuard.h"
2422

features/nanostack/nanostack-interface/Nanostack.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#ifndef NANOSTACK_H_
1919
#define NANOSTACK_H_
2020

21-
#include "mbed.h"
2221
#include "OnboardNetworkStack.h"
2322
#include "NanostackMemoryManager.h"
2423
#include "MeshInterface.h"

0 commit comments

Comments
 (0)