Skip to content

Commit 637e396

Browse files
committed
Allow receiving less downlink tx ack items than items in downlink cmd.
1 parent fbba763 commit 637e396

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

internal/downlink/ack/ack.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,11 @@ func getDownlinkFrame(ctx *ackContext) error {
283283
}
284284

285285
// TODO: remove len(Items) != 0 check at next major release
286-
if len(ctx.DownlinkTXAck.Items) != 0 && len(ctx.DownlinkTXAck.Items) != len(ctx.DownlinkFrame.DownlinkFrame.Items) {
287-
return errors.New("length of ack items is not equal to length of downlink items")
286+
// Validate that we don't receive more ack items than downlink items that were
287+
// sent to the gateway. Receiving less acks is valid, e.g. the gateway might
288+
// ack the first item only.
289+
if len(ctx.DownlinkTXAck.Items) != 0 && len(ctx.DownlinkTXAck.Items) > len(ctx.DownlinkFrame.DownlinkFrame.Items) {
290+
return errors.New("tx ack contains more items than downlink command")
288291
}
289292

290293
// for backwards compatibility

0 commit comments

Comments
 (0)