-
Notifications
You must be signed in to change notification settings - Fork 3k
Added new configuration parameters to Wi-SUN network interface and Border Router class #12657
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
Added new configuration parameters to Wi-SUN network interface and Border Router class #12657
Conversation
@mikaleppanen, thank you for your changes. |
* \return MESH_ERROR_NONE on success. | ||
* \return MESH_ERROR_UNKNOWN in case of failure. | ||
* */ | ||
mesh_error_t set_fhss_broadcast_channel_function(uint8_t channel_function, uint16_t fixed_channel = 0xffff, uint8_t dwell_interval = 0x00, uint32_t broadcast_interval = 0x00); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FHSS is not needed in the name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corrected
mesh_error_t WisunBorderRouter::start(NetworkInterface *mesh_if, NetworkInterface *backbone_if) | ||
{ | ||
InterfaceNanostack *nano_mesh_if = reinterpret_cast<InterfaceNanostack *>(mesh_if); | ||
int8_t mesh_if_id = nano_mesh_if->get_interface_id(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there null check needed it could be in if?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added null checks
|
||
mesh_error_t WisunBorderRouter::stop() | ||
{ | ||
if (_mesh_if_id < 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there really a need to return error on unknown usually pointless when you are shutting down
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed return parameter
#if (MBED_CONF_MBED_MESH_API_WISUN_REGULATORY_DOMAIN != 255) || (MBED_CONF_MBED_MESH_API_WISUN_OPERATING_CLASS != 255) || (MBED_CONF_MBED_MESH_API_WISUN_OPERATING_MODE != 255) | ||
status = set_network_regulatory_domain(MBED_CONF_MBED_MESH_API_WISUN_REGULATORY_DOMAIN, | ||
MBED_CONF_MBED_MESH_API_WISUN_OPERATING_CLASS, | ||
MBED_CONF_MBED_MESH_API_WISUN_OPERATING_MODE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not look like you are able to call changes on these parameters before calling connect
It was previously collected in structure at creation and could be modified by user calling functions and then before interface up these were called
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This configuration is made on network interface init. So after that and before connect() is called, it is possible to change the settings similarly as previously.
There is no need for settings cache on application side, since on the new configuration system, the settings can be programmed directly to Wi-SUN stack after the init.
/** | ||
* \brief Validate Wi-SUN RPL DIO trickle parameters. | ||
* | ||
* Function validates DIO trickle timer Imin, DIO trickle timer Imax and DIO trickle timer redundancy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you please describe when and why validate
function should be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added brief description
* | ||
* Function reads network name from mbed-mesh-api. | ||
* | ||
* \param network_name Network name as NUL terminated string. Must have space for 32 characters and null terminator (in total 33 characters). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be shorter like Must have space for 33 characters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corrected
* When network size is changed, and if timing or RPL values should be other than defaults set by stack for the network size, | ||
* they need to set again using above function calls. | ||
* | ||
* \param network_size Values defined in Wi-SUN management API. Automatic 0x00, small 0x01, medium 0x08, large 0x10 and certificate 0xff. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is error prone if values are changed in the future.
Could we use NETWORK_SIZE_XX
constants from ws_management_api.h? Or should WiSUN-Interface define its own constants and map them to NETWORK_SIZE
before calling the nanostack api?
There is already today mismatch as Certificate 0 and automatic is 0xff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added enum
* | ||
* Function reads network size from mbed-mesh-api. | ||
* | ||
* \param network_size Values defined in Wi-SUN management API. Automatic 0x00, small 0x01, medium 0x08, large 0x10 and certificate 0xff. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, can we use NETWORK_SIZE
constants?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added enum
* | ||
* Function validates network size from mbed-mesh-api. | ||
* | ||
* \param network_size Values defined in Wi-SUN management API. Automatic 0x00, small 0x01, medium 0x08, large 0x10 and certificate 0xff. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added enum
* | ||
* Function overwrites parameters defined by Mbed OS configuration. | ||
* | ||
* \param channel_function Values defined in Wi-SUN management API. Fixed 0x00, TR51CF 0x01, DH1CF 0x02 and vendor defined 0x03. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using hardcoded constants, can we use CHANNEL_FUNCTION_
somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added enum
return MESH_ERROR_UNKNOWN; | ||
} | ||
|
||
int backbone_if_id = atoi(&backbone_if_name[3]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can get_interface_name
be renamed and extended to return also if_id? Or maybe separate method for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interface id is a nanostack specific feature, so I think we should not add high level NetworkInterface.h (or EMACInterface.h) methods for that, if we can avoid it.
We might need at some point to change for backhaul from NetworkInterface::get_default_instance() to more specific nanostack backhaul interface constructors, but a the moment the default instance is working as it is.
@amarjeet-arm @gkumaar @debdeep-arm @prashant-arm @umesh-arm Here is the configuration interface pull request to mbed-os |
corrected coding style |
* Medium network size: hundreds of devices | ||
* Large network size: thousands of devices | ||
* Automatic: when discovering the network, network size is learned from advertisements and timings adjusted accordingly | ||
* Certificate: used on testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should limit the network size in this interface by enum it could be from 0 to 20 or something
Then just assign values for those points that we have inside stack
Otherwise changing this later on becomes really hard
Also Automatic is not valid option and should not be here
0 == 25 less
1 == 100
2== 200
10 == 1000
20 == 10000
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nanostack interface has these fixed values (and only those are supported):
#define NETWORK_SIZE_CERTIFICATE 0x00
#define NETWORK_SIZE_SMALL 0x01
#define NETWORK_SIZE_MEDIUM 0x08
#define NETWORK_SIZE_LARGE 0x10
#define NETWORK_SIZE_AUTOMATIC 0xFF
so will I add a conversion to mesh api so that 0 --> 6 means small, 7 - 12 medium, 13 to 18 large etc...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed network size to hundreds of devices, removed defines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like that automatic. It was causing more problems at nano stack side.
updated based on comments |
|
||
mesh_error_t WisunBorderRouter::start(NetworkInterface *mesh_if, OnboardNetworkStack::Interface *backbone_if) | ||
{ | ||
InterfaceNanostack *nano_mesh_if = reinterpret_cast<InterfaceNanostack *>(mesh_if); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need null checks here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only thing what I would like to remove is that network size automatic. It is nice idea but not a good in practise.
@mikaleppanen Can you review travis failures to compile events? |
Any update for this PR? |
This PR cannot be merged due to conflicts. Please rebase to resolve them. |
New version of nanostack is now on feature-wisun branch. Rebased commits. |
@0xc0170 can this proceed? |
Set for CI, will schedule |
CI started |
Test run: FAILEDSummary: 1 of 11 test jobs failed Failed test jobs:
|
wisun restarted, all fine now |
@artokin merge if its ready |
Summary of changes
Impact of changes
Migration actions required
Documentation
Pull request type
Test results
Reviewers
@mikter @artokin @juhhei01 @JarkkoPaso