-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
@kjbracey-arm @AnttiKauppila @kivaisan @0xc0170 Please review. |
@0xc0170 Could you please reset the CI build for this PR ? |
features/lorawan/LoRaWANStack.cpp
Outdated
} | ||
|
||
// case 2: check if both CONFIRMED and UNCONFIRMED flags set | ||
if ((flags & ERR_FLAG_MUTUAL_EXCLUSION) == ERR_FLAG_MUTUAL_EXCLUSION) { |
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.
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;
}
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.
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.
@kjbracey-arm Please review again. |
/morph build |
Build : SUCCESSBuild number : 2114 Triggering tests/morph test |
Test : FAILUREBuild number : 1915 |
Looked like there was a problem device in CI. Restarting test. /morph test |
Shuffling around some jobs. /morph export-build |
/morph test |
Test : SUCCESSBuild number : 1923 |
Exporter Build : SUCCESSBuild number : 1755 |
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