Skip to content

Commit

Permalink
lorawan: make possible to send empty frames
Browse files Browse the repository at this point in the history
Empty frames are allowed by the LoRaWAN protocol and are actually useful
to open new RX slots or flush MAC commands in stack. Therefore allow the
data pointer to be NULL if len is 0.

Signed-off-by: Aurelien Jarno <[email protected]>
  • Loading branch information
aurel32 authored and nashif committed May 12, 2024
1 parent be682e2 commit a6fbfc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subsys/lorawan/lorawan.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ int lorawan_send(uint8_t port, uint8_t *data, uint8_t len,
int ret = 0;
bool empty_frame = false;

if (data == NULL) {
if (data == NULL && len > 0) {
return -EINVAL;
}

Expand Down

0 comments on commit a6fbfc0

Please sign in to comment.