Skip to content

Commit 0f4cd42

Browse files
committed
gs: Fix rctx field name in LBS LNS upstream messages
The rctx field in the upinfo object of upstream messages was misspelled as rtcx, so the radio context reported by gateways was ignored and the antenna index in the uplink metadata was always 0. The parsed value is now reflected in the uplink metadata and echoed in class A downlinks.
1 parent 9def57c commit 0f4cd42

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ For details about compatibility between different releases, see the **Commitment
2121

2222
### Fixed
2323

24+
- Parsing of the `rctx` field in the `upinfo` object of upstream messages received via the LoRa Basics Station LNS protocol. The field name was misspelled as `rtcx`, so the radio context reported by gateways was ignored. The antenna index in the uplink metadata now reflects the reported radio context and is echoed back in class A downlinks, instead of always being 0.
25+
2426
### Security
2527

2628
## [3.36.2] - 2026-08-17

pkg/gatewayserver/io/semtechws/lbslns/upstream.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var (
4444
// UpInfo provides additional metadata on each upstream message.
4545
type UpInfo struct {
4646
RxTime float64 `json:"rxtime"`
47-
RCtx int64 `json:"rtcx"`
47+
RCtx int64 `json:"rctx"`
4848
XTime int64 `json:"xtime"`
4949
GPSTime int64 `json:"gpstime"`
5050
RSSI float32 `json:"rssi"`

pkg/gatewayserver/io/semtechws/lbslns/upstream_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func TestMarshalJSON(t *testing.T) {
6161
},
6262
},
6363
},
64-
Expected: []byte(`{"msgtype":"jreq","MHdr":0,"JoinEui":"2222:2222:2222:2222","DevEui":"1111:1111:1111:1111","DevNonce":18000,"MIC":12345678,"RefTime":0,"DR":1,"Freq":868300000,"upinfo":{"rxtime":1548059982,"rtcx":0,"xtime":12666373963464220,"gpstime":0,"rssi":89,"snr":9.25}}`), //nolint: lll
64+
Expected: []byte(`{"msgtype":"jreq","MHdr":0,"JoinEui":"2222:2222:2222:2222","DevEui":"1111:1111:1111:1111","DevNonce":18000,"MIC":12345678,"RefTime":0,"DR":1,"Freq":868300000,"upinfo":{"rxtime":1548059982,"rctx":0,"xtime":12666373963464220,"gpstime":0,"rssi":89,"snr":9.25}}`), //nolint: lll
6565
},
6666
{
6767
Name: "UplinkDataFrame",
@@ -85,7 +85,7 @@ func TestMarshalJSON(t *testing.T) {
8585
},
8686
},
8787
},
88-
Expected: []byte(`{"msgtype":"updf","MHdr":64,"DevAddr":287454020,"FCtrl":48,"Fcnt":25,"FOpts":"FD","FPort":0,"FRMPayload":"Ymxhamthc25kJ3M=","MIC":12345678,"RefTime":0,"DR":1,"Freq":868300000,"upinfo":{"rxtime":1548059982,"rtcx":0,"xtime":12666373963464220,"gpstime":0,"rssi":89,"snr":9.25}}`), //nolint: lll
88+
Expected: []byte(`{"msgtype":"updf","MHdr":64,"DevAddr":287454020,"FCtrl":48,"Fcnt":25,"FOpts":"FD","FPort":0,"FRMPayload":"Ymxhamthc25kJ3M=","MIC":12345678,"RefTime":0,"DR":1,"Freq":868300000,"upinfo":{"rxtime":1548059982,"rctx":0,"xtime":12666373963464220,"gpstime":0,"rssi":89,"snr":9.25}}`), //nolint: lll
8989
},
9090
{
9191
Name: "TxConfirmation",

0 commit comments

Comments
 (0)