Skip to content

Make Nanostack C++ constructor initialise Nanostack #7173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2018

Conversation

kjbracey
Copy link
Contributor

@kjbracey kjbracey commented Jun 8, 2018

Description

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().

Pull request type

[X] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

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().
@kjbracey kjbracey requested a review from a team June 8, 2018 10:03
@0xc0170
Copy link
Contributor

0xc0170 commented Jun 10, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jun 10, 2018

Build : SUCCESS

Build number : 2305
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7173/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Jun 10, 2018

@mbed-ci
Copy link

mbed-ci commented Jun 11, 2018

@cmonr cmonr merged commit 084e747 into ARMmbed:master Jun 11, 2018
@kjbracey kjbracey deleted the ns-init branch June 18, 2018 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants