Commit cf6f6a4
authored
Fix a dutycycle-related deadlock in ScheduleTx (#1287)
* Fix a dutycycle-related deadlock in ScheduleTx
When RegionNextChannel returns LORAMAC_STATUS_DUTYCYCLE_RESTRICTED with
a zero DutyCycleWaitTime value, do not return from the function after
skipping the creation of TxDelayedTimer. This would result in a
deadlock. Instead, let the rest of the function to proceed. Only return
if the delayed timer was actually started.
This change ensures that the end of the function with SendFrameOnChannel
has a chance to execute, either immediately when DutyCycleWaitTime == 0,
or later once this function is re-executed when TxDelayedTimer fires.
* Only check if TX can be delayed when really needed
When RegionNextChannel returns a zero dutycycle wait time, there is no
need to check if allowDelayedTx is true since the function will attempt
to transmit right away. Thus, the variable only needs to be tested if
there is an actual dutycycle wait time.
If allowDelayedTx is false, abort the function with
LORAMAC_STATUS_DUTYCYCLE_RESTRICTED.1 parent e182832 commit cf6f6a4
1 file changed
+13
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2901 | 2901 | | |
2902 | 2902 | | |
2903 | 2903 | | |
2904 | | - | |
2905 | | - | |
| 2904 | + | |
2906 | 2905 | | |
2907 | | - | |
2908 | | - | |
2909 | 2906 | | |
2910 | | - | |
2911 | | - | |
2912 | | - | |
2913 | | - | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
2914 | 2919 | | |
2915 | | - | |
2916 | 2920 | | |
2917 | 2921 | | |
2918 | 2922 | | |
| |||
0 commit comments