Skip to content

Commit

Permalink
ns: Rename macspec helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
halimi committed Jan 2, 2025
1 parent b618ff3 commit 822e453
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/networkserver/mac/link_adr.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ func HandleLinkADRAns(
// with a LinkADRAns indicating which command elements were accepted and which were
// rejected. This behavior differs from when the uplink ADR bit is set, in which case the end-
// device accepts or rejects the entire command.
if macspec.UseADRBit(macState.LorawanVersion) {
if macspec.LinkADRReqRejected(macState.LorawanVersion) {
rejected = !pld.ChannelMaskAck ||
(adrEnabled && !pld.DataRateIndexAck) ||
(adrEnabled && !pld.TxPowerIndexAck)
Expand Down
5 changes: 3 additions & 2 deletions pkg/specification/macspec/specification.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,9 @@ func ValidateUplinkPayloadSize(v ttnpb.MACVersion) bool {
return compareMACVersion(v, ttnpb.MACVersion_MAC_V1_1) >= 0
}

// UseADRBit reports whether v uses the ADR bit in the FCtrl field.
func UseADRBit(v ttnpb.MACVersion) bool {
// LinkADRReqRejected reports whether v uses the ADR bit in the FCtrl field
// to modify which ACK bits needs to check in the LinkADRAns.
func LinkADRReqRejected(v ttnpb.MACVersion) bool {
return compareMACVersion(v, ttnpb.MACVersion_MAC_V1_0_3) >= 0 &&
compareMACVersion(v, ttnpb.MACVersion_MAC_V1_0_4) <= 0
}

0 comments on commit 822e453

Please sign in to comment.