zephyr/subsys/lorawan
Jordan Yates 875f6a5302 lorawan: fix premature return in lorawan_send
Fixes an issue where `lorawan_send` would return prematurely when
`LORAWAN_MSG_CONFIRMED` is mixed with unconfirmed messages.

All calls to `LoRaMacMcpsRequest` result in `McpsConfirm` being run,
where the semaphore `mcps_confirm_sem` is given. However this semaphore
is only taken when `LORAWAN_MSG_CONFIRMED` is set.

Therefore if an unconfirmed message is sent, any following confirmed
messages will return from `lorawan_send` immediately as the semaphore
will be available from the previous send. The return value would also
be wrong for the same reasons.

Fixed by only giving the semaphore in situations when it is being
blocked on.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-01-19 09:02:43 -05:00
..
CMakeLists.txt lorawan: Cleanup error handling code 2020-10-08 12:15:38 +02:00
Kconfig lorawan: Add support for SystemMaxRxError 2020-10-08 12:15:38 +02:00
lorawan.c lorawan: fix premature return in lorawan_send 2021-01-19 09:02:43 -05:00
lw_priv.c lorawan: Cleanup error handling code 2020-10-08 12:15:38 +02:00
lw_priv.h lorawan: Cleanup error handling code 2020-10-08 12:15:38 +02:00