Skip to content

mbed-mesh-api: Add new API for Wi-SUN configuration #11181

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 3 commits into from
Aug 28, 2019

Conversation

artokin
Copy link
Contributor

@artokin artokin commented Aug 7, 2019

Description

Add new API for setting Wi-SUN:

  • network name

  • regulatory domain, operating mode and operating class

  • setting own and trusted certificate

  • removing own and trusted certificates

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[x] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@mikter , @mikaleppanen

Release Notes

Add new APIs to Wi-SUN network certificate handling and network configuration. This includes:

  • network name
  • regulatory domain, operating mode and operating class
  • setting own and trusted certificate
  • removing own and trusted certificates

@ciarmcom ciarmcom requested review from mikaleppanen, mikter and a team August 7, 2019 15:00
@ciarmcom
Copy link
Member

ciarmcom commented Aug 7, 2019

@artokin, thank you for your changes.
@mikter @mikaleppanen @ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-maintainers please review.

* \return MESH_ERROR_NONE on success.
* \return MESH_ERROR_UNKNOWN in case of failure.
* */
mesh_error_t network_regulatory_domain_set(uint8_t regulatory_domain = 0xff, uint8_t operating_class = 0xff, uint8_t operating_mode = 0xff);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With each of the parameters 0xFF means what, an invalid value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, a comment added to explain 0xff.

*
* \param network_name Network name as NUL terminated string. Can't exceed 32 characters and can't be NULL.
* \return MESH_ERROR_NONE on success.
* \return MESH_ERROR_UNKNOWN in case of failure.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All fails are Unknown?

int wisun_network_name_len = sizeof(MBED_CONF_MBED_MESH_API_WISUN_NETWORK_NAME);
wisun_settings_str.network_name = (char *)ns_dyn_mem_alloc(wisun_network_name_len);
if (!wisun_settings_str.network_name) {
return -3;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magic number.


strcpy(wisun_settings_str.network_name, network_name_ptr);

if (wisun_tasklet_data_ptr && wisun_tasklet_data_ptr->tasklet_state == TASKLET_STATE_BOOTSTRAP_READY) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be called any time after interface up even during bootstrap. I think in here you should have flexibility for it even before bootstrap is ready

@artokin artokin force-pushed the mbed_wisun_api_update branch from 661b312 to 631532c Compare August 8, 2019 14:44
@artokin
Copy link
Contributor Author

artokin commented Aug 20, 2019

This PR requires uses a new Nanostack API that is not available in Mbed OS yet.
Once the new Nanostack is available then this PR can proceed.

Arto Kinnunen added 3 commits August 28, 2019 09:34
Add new API for setting Wi-SUN:
 -network name
 -regulatory domain, operating mode and operating class
Add new API for setting Wi-SUN:
-Setting own/trusted certificates
-Removing own/trusted certificates
@artokin artokin force-pushed the mbed_wisun_api_update branch from 5b9ee9b to f8289ec Compare August 28, 2019 06:37
@artokin
Copy link
Contributor Author

artokin commented Aug 28, 2019

PR rebased as #11335 is already in.
Please re-review.

@artokin
Copy link
Contributor Author

artokin commented Aug 28, 2019

One approval received, CI started

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 28, 2019

Add new API for setting Wi-SUN:

This is not fix but functionality change, please add Release notes with details about this new API.

@mbed-ci
Copy link

mbed-ci commented Aug 28, 2019

Test run: FAILED

Summary: 2 of 4 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-GCC_ARM
  • jenkins-ci/mbed-os-ci_build-ARM

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 28, 2019

CI restarted (timeout, should be fixed now in CI)

@mbed-ci
Copy link

mbed-ci commented Aug 28, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

@0xc0170 0xc0170 merged commit d6304e3 into ARMmbed:master Aug 28, 2019
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 28, 2019

I updated the release note to extend what we are adding.

@artokin artokin deleted the mbed_wisun_api_update branch August 29, 2019 07:32
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.

8 participants