From 6871490a12e1f1ae97849ba5c049794d028de498 Mon Sep 17 00:00:00 2001 From: Alastair Bain Date: Thu, 7 Nov 2024 17:31:18 +1300 Subject: [PATCH] Attempt to not schedule a downlink for a Halter mode non-class A uplink --- pkg/networkserver/grpc_gsns.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/networkserver/grpc_gsns.go b/pkg/networkserver/grpc_gsns.go index e0f00e46e6..2dc5f5405f 100644 --- a/pkg/networkserver/grpc_gsns.go +++ b/pkg/networkserver/grpc_gsns.go @@ -1035,7 +1035,13 @@ func (ns *NetworkServer) handleDataUplink(ctx context.Context, up *ttnpb.UplinkM paths := ttnpb.AddFields(matched.SetPaths, "mac_state.recent_uplinks", ) - stored.MacState.RecentUplinks = appendRecentUplink(stored.MacState.RecentUplinks, up, recentUplinkCount) + + // HALTER - if this is data mode uplink (not class A, no corresponding Rx1/Rx2 window), don't schedule a downlink, do this by not adding the uplink to the recent uplinks list + const nonClassADataUplinkPort = 222 + if up.Payload.GetMacPayload().FPort != nonClassADataUplinkPort { + stored.MacState.RecentUplinks = appendRecentUplink(stored.MacState.RecentUplinks, up, recentUplinkCount) + } + // HALTER - end if matched.DataRateIndex < stored.MacState.CurrentParameters.AdrDataRateIndex { // Device lowers TX power index before lowering data rate index according to the spec. @@ -1411,6 +1417,8 @@ func (ns *NetworkServer) HandleUplink(ctx context.Context, up *ttnpb.UplinkMessa return nil, err } + // AB here is where uplink is processed, probably? + ctx = events.ContextWithCorrelationID(ctx, up.CorrelationIds...) ctx = appendUplinkCorrelationID(ctx) up.CorrelationIds = events.CorrelationIDsFromContext(ctx)