Skip to content

Commit

Permalink
[SX126x] Use length from startReceive in implicit header mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jgromes committed Dec 15, 2024
1 parent ded508c commit 75f087b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/modules/SX126x/SX126x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,12 @@ int16_t SX126x::startReceive() {
}

int16_t SX126x::startReceive(uint32_t timeout, RadioLibIrqFlags_t irqFlags, RadioLibIrqFlags_t irqMask, size_t len) {
(void)len;
// in implicit header mode, use the provided length if it is nonzero
// otherwise we trust the user has previously set the payload length manually
if((this->headerType == RADIOLIB_SX126X_LORA_HEADER_IMPLICIT) && (len != 0)) {
this->implicitLen = len;
}

int16_t state = startReceiveCommon(timeout, irqFlags, irqMask);
RADIOLIB_ASSERT(state);

Expand Down

0 comments on commit 75f087b

Please sign in to comment.