-
Notifications
You must be signed in to change notification settings - Fork 134
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
Add MAC command tests and improve MAC layer implementation #184
Open
non-det-alle
wants to merge
25
commits into
develop
Choose a base branch
from
mac-cmd-tests
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…up and modernize c++, fix printing output
… end-device, tests
… unit of measure, add tests
…ting, clarify margin code
- add missing EU868 radio sub-bands and fix tests - downgrade SubBand from Object to SimpleRefCount - remove unused default constructor/destructor - refactor BelongsToSubBand to Contains for clarity - re-add last frequency getter
- downgrade LogicalLoraChannel from Object to SimpleRefCount - remove unused default constructor/destructor and incomplete initializer constructor - remove setters (constructor initialization only) - refactor SetEnabledForUplink to EnableForUplink (align with DisableForUplink)
- redo the channel storage model to be aligned with LoRaWAN specifications: a fixed size array of channels accessed by index - GetRawChannelArray replaces GetChannelList and GetEnabledChannelList as the only way to get channels: the MAC layer now performs its channel-related tasks (get wait time, get TX channel, change channel mask) outside of this class with just one sweep through of the array - AddChannel becomes just SetChannel at index, in line with the channel storage structure found in the LoRaWAN specifications - Similarly, discard RemoveChannel function: channels can be overwritten in the internal array with SetChannel as in specifications - downgrade LogicalLoraChannelHelper from Object to SimpleRefCount - add size initialization to constructor, remove default constructor - remove aggregated duty-cycle management (already managed by external MAC layer) - FIX duty-cycle next transmission time calculation in AddEvent - add channel validity check - add GetWaitingTime overload by frequency (that's what it is needed to get the wait time, no need to create an ad-hoc channel instance just to retrieve the wait time) - add AddEvent overload by frequency (same reason as above) - add GetTxPowerForChannel overload by frequency (same reason as above) - remove channel addition by frequency, leading to incomplete tx channel creation (i.e. default values) + param duplication. This now mandates explicit external creation of channel instances to then be passed to the helper by pointer - remove AddSubBand with init params, now only by pointer (same reason as above)
- remove unused destructors - remove setters (mandate initializer constructor use) - add missing getters for implemented commands - add implementation TODOs - improve printing and align teminology with specs - add overflow asserts for field with size < 8 bits - remove empty lines and boilerplate
- re-implement GetNextTransmissionDelay and GetChannelForTx - remove now obsolete Shuffle method - add setter and getter for transmission power - correct ChMaskCntl spelling as per specifications - remove AddSubBand and SetLogicalChannel - move documentation to fix doxygen warning
+ more robust GetTxPowerIndex implementation
8fff5bc
to
63e0e6f
Compare
Had to fix a dependency issue with our CI pipeline that was producing and error during documentation checks. Rebased all commits onto |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #184 +/- ##
===========================================
+ Coverage 77.64% 84.55% +6.90%
===========================================
Files 66 67 +1
Lines 6831 7017 +186
===========================================
+ Hits 5304 5933 +629
+ Misses 1527 1084 -443 ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is an effort to break #183 into more manageable changes for review purposes.
These changes have the goal to add test coverage for the LoRaWAN MAC commands currently implemented and the expected behavior when they are received by a device (i.e., setting the correct parameters etc.) This is still a big PR because (as you can imagine) these functionalities touch a large portion of the MAC layer itself. While I was at it I made an effort to "rework" some classes, to clean up the code, to actually expose what we need to access and to fill-in missing functionality. This was necessary to be able to write correct tests.
Here is the list of changes as found inside this PR's commits from oldest to most recent with some additional annotations in italics: