Skip to content

LoRaWAN: Style and bug fixes #6938

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 5 commits into from
Jun 11, 2018
Merged

Conversation

hasnainvirk
Copy link
Contributor

Description

This PR fixes a few bugs and does most important style corrections as pointed out by CI.
TARGET: 5.9

Pull request type

[X] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

@hasnainvirk
Copy link
Contributor Author

@0xc0170 @kivaisan @kjbracey-arm Please review.

@hasnainvirk hasnainvirk force-pushed the style_and_bug_fixes branch from 9b056df to 93fa698 Compare May 17, 2018 09:18
@hasnainvirk hasnainvirk force-pushed the style_and_bug_fixes branch from 93fa698 to 1baf2a4 Compare May 17, 2018 09:39
@0xc0170
Copy link
Contributor

0xc0170 commented May 17, 2018

@hasnainvirk 👍 , I can still see issues in AStyle, not certain if those files are ours or not (if 3rd party, we shall add them to astyle ignore). Please review

@hasnainvirk
Copy link
Contributor Author

hasnainvirk commented May 17, 2018

@0xc0170 Yes there are still warnings. I did not change them as that bloats the code. It becomes unreadable if I follow the style guide.

@kjbracey
Copy link
Contributor

Couple of astyle oddities there:

  • why is it sometimes pulling multiline function arguments to the left and sometimes aligning with the first argument? Can't see a line length reason. It doesn't seem to have a consistent rule.
  • It's sticking an extra level of indent in for cases incorporating curly brackets, making 3(!) levels of indent. Any way to avoid that?

I wouldn't generally take any tool too seriously on multiline alignment, but it's right on lots of the other stuff, like spaces around brackets and asterisks.

@0xc0170
Copy link
Contributor

0xc0170 commented May 17, 2018

Thanks @kjbracey-arm , will look at those oddities and report back. Not a blocker for this PR, but

I wouldn't generally take any tool too seriously on multiline alignment, but it's right on lots of the other stuff, like spaces around brackets and asterisks.

At least this could be fixed once for all.

@hasnainvirk hasnainvirk force-pushed the style_and_bug_fixes branch 3 times, most recently from 4925543 to 6764e00 Compare May 21, 2018 12:12
@hasnainvirk
Copy link
Contributor Author

Please review. @kjbracey-arm @kivaisan @0xc0170

kjbracey
kjbracey previously approved these changes May 21, 2018
kivaisan
kivaisan previously approved these changes May 21, 2018
(params->connection_u.abp.nwk_id == 0) ||
(params->connection_u.abp.nwk_skey == NULL) ||
(params->connection_u.abp.app_skey == NULL)) {
return LORAWAN_STATUS_PARAMETER_INVALID;
Copy link
Contributor

Choose a reason for hiding this comment

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

Change these to the same style as aboce done for OTAA checks. (|| operator at the beginning of the line.)

@hasnainvirk
Copy link
Contributor Author

@kjbracey-arm Please review again.

@hasnainvirk
Copy link
Contributor Author

@0xc0170 Same CI failure here as well. Please kick start the job again.

kjbracey
kjbracey previously approved these changes May 21, 2018
@hasnainvirk
Copy link
Contributor Author

@cmonr This needs CI. Actually this and #6960 can potentially go in before #6910

@cmonr
Copy link
Contributor

cmonr commented May 22, 2018

We'll start CI as soon as we can. Working through an issue behind the scenes.

@0xc0170
Copy link
Contributor

0xc0170 commented May 24, 2018

@hasnainvirk Can you rebase?

By the way , I am reviewing those astyle issues . I believe I already had it fixed but then reworked entire branch and this got lost. Will share a branch with a fix, that should make all lorawan code look good hopefully.

@hasnainvirk hasnainvirk dismissed stale reviews from kjbracey and kivaisan via 69f23a0 May 24, 2018 13:54
@hasnainvirk hasnainvirk force-pushed the style_and_bug_fixes branch from ea19998 to 69f23a0 Compare May 24, 2018 13:54
@hasnainvirk
Copy link
Contributor Author

@0xc0170 Rebased. Please review and CI required.

@hasnainvirk
Copy link
Contributor Author

@0xc0170 Could you please investigate why it failed ?

@0xc0170
Copy link
Contributor

0xc0170 commented May 26, 2018

Needs a rebase after another patch made it in. we can then start CI

@cmonr
Copy link
Contributor

cmonr commented May 31, 2018

@hasnainvirk Looks like another rebase will be needed.

Kimmo Vaisanen and others added 5 commits June 1, 2018 12:29
A few of the structures were missing from the storage space which is
visible topublic APIs. Suc structures are now being added.
Travis astyle check pointed out some of the style mismatches in the code.
Not all of them are worth changing as they make the code unreadable and
some of them are semantically wrong.

So in this commit, we have attempted to pick the most important style
mismatches and rectify.
If the value is an integer, the 4th bit is used for sign, so you can store
values upto 7 only whereas the datarate values could go upto 15. That's why
we need to turn this to an unsigned integer so that the last bit can also be used.
Check that ABP dev_addr and nwk_id is non-zero and keys are not null.
@cmonr
Copy link
Contributor

cmonr commented Jun 4, 2018

@kjbracey-arm @kivaisan Mind doing a re-review?

@cmonr
Copy link
Contributor

cmonr commented Jun 6, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jun 6, 2018

Build : SUCCESS

Build number : 2255
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6938/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Jun 7, 2018

@mbed-ci
Copy link

mbed-ci commented Jun 7, 2018

@hasnainvirk
Copy link
Contributor Author

@cmonr @0xc0170 Can this go in please ?

@cmonr cmonr merged commit b00a91d into ARMmbed:master Jun 11, 2018
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.

6 participants