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

LoRaWAN: Style and bug fixes #6938

Merged
merged 5 commits into from Jun 11, 2018

Conversation

Projects
None yet
6 participants
@hasnainvirk
Contributor

hasnainvirk commented May 17, 2018

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

This comment has been minimized.

Contributor

hasnainvirk commented May 17, 2018

@hasnainvirk hasnainvirk force-pushed the hasnainvirk:style_and_bug_fixes branch from 9b056df to 93fa698 May 17, 2018

@hasnainvirk hasnainvirk force-pushed the hasnainvirk:style_and_bug_fixes branch from 93fa698 to 1baf2a4 May 17, 2018

@0xc0170

This comment has been minimized.

Member

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

This comment has been minimized.

Contributor

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-arm

This comment has been minimized.

Contributor

kjbracey-arm commented May 17, 2018

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

This comment has been minimized.

Member

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 hasnainvirk:style_and_bug_fixes branch 3 times, most recently from 4925543 to 6764e00 May 17, 2018

@hasnainvirk

This comment has been minimized.

Contributor

hasnainvirk commented 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;

This comment has been minimized.

@kivaisan

kivaisan May 21, 2018

Contributor

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

@hasnainvirk hasnainvirk force-pushed the hasnainvirk:style_and_bug_fixes branch from 6764e00 to ea19998 May 21, 2018

@hasnainvirk

This comment has been minimized.

Contributor

hasnainvirk commented May 21, 2018

@kjbracey-arm Please review again.

@hasnainvirk

This comment has been minimized.

Contributor

hasnainvirk commented May 21, 2018

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

@hasnainvirk

This comment has been minimized.

Contributor

hasnainvirk commented May 22, 2018

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

@cmonr

This comment has been minimized.

Contributor

cmonr commented May 22, 2018

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

@0xc0170 0xc0170 added needs: CI and removed needs: review labels May 24, 2018

@0xc0170

This comment has been minimized.

Member

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-arm and kivaisan via 69f23a0 May 24, 2018

@hasnainvirk hasnainvirk force-pushed the hasnainvirk:style_and_bug_fixes branch from ea19998 to 69f23a0 May 24, 2018

@hasnainvirk

This comment has been minimized.

Contributor

hasnainvirk commented May 24, 2018

@0xc0170 Rebased. Please review and CI required.

@hasnainvirk

This comment has been minimized.

Contributor

hasnainvirk commented May 25, 2018

@0xc0170 Could you please investigate why it failed ?

@cmonr

This comment has been minimized.

Contributor

cmonr commented May 31, 2018

@hasnainvirk Looks like another rebase will be needed.

kivaisan and others added some commits May 17, 2018

Moving missing public data structures
A few of the structures were missing from the storage space which is
visible topublic APIs. Suc structures are now being added.
Style changes only
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.
dr_range bitfield should be unsigned integer
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.
Lora: Check for valid ABP params
Check that ABP dev_addr and nwk_id is non-zero and keys are not null.

@hasnainvirk hasnainvirk force-pushed the hasnainvirk:style_and_bug_fixes branch from 69f23a0 to 0f0b3be Jun 1, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Jun 4, 2018

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

@cmonr cmonr added needs: review and removed needs: work labels Jun 4, 2018

@cmonr cmonr added needs: CI and removed needs: review labels Jun 5, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Jun 6, 2018

/morph build

@mbed-ci

This comment has been minimized.

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

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@cmonr cmonr added needs: review and removed needs: CI labels Jun 7, 2018

@hasnainvirk

This comment has been minimized.

Contributor

hasnainvirk commented Jun 11, 2018

@cmonr @0xc0170 Can this go in please ?

@cmonr cmonr merged commit b00a91d into ARMmbed:master Jun 11, 2018

13 checks passed

AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
travis-ci/astyle Passed, 914 files
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9754 cycles (+154 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/littlefs Passed, code size is 9964B (+0.00%)
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment