-
Notifications
You must be signed in to change notification settings - Fork 3k
LoRa refactoring #6279
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 refactoring #6279
Conversation
@kjbracey-arm, @kivaisan please review this. |
Looking at the changes, isn't this breaking change (should it be labeled as such in the PR type) ? |
Doesn't "breaking change" mean that API is somehow changed? |
@AnttiKauppila yes breaking change means either a change in API, OR a change in behaviour from the users perspective. If this has neither then it is just refactor and can go into a patch release. |
features/lorawan/LoRaWANStack.h
Outdated
uint8_t _num_retry; | ||
events::EventQueue *_queue; | ||
bool _duty_cycle_on; | ||
uint8_t _app_port; |
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.
We can save some padding bytes by moving _app_port next to _num_retry
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.
Fixed
@@ -416,8 +426,8 @@ lorawan_status_t LoRaMacCommand::process_mac_commands(uint8_t *payload, | |||
|
|||
bool LoRaMacCommand::is_sticky_mac_command_pending() | |||
{ | |||
//DEAD CODE: mac_cmd_buf_idx_to_repeat is never set |
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 actually a bug in void LoRaMacCommand::parse_mac_commands_to_repeat(). Add
mac_cmd_buf_idx_to_repeat = cmd_cnt;
to the end of that function.
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.
Fixed
/** | ||
* Indicates if there are any pending sticky MAC commands | ||
*/ | ||
bool sticky_mac_cmd; |
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.
We now have two similar variables (sticky_mac_cmd vs. mac_cmd_buf_idx_to_repeat). We can later check if these could be combined.
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 new variable is used in add_mac_command() and merging it with mac_cmd_buf_idx_to_repeat would mean that if the value is non-zero it should be increased but how much, we need to investigate. Plus it might be potential to cause a break in functionality, so we will leave it later as you suggested.
/morph build |
Build : SUCCESSBuild number : 1389 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 1044 |
Test : SUCCESSBuild number : 1178 |
When will this merge happen? |
We will have gatekeeping most likely today (we were preparing two release candidates and faced some CI related issues). |
@AnttiKauppila It looks like this PR will need to be rebased, due to an earlier LORA-related PR being brought in. |
Conflict resolved |
@AnttiKauppila Please undo your last commit, and rebase your changes with master. Our release process does not work well with merge commits from master within PRs. I can start CI as soon as that's corrected. |
- LoRaMacCommand does not have any external dependencies anymore - Also LoRaMacMlme is not using LoRaMacCommand anymore
- get_phy_params function was very heavy weight and needed to be refactored. - switch-case clauses have been refactored to be functions now and the complexity of the usage has been improved a lot. - There are no functional changes, this is internal only change
- Internal refactoring only, no functional changes
Build : SUCCESSBuild number : 1474 Triggering tests/morph test |
Test : FAILUREBuild number : 1250 |
Exporter Build : SUCCESSBuild number : 1119 |
ci-morph test has now failed 3 times in a row (different reasons) and none of the failures is related to LoRa??? |
@0xc0170 Can this be rebuild? |
@studavekar Please review I'll check the rest of the queue if it has similar issues /morph test |
Test : SUCCESSBuild number : 1253 |
@kjbracey-arm Can you review this refactor? |
It looks like this is going to last forever, so I am planning to push 20+ commits extra on this tomorrow. Then the initial message will be changed as well, because of new feature will be introduced. |
@AnttiKauppila If you push a new feature then this moves out to 5.9 |
It's ready, just would like @kjbracey-arm to have a last approval and goes in. We should not mix features-bugs-other things together. And adding here 20 commits won't help getting this faster. |
Flash - clock and cache test - failure - #6224 - workaround - #6340 ST Link device issues. - Fix cold boot device so communication link is restored |
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.
Fine for master, but I would query the 5.8.1 label regardless. Do we really want general refactoring in patch releases, if it's not fixing a specific bug and has a chance of accidentally introducing a new one?
I am fine with 5.9 label |
@0xc0170 Who will do the merge for this? |
🖐️ |
Description
Internal refactoring for LoRa done.
report_mbed-lora-tests-private-tests-lorawan-abp.html: >> Test cases: 2 passed, 0 failed
report_mbed-lora-tests-private-tests-lorawan-basic.html: >> Test cases: 18 passed, 0 failed
report_mbed-lora-tests-private-tests-lorawan-extended.html: >> Test cases: 13 passed, 0 failed
report_mbed-lora-tests-private-tests-lorawan-otaa_with_json_incorrect.html: >> Test cases: 1 passed, 0 failed
report_mbed-lora-tests-private-tests-lorawan-private_otaa.html: >> Test cases: 1 passed, 0 failed
Pull request type