Skip to content

LoRaWAN: Message flags correction #6960

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 1 commit into from
May 24, 2018
Merged

Conversation

hasnainvirk
Copy link
Contributor

Description

Uplink multicast is not allowed. Proprietary messages cannot be
of type unconfirmed and unconfirmed.

Some error flags are introduced which check in the UP direction
if the user have used the flags wrongly.

Target version

Mbed OS-5.9-rc1

Pull request type

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

@hasnainvirk
Copy link
Contributor Author

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

@hasnainvirk hasnainvirk changed the title Message flags correction LoRaWAN: Message flags correction May 21, 2018
@hasnainvirk
Copy link
Contributor Author

@0xc0170 Could you please reset the CI build for this PR ?

}

// case 2: check if both CONFIRMED and UNCONFIRMED flags set
if ((flags & ERR_FLAG_MUTUAL_EXCLUSION) == ERR_FLAG_MUTUAL_EXCLUSION) {
Copy link
Contributor

@kjbracey kjbracey May 21, 2018

Choose a reason for hiding this comment

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

What if neither are set (and it's a normal message)? Seems like this might be simpler if confirmed/unconfirmed was a single flag.

This is all very wordy to do a very simple test. I'd be vaguely inclined to just list out the valid values thus:

switch (flags) {   /* or (flags & MSG_FLAG_MASK) ? */
     case UNCONFIRMED:
     case CONFIRMED:
     case PROPRIETARY:
          break;
  
     default:
          tr_error("Invalid send flags");
          return LORAWAN_STATUS_PARAMETER_INVALID;
 }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

case 1 handles if nothing is set. Multicast flag cannot be set for uplink. And all the flags are mutually exclusive, so they can't be used in pairs for uplink.

Uplink multicast is not allowed. Proprietary messages cannot be
of type unconfirmed and unconfirmed.
@hasnainvirk
Copy link
Contributor Author

@kjbracey-arm Please review again.

@cmonr
Copy link
Contributor

cmonr commented May 22, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented May 23, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented May 23, 2018

@cmonr
Copy link
Contributor

cmonr commented May 23, 2018

Looked like there was a problem device in CI. Restarting test.

/morph test

@cmonr
Copy link
Contributor

cmonr commented May 23, 2018

Shuffling around some jobs.

/morph export-build

@cmonr
Copy link
Contributor

cmonr commented May 23, 2018

/morph test

@mbed-ci
Copy link

mbed-ci commented May 24, 2018

@mbed-ci
Copy link

mbed-ci commented May 24, 2018

@cmonr cmonr merged commit 863259e into ARMmbed:master May 24, 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.

7 participants