-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
Simulator test added here https://github.com/ARMmbed/mbed-lora-tests-simulator-private/pull/7 |
@kivaisan @AnttiKauppila Please review. |
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.
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.
5be28dd
to
603ee28
Compare
@kivaisan restoring _can_cance_tx in LoRaMac::set_tx_ongoing(). Thanks for pointing that out. |
@0xc0170 Could you please review ? |
This goes in first #8183 |
/morph build |
Build : SUCCESSBuild number : 3348 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 2981 |
Test : SUCCESSBuild number : 3153 |
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