Skip to content

Commit e06923c

Browse files
committed
Make Nanostack C++ constructor initialise Nanostack
Nanostack object constructor didn't actually initialise Nanostack. Nanostack initialisation was deferred until an interface was actually attached to the stack, which generally happened at first interface connect. Not normally a problem, unless you're trying to make direct Nanostack setup calls prior to connect - some applications do this, and were relying on ThreadInterface::initialise to do Nanostack initialisation. Unfortunately in 5.9 ThreadInterface::initialise no longer does initialise Nanostack immediately, because the mesh interfaces were aligned and integrated with the Ethernet interfaces, which did initialisation on connect(). Make the Nanostack object constructor initialise Nanostack (as the LWIP constructor does for lwIP), so calling Nanostack::get_instance() is the 5.9 API for Nanostack initialisation. For future work, APIs like ns_file_system_set_root_path should be exposed as methods of Nanostack, so everything happens with a single Nanostack::get_instance().file_system_set_root_path().
1 parent 5d8570b commit e06923c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

features/nanostack/nanostack-interface/Nanostack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ void NanostackSocket::event_connection_reset(socket_callback_t *sock_cb)
449449
Nanostack::Nanostack()
450450
: call_event_tasklet(-1)
451451
{
452-
452+
mesh_system_init();
453453
}
454454

455455
void Nanostack::call_event_tasklet_main(arm_event_s *event)

0 commit comments

Comments
 (0)