From c7e75f7326affabb6c8c2b9518a268563d229f5e Mon Sep 17 00:00:00 2001 From: Imre Halasz Date: Wed, 18 Dec 2024 15:54:29 +0100 Subject: [PATCH] ns: Add `LastBatteryPercentage` to the `ApplicationUplink` message --- pkg/networkserver/grpc_gsns.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/networkserver/grpc_gsns.go b/pkg/networkserver/grpc_gsns.go index b6fb6d6217..7290b474ef 100644 --- a/pkg/networkserver/grpc_gsns.go +++ b/pkg/networkserver/grpc_gsns.go @@ -1152,6 +1152,11 @@ func (ns *NetworkServer) handleDataUplink(ctx context.Context, up *ttnpb.UplinkM ConsumedAirtime: up.ConsumedAirtime, PacketErrorRate: mac.LossRate(stored.MacState, matched.phy), NetworkIds: ns.networkIdentifiers(ctx), + LastBatteryPercentage: &ttnpb.LastBatteryPercentage{ + FCnt: stored.MacState.LastDevStatusFCntUp, + Value: stored.BatteryPercentage, + ReceivedAt: stored.LastDevStatusReceivedAt, + }, }, }, })