GrumpyOldPizza / ArduinoCore-stm32l0

Arduino Core for STM32L0
125 stars 67 forks source link

Empty lora payload sent on port 0 #177

Open jpmeijers opened 3 years ago

jpmeijers commented 3 years ago

If I send a lorawan message with an empty payload, even if I specify a port, the message is sent on port 0. This is invalid, as port 0 is reserved for mac commands.

Screenshot from 2021-03-03 08-47-07

jpmeijers commented 3 years ago

I believe the issue is related to this block of code: https://github.com/GrumpyOldPizza/ArduinoCore-stm32l0/blob/b1cf1cd6eba2f06bbe4edbe76aa43ae5971e8d8c/system/STM32L0xx/Source/LoRa/Mac/LoRaMac.c#L2308-L2310

The port is only added to the payload if the payload is > 0, but that should be >=0.