Skip to content

Commit

Permalink
ns: Skip downlink for data upload
Browse files Browse the repository at this point in the history
  • Loading branch information
onizmx committed Jan 12, 2025
1 parent f96b71d commit b45cd40
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions pkg/networkserver/grpc_gsns.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ const (

// DeduplicationLimit is the number of metadata to deduplicate for a single transmission.
deduplicationLimit = 50

// If end device sends data upload packet using this special fport, do not attempt to schedule downlink since end device is not going to open rx windows
dataUploadFPort = 222
)

// UplinkDeduplicator represents an entity, that deduplicates uplinks and accumulates metadata.
Expand Down Expand Up @@ -1110,9 +1113,17 @@ func (ns *NetworkServer) handleDataUplink(ctx context.Context, up *ttnpb.UplinkM
matched.Device = stored
ctx = matched.Context

if err := ns.updateDataDownlinkTask(ctx, stored, time.Time{}); err != nil {
log.FromContext(ctx).WithError(err).Error("Failed to update downlink task queue after data uplink")
macPayload := up.Payload.GetMacPayload()
isDataUpload := false
if macPayload != nil && macPayload.GetFPort() == dataUploadFPort {
isDataUpload = true
}
if !isDataUpload {
if err := ns.updateDataDownlinkTask(ctx, stored, time.Time{}); err != nil {
log.FromContext(ctx).WithError(err).Error("Failed to update downlink task queue after data uplink")
}
}

if !matched.IsRetransmission {
var frmPayload []byte
switch pld.FPort {
Expand Down

0 comments on commit b45cd40

Please sign in to comment.