Skip to content

Making cancel_sending() API robust #8299

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
Oct 15, 2018
Merged

Conversation

hasnainvirk
Copy link
Contributor

Description

If the packet is already handed over to the PHY layer, we shouldn't be
able to cancel that particular transmission. In addition to that if the
backoff timer is either not applied or has been deactivated, should end
up in no-op rather than having normal termination. A new error code has
been introduced to cover no-op cases. This error code replaces the
compliance test related error code which is no longer relevant.
clear_tx_pipe() does nothing if:
- The stack cannot cancel TX (already handed over to PHY)
- The backoff timer is not active at all
- The event is disaptched to schedule

stop_sending() will only post process ongoing TX if the pipe was
definitely cleared.

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Breaking change

@hasnainvirk
Copy link
Contributor Author

@0xc0170 0xc0170 requested a review from a team October 2, 2018 10:44
@hasnainvirk
Copy link
Contributor Author

@kivaisan @AnttiKauppila Please review.

Copy link
Contributor

@kivaisan kivaisan left a comment

Choose a reason for hiding this comment

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

I think you should set _can_cancel_tx = true after sending. With current proposal if you first successfully send without backoff time, _can_cancel_tx is set to false in LoRaMac::schedule_tx(). If you now for some reason call cancel_sending(), clear_tx_pipe() will return LORAWAN_STATUS_BUSY instead of LORAWAN_StATUS_NO_OP.

If the packet is already handed over to the PHY layer, we shouldn't be
able to cancel that particular transmission. In addition to that if the
backoff timer is either not applied or has been deactivated, should end
up in no-op rather than having normal termination. A new error code has
been introduced to cover no-op cases. This error code replaces the
compliance test related error code which is no longer relevant.
clear_tx_pipe() does nothing if:
	- The stack cannot cancel TX (already handed over to PHY)
        - The backoff timer is not active at all
        - The event is disaptched to schedule

stop_sending() will only post process ongoin TX if the pipe was
definitely cleared.
@hasnainvirk
Copy link
Contributor Author

hasnainvirk commented Oct 2, 2018

@kivaisan restoring _can_cance_tx in LoRaMac::set_tx_ongoing(). Thanks for pointing that out.

@hasnainvirk
Copy link
Contributor Author

@0xc0170 Could you please review ?

@hasnainvirk
Copy link
Contributor Author

This goes in first #8183

@NirSonnenschein
Copy link
Contributor

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 14, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Oct 14, 2018

@mbed-ci
Copy link

mbed-ci commented Oct 14, 2018

@cmonr cmonr merged commit b666cd6 into ARMmbed:master Oct 15, 2018
cmonr pushed a commit to cmonr/mbed-os that referenced this pull request Oct 15, 2018
This reverts commit b666cd6, reversing
changes made to a9f4323.
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