-
Notifications
You must be signed in to change notification settings - Fork 3k
Lora unittests #8233
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
Lora unittests #8233
Conversation
@hasnainvirk @kivaisan Please review |
UNITTESTS/features/cellular/framework/AT/at_cellularinformation/unittest.cmake
Show resolved
Hide resolved
tr_debug("state_controller: Unknown state!"); | ||
status = LORAWAN_STATUS_SERVICE_UNKNOWN; | ||
//Because this is internal function only coding error causes this | ||
MBED_ASSERT(false); |
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.
But in release profile we shouldn't return LORAWAN_STATUS_OK either. So I would keep the original code but also have the assert.
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.
Please keep the original code here. Or just add assert at the end after the original code. As @kivaisan mentioned, release build would strip off asserts.
@@ -93,8 +93,7 @@ void LoRaMacCommand::parse_mac_commands_to_repeat() | |||
case MOTE_MAC_LINK_CHECK_REQ: { // 0 byte payload | |||
break; | |||
} | |||
default: | |||
break; | |||
default: {}//Cannot happen |
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 think assert should be added here as well. Default can only happen if MAC command is missing from case list.
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.
Yes. Assert should happen here. I am seeing a case with 1.1 where a corrupted message is mistaken as a mac command and it falls here.
@@ -1343,7 +1300,7 @@ lorawan_status_t LoRaPHY::add_channel(const channel_params_t *new_channel, | |||
// Default channels don't accept all values | |||
if (id < phy_params.default_channel_cnt) { | |||
// Validate the datarate range for min: must be DR_0 | |||
if (new_channel->dr_range.fields.min > phy_params.min_tx_datarate) { | |||
if (new_channel->dr_range.fields.min != DR_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.
Should this be something like this:
// Validate the datarate range for min: must be greater than min_tx_datarate
if (new_channel->dr_range.fields.min > phy_params.min_tx_datarate) {
dr_invalid = true;
}
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.
@kivaisan Actually no. This code is correct because for default channels minimum data-rate is 0 always. So if it is not DR_0, it's invalid.
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.
Ok.
) | ||
|
||
# defines | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_PHY=\"EU868\"") |
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 we need CMAKE_C_FLAGS ? I think CMAKE_CXX_FLAGS would do. Everything is C++ code 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.
It does not harm to have those
@AnttiKauppila A general comment: Perhaps we should change the title as the PR touches plenty of other modules inside Mbed OS. Plus we may want to do a little squashing here as we have progression of related commits which may go in one or two functional commits. |
c5e98b3
to
5b7302a
Compare
Review comments visited and fixed where needed. |
Looks good to me +1. |
@hasnainvirk We need all those stubs to make the code compile. So anything which is under UNITTESTS/ folder are not touching modules in mbed-os |
5b7302a
to
d55749c
Compare
d55749c
to
380c886
Compare
380c886
to
48e2ccd
Compare
@0xc0170 This is reviewed |
/morph build |
Build : SUCCESSBuild number : 3205 Triggering tests/morph test |
Test : SUCCESSBuild number : 3005 |
Exporter Build : ABORTEDBuild number : 2797 |
One failure there caught earlier, will restart |
@0xc0170 Has this been restarted? |
Blocked on #8297, exporters are failing |
/morph export-build |
Exporter Build : SUCCESSBuild number : 2842 |
Description
LoRaWAN classes unittested and small fixes done while testing
Also failing unittests were fixed
Pull request type